From 371404bedad79508aed33d3c5fb349bd899daf44 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Thu, 30 Nov 2017 15:31:35 -0800 Subject: [PATCH] qcacld-3.0: Handle set key response failure If roaming is happening and then a set key response is generated from WMA to PE, then there is a possibility of not finding the PE session as the roaming happened and new session is established. In such cases, return failure from PE to SME so that the set key command is released and the command queue is not stuck Change-Id: Ieba8ea76a2a53322f2e392e6b0bf30360b1e8f8a CRs-Fixed: 2150731 --- core/mac/inc/sir_api.h | 1 + .../mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index c5de550fc041..840c8dfd36cc 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -337,6 +337,7 @@ typedef enum eSirResultCodes { eSIR_SME_SEND_ACTION_FAIL, eSIR_SME_DEAUTH_STATUS, eSIR_PNO_SCAN_SUCCESS, + eSIR_SME_INVALID_SESSION, eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE } tSirResultCodes; diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 585be9011576..03c5286240a9 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -2724,8 +2724,9 @@ void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal mac_ctx, struct scheduler_msg *msg) { uint8_t resp_reqd = 1; - tLimMlmSetKeysCnf mlm_set_key_cnf; + struct sLimMlmSetKeysCnf mlm_set_key_cnf; uint8_t session_id = 0; + uint8_t sme_session_id; tpPESession session_entry; uint16_t key_len; uint16_t result_status; @@ -2737,11 +2738,16 @@ void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal mac_ctx, return; } session_id = ((tpSetStaKeyParams) msg->bodyptr)->sessionId; + sme_session_id = ((tpSetBssKeyParams) msg->bodyptr)->smesessionId; session_entry = pe_find_session_by_session_id(mac_ctx, session_id); if (session_entry == NULL) { pe_err("session does not exist for given session_id"); qdf_mem_free(msg->bodyptr); msg->bodyptr = NULL; + lim_send_sme_set_context_rsp(mac_ctx, + mlm_set_key_cnf.peer_macaddr, + 0, eSIR_SME_INVALID_SESSION, NULL, + sme_session_id, 0); return; } if (eLIM_MLM_WT_SET_STA_KEY_STATE != session_entry->limMlmState) { @@ -2802,9 +2808,10 @@ void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal mac_ctx, void lim_process_mlm_set_bss_key_rsp(tpAniSirGlobal mac_ctx, struct scheduler_msg *msg) { - tLimMlmSetKeysCnf set_key_cnf; + struct sLimMlmSetKeysCnf set_key_cnf; uint16_t result_status; uint8_t session_id = 0; + uint8_t sme_session_id; tpPESession session_entry; tpLimMlmSetKeysReq set_key_req; uint16_t key_len; @@ -2816,12 +2823,16 @@ void lim_process_mlm_set_bss_key_rsp(tpAniSirGlobal mac_ctx, return; } session_id = ((tpSetBssKeyParams) msg->bodyptr)->sessionId; + sme_session_id = ((tpSetBssKeyParams) msg->bodyptr)->smesessionId; session_entry = pe_find_session_by_session_id(mac_ctx, session_id); if (session_entry == NULL) { pe_err("session does not exist for given sessionId [%d]", session_id); qdf_mem_free(msg->bodyptr); msg->bodyptr = NULL; + lim_send_sme_set_context_rsp(mac_ctx, set_key_cnf.peer_macaddr, + 0, eSIR_SME_INVALID_SESSION, NULL, + sme_session_id, 0); return; } if (eLIM_MLM_WT_SET_BSS_KEY_STATE == session_entry->limMlmState) {