summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Qian <zhangq@codeaurora.org>2017-08-24 18:36:28 +0800
committerZhang Qian <zhangq@codeaurora.org>2017-08-25 15:44:12 +0800
commit2ec505640b4e5d350bc74a3dbeb86c80b6ecb7ee (patch)
treea7c3dd64e8ae578ce5d1dcd0752e7a4a3bb1f607
parent90aa62774bbe54598123b449a37e9d68b64f39a1 (diff)
qcacld-3.0: Correct cached connection info
qcacld-2.0 to qcacld-3.0 propagation The variables used for cached ssid and authentication type will be cleared after disconnection, hence user will get incorrect info from vendor event after disconnection. Use separate variables to save last ssid and auth info. This is to fix issues of change I5b64d9942a54d35eac0f08b4d8fbed9d1d66a504. Change-Id: Icc1a5d53e33d650726905e50e4846b77b10cf4ee CRs-Fixed: 2098560
-rw-r--r--core/hdd/inc/wlan_hdd_assoc.h4
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c11
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c12
-rw-r--r--core/sme/src/csr/csr_api_roam.c2
4 files changed, 19 insertions, 10 deletions
diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h
index 7ea7fabd26b2..8578ebfc3779 100644
--- a/core/hdd/inc/wlan_hdd_assoc.h
+++ b/core/hdd/inc/wlan_hdd_assoc.h
@@ -175,6 +175,8 @@ struct hdd_conn_flag {
* @signal: holds rssi info
* @assoc_status_code: holds assoc fail reason
* @congestion: holds congestion percentage
+ * @last_ssid: holds last ssid
+ * @last_auth_type: holds last auth type
*/
typedef struct connection_info_s {
eConnectionState connState;
@@ -207,6 +209,8 @@ typedef struct connection_info_s {
int8_t signal;
int32_t assoc_status_code;
uint32_t cca;
+ tCsrSSIDInfo last_ssid;
+ eCsrAuthType last_auth_type;
} connection_info_t;
/* Forward declarations */
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index b745cd49f775..15e1ed5a8237 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -881,6 +881,8 @@ hdd_conn_save_connect_info(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo,
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;
@@ -889,6 +891,9 @@ hdd_conn_save_connect_info(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo,
qdf_mem_copy(&pHddStaCtx->conn_info.SSID.SSID,
&pRoamInfo->u.pConnectedProfile->SSID,
sizeof(tSirMacSSid));
+ qdf_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 =
@@ -1451,10 +1456,10 @@ static void hdd_print_bss_info(hdd_station_ctx_t *hdd_sta_ctx)
hdd_info("dot11mode: %d",
hdd_sta_ctx->conn_info.dot11Mode);
hdd_info("AKM: %d",
- hdd_sta_ctx->conn_info.authType);
+ hdd_sta_ctx->conn_info.last_auth_type);
hdd_info("ssid: %.*s",
- hdd_sta_ctx->conn_info.SSID.SSID.length,
- hdd_sta_ctx->conn_info.SSID.SSID.ssId);
+ hdd_sta_ctx->conn_info.last_ssid.SSID.length,
+ hdd_sta_ctx->conn_info.last_ssid.SSID.ssId);
hdd_info("roam count: %d",
hdd_sta_ctx->conn_info.roam_count);
hdd_info("ant_info: %d",
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 3e8109bc1f30..ee66c4a58cd7 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -3344,7 +3344,7 @@ static const struct nla_policy
hdd_get_station_policy[STATION_MAX + 1] = {
[STATION_INFO] = {.type = NLA_FLAG},
[STATION_ASSOC_FAIL_REASON] = {.type = NLA_FLAG},
- [STATION_REMOTE] = {.type = NLA_BINARY, .len = QDF_MAC_ADDR_SIZE},
+ [STATION_REMOTE] = {.type = NLA_UNSPEC, .len = QDF_MAC_ADDR_SIZE},
};
/**
@@ -3622,8 +3622,8 @@ hdd_add_link_standard_info(struct sk_buff *skb,
goto fail;
if (nla_put(skb,
NL80211_ATTR_SSID,
- hdd_sta_ctx->conn_info.SSID.SSID.length,
- hdd_sta_ctx->conn_info.SSID.SSID.ssId)) {
+ hdd_sta_ctx->conn_info.last_ssid.SSID.length,
+ hdd_sta_ctx->conn_info.last_ssid.SSID.ssId)) {
hdd_err("put fail");
goto fail;
}
@@ -3692,14 +3692,14 @@ 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.SSID.SSID.length) +
+ 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) +
(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.authType) +
+ 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);
@@ -3736,7 +3736,7 @@ static int hdd_get_station_info(hdd_context_t *hdd_ctx,
hdd_sta_ctx->conn_info.roam_count) ||
nla_put_u32(skb, INFO_AKM,
hdd_convert_auth_type(
- hdd_sta_ctx->conn_info.authType)) ||
+ hdd_sta_ctx->conn_info.last_auth_type)) ||
nla_put_u32(skb, WLAN802_11_MODE,
hdd_convert_dot11mode(
hdd_sta_ctx->conn_info.dot11Mode))) {
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 4da52f6131ab..240ca05a05ca 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -7110,6 +7110,7 @@ static void csr_roam_process_join_res(tpAniSirGlobal mac_ctx,
}
session = CSR_GET_SESSION(mac_ctx, session_id);
+ qdf_mem_set(&roam_info, sizeof(roam_info), 0);
conn_profile = &session->connectedProfile;
if (eCsrReassocSuccess == res) {
roam_info.reassoc = true;
@@ -7119,7 +7120,6 @@ static void csr_roam_process_join_res(tpAniSirGlobal mac_ctx,
ind_qos = SME_QOS_CSR_ASSOC_COMPLETE;
}
sme_debug("receives association indication");
- qdf_mem_set(&roam_info, sizeof(roam_info), 0);
/* always free the memory here */
if (session->pWpaRsnRspIE) {
session->nWpaRsnRspIeLength = 0;