diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 00a51cdbc751..6be204233968 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -332,7 +332,8 @@ struct hdd_adapter *hdd_get_sta_connection_in_progress( 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->session_id)) { hdd_debug("session_id %d: Key exchange is in progress", adapter->session_id); return adapter; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2549ce303ec7..15feba8f9cc2 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -13095,9 +13095,9 @@ bool hdd_is_connection_in_progress(uint8_t *session_id, hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); if ((eConnectionState_Associated == - hdd_sta_ctx->conn_info.connState) - && (false == - hdd_sta_ctx->conn_info.uIsAuthenticated)) { + hdd_sta_ctx->conn_info.connState) + && sme_is_sta_key_exchange_in_progress( + hdd_ctx->hHal, adapter->session_id)) { sta_mac = (uint8_t *) &(adapter->mac_addr.bytes[0]); hdd_debug("client " MAC_ADDRESS_STR diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 231a8896f774..350242b49d45 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -2168,4 +2168,16 @@ static inline int sme_update_he_rx_stbc_cap(tHalHandle hal, uint8_t session_id, } #endif +/** + * 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/common/sme_api.c b/core/sme/src/common/sme_api.c index 20b08b7d1aaa..ce05979c539f 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16237,3 +16237,15 @@ QDF_STATUS sme_handle_sae_msg(tHalHandle hal, uint8_t session_id, return qdf_status; } #endif + +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)) { + sme_err("Invalid session id: %d", session_id); + return false; + } + + return CSR_IS_WAIT_FOR_KEY(mac_ctx, session_id); +}