qcacld-3.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
This commit is contained in:
Vignesh Viswanathan 2018-02-14 15:34:47 +05:30 • committed by snandini
commit 0a569299e8
4 changed files with 29 additions and 4 deletions

View file

@ -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;

View file

@ -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

View file

@ -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 ) */

View file

@ -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);
}