summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVignesh Viswanathan <viswanat@codeaurora.org>2018-04-04 16:44:16 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-04-19 22:14:19 -0700
commit7bc5e66cbb93e3da89ed9a0deca848c3017928cd (patch)
tree2105f75eb8c4eb6dfd89744fa920d00c6e45384b
parent4856507308ad4a63ffd72d5ab9c2960edf4282a3 (diff)
qcacld-2.0: Check for SME state in hdd_get_sta_connection_in_progress
Currently in hdd_get_sta_connection_in_progress, conn_info.uIsAuthenticated is used to check if the STA connection is in progress. However, this might not reflect the actual state and might still lead to the deadlock scenario fixed in I23ad1fc96882abeaae2d1b051659ea6d24b07428. Add new API to check for SME state for key exchange in progress and use it in hdd_get_sta_connection_in_progress. Change-Id: I7d6199ed8c81a113c4e3f30538d74fb675e730ff CRs-Fixed: 2189814
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c3
-rw-r--r--CORE/SME/inc/sme_Api.h12
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c13
3 files changed, 27 insertions, 1 deletions
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 39d1af2d7293..f0511774ca8b 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -6349,7 +6349,8 @@ hdd_adapter_t *hdd_get_sta_connection_in_progress(hdd_context_t *hdd_ctx)
return adapter;
} else if ((eConnectionState_Associated ==
hdd_sta_ctx->conn_info.connState) &&
- !hdd_sta_ctx->conn_info.uIsAuthenticated) {
+ sme_is_sta_key_exchange_in_progress(
+ hdd_ctx->hHal, adapter->sessionId)) {
hddLog(LOG1, FL("session_id %d: Key exchange is in progress"),
adapter->sessionId);
return adapter;
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 530c9ff144e1..36d79bf68483 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -4878,4 +4878,16 @@ eHalStatus sme_set_chip_pwr_save_fail_cb(tHalHandle hal, void (*cb)( void *,
eHalStatus sme_set_ac_txq_optimize(tHalHandle hal_handle, uint8_t *value);
VOS_STATUS sme_mnt_filter_type_cmd(struct sme_mnt_filter_type_req *input);
+
+/**
+ * sme_is_sta_key_exchange_in_progress() - checks whether the STA/P2P client
+ * session has key exchange in progress
+ *
+ * @hal: global hal handle
+ * @session_id: session id
+ *
+ * Return: true - if key exchange in progress
+ * false - if not in progress
+ */
+bool sme_is_sta_key_exchange_in_progress(tHalHandle hal, uint8_t session_id);
#endif //#if !defined( __SME_API_H )
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index c5841a4d8a8d..af82624f56f8 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -20663,3 +20663,16 @@ eHalStatus sme_clear_random_mac(tHalHandle hal, uint32_t session_id,
}
return status;
}
+
+bool sme_is_sta_key_exchange_in_progress(tHalHandle hal, uint8_t session_id)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Invalid session %d"), session_id);
+ return false;
+ }
+
+ return CSR_IS_WAIT_FOR_KEY(mac_ctx, session_id);
+}