summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadma, Santhosh Kumar <skpadma@codeaurora.org>2018-03-07 18:09:49 +0530
committerSunil Ravi <sunilravi@google.com>2018-12-21 23:56:49 +0000
commitbc4aea3c46a84692ad1f53a82434a70f52ed0ec2 (patch)
treeded4a70ebcc2fd9c02f9054e246a5b354426ef15
parent69375d1ad8bb746d22f1d83e62ea2d28c73adb6a (diff)
downloadqcacld-bc4aea3c46a84692ad1f53a82434a70f52ed0ec2.tar.gz
qcacld-3.0: Add SAE auth timer
Add changes related to SAE auth timer to handle SAE authentication. Start SAE auth timer of duration LIM_AUTH_SAE_TIMER_MS when driver wants to trigger SAE authentication. If SAE authentication is not completed in LIM_AUTH_SAE_TIMER_MS, then report failure to supplicant. Change-Id: I65f0cb01faa1194c133013eaea4a5d8554a045d2 CRs-Fixed: 2029357
-rw-r--r--core/mac/inc/ani_global.h3
-rw-r--r--core/mac/src/include/sir_params.h2
-rw-r--r--core/mac/src/pe/lim/lim_process_message_queue.c1
-rw-r--r--core/mac/src/pe/lim/lim_process_mlm_req_messages.c56
-rw-r--r--core/mac/src/pe/lim/lim_timer_utils.c37
-rw-r--r--core/mac/src/pe/lim/lim_timer_utils.h5
-rw-r--r--core/mac/src/pe/lim/lim_utils.c4
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/mac_trace.c1
8 files changed, 106 insertions, 3 deletions
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index 571e6c340c..bb6d1d1661 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -334,6 +334,9 @@ typedef struct sLimTimers {
TX_TIMER gLimActiveToPassiveChannelTimer;
TX_TIMER g_lim_periodic_auth_retry_timer;
+ /* SAE authentication related timer */
+ TX_TIMER sae_auth_timer;
+
/* ********************TIMER SECTION ENDS************************************************** */
/* ALL THE FIELDS BELOW THIS CAN BE ZEROED OUT in lim_initialize */
/* **************************************************************************************** */
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index f696e805ff..9032e26cd6 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -795,6 +795,8 @@ struct sir_mgmt_msg {
(SIR_LIM_TIMEOUT_MSG_START + 0x2C)
#define SIR_LIM_AUTH_RETRY_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x2D)
+#define SIR_LIM_AUTH_SAE_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x2E)
+
#define SIR_LIM_MSG_TYPES_END (SIR_LIM_MSG_TYPES_BEGIN+0xFF)
/* SCH message types */
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 2289f3602a..21fde2aaaa 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1660,6 +1660,7 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
case SIR_LIM_DEAUTH_ACK_TIMEOUT:
case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
case SIR_LIM_AUTH_RETRY_TIMEOUT:
+ case SIR_LIM_AUTH_SAE_TIMEOUT:
/* These timeout messages are handled by MLM sub module */
lim_process_mlm_req_messages(mac_ctx, msg);
break;
diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
index 43ade0ac27..71e452abbf 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
@@ -63,6 +63,48 @@ static void lim_process_periodic_join_probe_req_timer(tpAniSirGlobal);
static void lim_process_auth_retry_timer(tpAniSirGlobal);
/**
+ * lim_process_sae_auth_timeout() - This function is called to process sae
+ * auth timeout
+ * @mac_ctx: Pointer to Global MAC structure
+ *
+ * @Return: None
+ */
+static void lim_process_sae_auth_timeout(tpAniSirGlobal mac_ctx)
+{
+ tpPESession session;
+
+ session = pe_find_session_by_session_id(mac_ctx,
+ mac_ctx->lim.limTimers.sae_auth_timer.sessionId);
+ if (session == NULL) {
+ pe_err("Session does not exist for given session id");
+ return;
+ }
+
+ pe_warn("SAE auth timeout sessionid %d mlmstate %X SmeState %X",
+ session->peSessionId, session->limMlmState,
+ session->limSmeState);
+
+ switch (session->limMlmState) {
+ case eLIM_MLM_WT_SAE_AUTH_STATE:
+ /*
+ * SAE authentication is not completed. Restore from
+ * auth state.
+ */
+ if (session->pePersona == QDF_STA_MODE)
+ lim_restore_from_auth_state(mac_ctx,
+ eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
+ eSIR_MAC_UNSPEC_FAILURE_REASON, session);
+ break;
+ default:
+ /* SAE authentication is timed out in unexpected state */
+ pe_err("received unexpected SAE auth timeout in state %X",
+ session->limMlmState);
+ lim_print_mlm_state(mac_ctx, LOGE, session->limMlmState);
+ break;
+ }
+}
+
+/**
* lim_process_mlm_req_messages() - process mlm request messages
* @mac_ctx: global MAC context
* @msg: mlm request message
@@ -146,6 +188,9 @@ void lim_process_mlm_req_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
case SIR_LIM_AUTH_RETRY_TIMEOUT:
lim_process_auth_retry_timer(mac_ctx);
break;
+ case SIR_LIM_AUTH_SAE_TIMEOUT:
+ lim_process_sae_auth_timeout(mac_ctx);
+ break;
case LIM_MLM_TSPEC_REQ:
default:
break;
@@ -1071,6 +1116,17 @@ static QDF_STATUS lim_process_mlm_auth_req_sae(tpAniSirGlobal mac_ctx,
MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE, session->peSessionId,
session->limMlmState));
+ mac_ctx->lim.limTimers.sae_auth_timer.sessionId =
+ session->peSessionId;
+
+ /* Activate SAE auth timer */
+ MTRACE(mac_trace(mac_ctx, TRACE_CODE_TIMER_ACTIVATE,
+ session->peSessionId, eLIM_AUTH_SAE_TIMER));
+ if (tx_timer_activate(&mac_ctx->lim.limTimers.sae_auth_timer)
+ != TX_SUCCESS) {
+ pe_err("could not start Auth SAE timer");
+ }
+
return qdf_status;
}
#else
diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c
index aed0426de4..3f99f15b36 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.c
+++ b/core/mac/src/pe/lim/lim_timer_utils.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -54,6 +54,11 @@
/* Lim Periodic Auth Retry timer default 60 ms */
#define LIM_AUTH_RETRY_TIMER_MS 60
+/*
+ * SAE auth timer of 5secs. This is required for duration of entire SAE
+ * authentication.
+ */
+#define LIM_AUTH_SAE_TIMER_MS 5000
/* This timer is a periodic timer which expires at every 1 sec to
convert ACTIVE DFS channel to DFS channels */
@@ -193,6 +198,20 @@ static bool lim_create_non_ap_timers(tpAniSirGlobal pMac)
return false;
}
+ /*
+ * SAE auth timer of 5secs. This is required for duration of entire SAE
+ * authentication.
+ */
+ if ((tx_timer_create(pMac,
+ &pMac->lim.limTimers.sae_auth_timer,
+ "SAE AUTH Timer",
+ lim_timer_handler, SIR_LIM_AUTH_SAE_TIMEOUT,
+ SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS), 0,
+ TX_NO_ACTIVATE)) != TX_SUCCESS) {
+ pe_err("could not create SAE AUTH Timer");
+ return false;
+ }
+
return true;
}
/**
@@ -389,6 +408,7 @@ err_timer:
tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
+ tx_timer_delete(&pMac->lim.limTimers.sae_auth_timer);
if (NULL != pMac->lim.gLimPreAuthTimerTable.pTable) {
for (i = 0; i < pMac->lim.gLimPreAuthTimerTable.numEntry; i++)
@@ -959,6 +979,21 @@ void lim_deactivate_and_change_timer(tpAniSirGlobal pMac, uint32_t timerId)
}
break;
+ case eLIM_AUTH_SAE_TIMER:
+ if (tx_timer_deactivate
+ (&pMac->lim.limTimers.sae_auth_timer)
+ != TX_SUCCESS)
+ pe_err("Unable to deactivate SAE auth timer");
+
+ /* Change timer to reactivate it in future */
+ val = SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS);
+
+ if (tx_timer_change(&pMac->lim.limTimers.sae_auth_timer,
+ val, 0) != TX_SUCCESS)
+ pe_err("unable to change SAE auth timer");
+
+ break;
+
default:
/* Invalid timerId. Log error */
break;
diff --git a/core/mac/src/pe/lim/lim_timer_utils.h b/core/mac/src/pe/lim/lim_timer_utils.h
index c4fa197114..c03ff4b319 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.h
+++ b/core/mac/src/pe/lim/lim_timer_utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2014, 2016, 2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -68,7 +68,8 @@ enum {
eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER,
eLIM_INSERT_SINGLESHOT_NOA_TIMER,
eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE,
- eLIM_AUTH_RETRY_TIMER
+ eLIM_AUTH_RETRY_TIMER,
+ eLIM_AUTH_SAE_TIMER
};
#define LIM_DISASSOC_DEAUTH_ACK_TIMEOUT 500
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 0667404b31..8394ff2320 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -619,6 +619,8 @@ void lim_deactivate_timers(tpAniSirGlobal mac_ctx)
tx_timer_deactivate(&lim_timer->
gLimActiveToPassiveChannelTimer);
+
+ tx_timer_deactivate(&lim_timer->sae_auth_timer);
}
@@ -705,6 +707,8 @@ void lim_cleanup_mlm(tpAniSirGlobal mac_ctx)
tx_timer_delete(&lim_timer->
gLimActiveToPassiveChannelTimer);
+ tx_timer_delete(&lim_timer->sae_auth_timer);
+
mac_ctx->lim.gLimTimersCreated = 0;
}
} /*** end lim_cleanup_mlm() ***/
diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
index 9615005491..22440c3dcc 100644
--- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
+++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
@@ -782,6 +782,7 @@ uint8_t *mac_trace_get_lim_msg_string(uint16_t lim_msg)
CASE_RETURN_STRING(SIR_LIM_DEAUTH_ACK_TIMEOUT);
CASE_RETURN_STRING(SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT);
CASE_RETURN_STRING(SIR_LIM_AUTH_RETRY_TIMEOUT);
+ CASE_RETURN_STRING(SIR_LIM_AUTH_SAE_TIMEOUT);
CASE_RETURN_STRING(SIR_LIM_MSG_TYPES_END);
CASE_RETURN_STRING(LIM_MLM_SCAN_REQ);
CASE_RETURN_STRING(LIM_MLM_SCAN_CNF);