summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryeshwanth sriram guntuka <ysriramg@codeaurora.org>2017-07-11 17:05:28 +0530
committersnandini <snandini@codeaurora.org>2017-08-08 16:37:38 -0700
commit1628c69f60288cdc11119ff3b5287f5fa186bfbf (patch)
tree42978a9cffbcf5868b0f7a6edce09a9ed1763478
parentf0561f0bceb5bfb164bdd81895d27c5723f1c079 (diff)
qcacld-3.0: Add delay in sending open system auth frame
On receiving auth resp with algo not supported status code, open system auth is sent to firmware. There is a possibility that AP does not receive ack sent by DUT and retries auth frame. The retry frame could be received at host after open sys auth req is sent to firmware resulting in auth failure. Fix is to send open system auth frame after timer of 15msec expires. Change-Id: I6bc7097ec7568fc65a379c7c31c96d5874f1e216 CRs-Fixed: 2075272
-rw-r--r--core/mac/inc/ani_global.h5
-rw-r--r--core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c39
-rw-r--r--core/mac/src/pe/lim/lim_timer_utils.c8
-rw-r--r--core/mac/src/pe/lim/lim_utils.c41
-rw-r--r--core/mac/src/pe/lim/lim_utils.h12
5 files changed, 77 insertions, 28 deletions
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index fe5791c673de..72808f82ff9b 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -333,6 +333,11 @@ typedef struct sLimTimers {
*/
TX_TIMER gLimActiveToPassiveChannelTimer;
TX_TIMER g_lim_periodic_auth_retry_timer;
+ /*
+ * This timer is used for delay between shared auth failure and
+ * open auth start
+ */
+ TX_TIMER open_sys_auth_timer;
/* ********************TIMER SECTION ENDS************************************************** */
/* ALL THE FIELDS BELOW THIS CAN BE ZEROED OUT in lim_initialize */
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 033665e97203..8fab278e6262 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
@@ -473,8 +473,7 @@ void lim_pmf_comeback_timer_callback(void *context)
*/
void lim_process_mlm_auth_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg)
{
- tAniAuthType auth_type, auth_mode;
- tLimMlmAuthReq *auth_req;
+ tAniAuthType auth_type;
tLimMlmAuthCnf *auth_cnf;
tpPESession session_entry;
@@ -544,34 +543,18 @@ void lim_process_mlm_auth_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg)
* When shared authentication fails with reason
* code "13" and authType set to 'auto switch',
* Try with open Authentication
+ * There is a possibility that AP does not receive
+ * ack and retries auth frame. The retry frame could be
+ * received at host after open sys auth is sent to firmware
+ * resulting in auth failure. So, to fix this issue, open system
+ * auth frame is sent to firmware after timer of 15msec expires.
*/
- auth_mode = eSIR_OPEN_SYSTEM;
- /* Trigger MAC based Authentication */
- auth_req = qdf_mem_malloc(sizeof(tLimMlmAuthReq));
- if (NULL == auth_req) {
- pe_err("mlmAuthReq :Memory alloc failed");
- return;
- }
- if (session_entry->limSmeState ==
- eLIM_SME_WT_AUTH_STATE) {
- sir_copy_mac_addr(auth_req->peerMacAddr,
- session_entry->bssId);
- } else {
- qdf_mem_copy((uint8_t *)&auth_req->peerMacAddr,
- (uint8_t *)&mac_ctx->lim.gLimPreAuthPeerAddr,
- sizeof(tSirMacAddr));
+ mac_ctx->lim.limTimers.open_sys_auth_timer.sessionId =
+ auth_cnf->sessionId;
+ if (tx_timer_activate(&mac_ctx->lim.limTimers.
+ open_sys_auth_timer) != TX_SUCCESS) {
+ pe_err("failed to activate system Auth timer");
}
- auth_req->authType = auth_mode;
- /* Update PE session Id */
- auth_req->sessionId = auth_cnf->sessionId;
- if (wlan_cfg_get_int(mac_ctx,
- WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
- (uint32_t *) &auth_req->authFailureTimeout)
- != eSIR_SUCCESS) {
- pe_err("Fail:retrieve AuthFailureTimeout");
- }
- lim_post_mlm_message(mac_ctx, LIM_MLM_AUTH_REQ,
- (uint32_t *) auth_req);
return;
} else {
/* MAC based authentication failure */
diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c
index 14e71a082d6b..bd3f92b9fc0d 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.c
+++ b/core/mac/src/pe/lim/lim_timer_utils.c
@@ -133,6 +133,13 @@ static bool lim_create_non_ap_timers(tpAniSirGlobal pMac)
return false;
}
+ if (tx_timer_create(pMac, &pMac->lim.limTimers.open_sys_auth_timer,
+ "open system Auth timer", lim_send_open_system_auth, 0,
+ SYS_MS_TO_TICKS(15), 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
+ pe_err("failed to create open system Auth timer");
+ return false;
+ }
+
if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
&cfgValue) != eSIR_SUCCESS)
pe_err("could not retrieve AssocFailureTimeout value");
@@ -380,6 +387,7 @@ err_timer:
tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
+ tx_timer_delete(&pMac->lim.limTimers.open_sys_auth_timer);
tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index ba5efc108fe7..334440f8feb2 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -511,6 +511,43 @@ void lim_print_msg_name(tpAniSirGlobal pMac, uint16_t logLevel, uint32_t msgType
pe_debug("Msg: %s", lim_msg_str(msgType));
}
+void lim_send_open_system_auth(void *ctx, uint32_t param)
+{
+ tLimMlmAuthReq *auth_req;
+ tpPESession session_entry;
+ tpAniSirGlobal mac_ctx = (tpAniSirGlobal)ctx;
+ uint8_t session_id;
+
+ session_id = mac_ctx->lim.limTimers.open_sys_auth_timer.sessionId;
+ session_entry = pe_find_session_by_session_id(mac_ctx, session_id);
+
+ if (!session_entry)
+ return;
+ /* Trigger MAC based Authentication */
+ auth_req = qdf_mem_malloc(sizeof(tLimMlmAuthReq));
+ if (!auth_req) {
+ pe_err("mlmAuthReq :Memory alloc failed");
+ lim_handle_sme_join_result(mac_ctx,
+ eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
+ eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS,
+ session_entry);
+ tx_timer_deactivate(&mac_ctx->lim.limTimers.
+ open_sys_auth_timer);
+ return;
+ }
+ sir_copy_mac_addr(auth_req->peerMacAddr, session_entry->bssId);
+ auth_req->authType = eSIR_OPEN_SYSTEM;
+ /* Update PE session Id */
+ auth_req->sessionId = session_id;
+ if (wlan_cfg_get_int(mac_ctx, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
+ (uint32_t *) &auth_req->authFailureTimeout) != eSIR_SUCCESS) {
+ pe_err("Fail:retrieve AuthFailureTimeout");
+ }
+ lim_post_mlm_message(mac_ctx, LIM_MLM_AUTH_REQ, (uint32_t *) auth_req);
+ tx_timer_deactivate(&mac_ctx->lim.limTimers.open_sys_auth_timer);
+
+}
+
/**
* lim_init_mlm() - This function is called by limProcessSmeMessages() to
* initialize MLM state machine on STA
@@ -630,6 +667,10 @@ void lim_cleanup_mlm(tpAniSirGlobal mac_ctx)
tx_timer_deactivate(&lim_timer->gLimAssocFailureTimer);
tx_timer_delete(&lim_timer->gLimAssocFailureTimer);
+ /* Deactivate and delete Open system auth timer. */
+ tx_timer_deactivate(&lim_timer->open_sys_auth_timer);
+ tx_timer_delete(&lim_timer->open_sys_auth_timer);
+
/* Deactivate and delete Authentication failure timer. */
tx_timer_deactivate(&lim_timer->gLimAuthFailureTimer);
tx_timer_delete(&lim_timer->gLimAuthFailureTimer);
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index b82219ce140a..4a3cd163d8f4 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -104,6 +104,18 @@ void lim_print_sme_state(tpAniSirGlobal pMac, uint16_t logLevel,
tLimSmeStates state);
void lim_print_msg_name(tpAniSirGlobal pMac, uint16_t logLevel, uint32_t msgType);
+/**
+ * lim_send_open_system_auth() - api to send open system auth frame
+ * @ctx: Pointer to global mac structure
+ * @session_id: session id
+ *
+ * This function is used to send open system auth when
+ * shared auth fails with reason-algo not supported
+ *
+ * Return: None
+ */
+void lim_send_open_system_auth(void *ctx, uint32_t param);
+
extern tSirRetStatus lim_send_set_max_tx_power_req(tpAniSirGlobal pMac,
int8_t txPower,
tpPESession pSessionEntry);