summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Reddy Yeturu <varunreddy.yeturu@codeaurora.org>2016-02-16 10:02:01 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-17 18:09:59 -0700
commit4204eed710f9cf44a66507573c2becbb904ad2c1 (patch)
tree3c8bb1b0d3667c85ab6fa535597daa308929ba1e
parentb6ef113b4b06ceb8aa7d467adbe1f7d60cff7b2c (diff)
qcacld-3.0: Isolate roaming timers into a separate file
Move all the roaming related timers into a separate file for easy maintenance and management across different projects CRs-Fixed: 978905 Change-Id: I3bdbf13d9f962af36d74837bf50be7c9a93e824e
-rwxr-xr-xKbuild1
-rw-r--r--core/mac/src/pe/lim/lim_roam_timer_utils.c153
-rw-r--r--core/mac/src/pe/lim/lim_timer_utils.c122
3 files changed, 154 insertions, 122 deletions
diff --git a/Kbuild b/Kbuild
index 14375b1c087f..8d91605cde10 100755
--- a/Kbuild
+++ b/Kbuild
@@ -436,6 +436,7 @@ MAC_LIM_OBJS := $(MAC_SRC_DIR)/pe/lim/lim_aid_mgmt.o \
$(MAC_SRC_DIR)/pe/lim/lim_sme_req_utils.o \
$(MAC_SRC_DIR)/pe/lim/lim_sta_hash_api.o \
$(MAC_SRC_DIR)/pe/lim/lim_timer_utils.o \
+ $(MAC_SRC_DIR)/pe/lim/lim_roam_timer_utils.o \
$(MAC_SRC_DIR)/pe/lim/lim_trace.o \
$(MAC_SRC_DIR)/pe/lim/lim_utils.o
diff --git a/core/mac/src/pe/lim/lim_roam_timer_utils.c b/core/mac/src/pe/lim/lim_roam_timer_utils.c
new file mode 100644
index 000000000000..32383b5f89f8
--- /dev/null
+++ b/core/mac/src/pe/lim/lim_roam_timer_utils.c
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: lim_roam_timer_utils.c
+ *
+ * Host based roaming timers implementation
+ */
+
+#include "lim_types.h"
+#include "lim_utils.h"
+#include "lim_assoc_utils.h"
+#include "lim_security_utils.h"
+
+/**
+ * lim_create_timers_host_roam() - Create timers used in host based roaming
+ * @mac_ctx: Global MAC context
+ *
+ * Create reassoc and preauth timers
+ *
+ * Return: TX_SUCCESS or TX_TIMER_ERROR
+ */
+uint32_t lim_create_timers_host_roam(tpAniSirGlobal mac_ctx)
+{
+ uint32_t cfg_value;
+ if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
+ &cfg_value) != eSIR_SUCCESS)
+ lim_log(mac_ctx, LOGP,
+ FL("could not retrieve ReassocFailureTimeout value"));
+
+ cfg_value = SYS_MS_TO_TICKS(cfg_value);
+ /* Create Association failure timer and activate it later */
+ if (tx_timer_create(mac_ctx,
+ &mac_ctx->lim.limTimers.gLimReassocFailureTimer,
+ "REASSOC FAILURE TIMEOUT", lim_assoc_failure_timer_handler,
+ LIM_REASSOC, cfg_value, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
+ lim_log(mac_ctx, LOGP, FL("failed to create Reassoc timer"));
+ return TX_TIMER_ERROR;
+ }
+ cfg_value = 1000;
+ cfg_value = SYS_MS_TO_TICKS(cfg_value);
+ if (tx_timer_create(mac_ctx,
+ &mac_ctx->lim.limTimers.gLimFTPreAuthRspTimer,
+ "FT PREAUTH RSP TIMEOUT",
+ lim_timer_handler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
+ cfg_value, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
+ lim_log(mac_ctx, LOGP, FL("failed to create Join fail timer"));
+ goto err_roam_timer;
+ }
+ return TX_SUCCESS;
+
+err_roam_timer:
+ tx_timer_delete(&mac_ctx->lim.limTimers.gLimReassocFailureTimer);
+ return TX_TIMER_ERROR;
+}
+
+/**
+ * lim_delete_timers_host_roam() - Delete timers used in host based roaming
+ * @mac_ctx: Global MAC context
+ *
+ * Delete reassoc and preauth timers
+ *
+ * Return: none
+ */
+void lim_delete_timers_host_roam(tpAniSirGlobal mac_ctx)
+{
+ tLimTimers *lim_timer = &mac_ctx->lim.limTimers;
+
+ /* Deactivate and delete Reassociation failure timer. */
+ tx_timer_deactivate(&lim_timer->gLimReassocFailureTimer);
+ tx_timer_delete(&lim_timer->gLimReassocFailureTimer);
+
+ /* Deactivate and delete FT Preauth response timer */
+ tx_timer_deactivate(&lim_timer->gLimFTPreAuthRspTimer);
+ tx_timer_delete(&lim_timer->gLimFTPreAuthRspTimer);
+}
+
+/**
+ * lim_deactivate_and_change_timer_host_roam() - Change timers in host roaming
+ * @mac_ctx: Pointer to Global MAC structure
+ * @timer_id: enum of timer to be deactivated and changed
+ *
+ * This function is called to deactivate and change a timer for future
+ * re-activation for host roaming timers.
+ *
+ * Return: None
+ */
+void lim_deactivate_and_change_timer_host_roam(tpAniSirGlobal mac_ctx,
+ uint32_t timer_id)
+{
+ uint32_t val = 0;
+
+ switch (timer_id) {
+ case eLIM_REASSOC_FAIL_TIMER:
+ if (tx_timer_deactivate
+ (&mac_ctx->lim.limTimers.gLimReassocFailureTimer) !=
+ TX_SUCCESS) {
+ lim_log(mac_ctx, LOGP,
+ FL("unable to deactivate Reassoc fail timer"));
+ }
+ if (wlan_cfg_get_int(mac_ctx,
+ WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
+ &val) != eSIR_SUCCESS) {
+ lim_log(mac_ctx, LOGP,
+ FL("could not get ReassocFailureTimeout val"));
+ }
+ val = SYS_MS_TO_TICKS(val);
+ if (tx_timer_change
+ (&mac_ctx->lim.limTimers.gLimReassocFailureTimer, val,
+ 0) != TX_SUCCESS) {
+ lim_log(mac_ctx, LOGP,
+ FL("unable to change Reassoc fail timer"));
+ }
+ break;
+
+ case eLIM_FT_PREAUTH_RSP_TIMER:
+ if (tx_timer_deactivate
+ (&mac_ctx->lim.limTimers.gLimFTPreAuthRspTimer) !=
+ TX_SUCCESS) {
+ lim_log(mac_ctx, LOGP,
+ FL("Unable to deactivate Preauth Fail timer"));
+ return;
+ }
+ val = 1000;
+ val = SYS_MS_TO_TICKS(val);
+ if (tx_timer_change(
+ &mac_ctx->lim.limTimers.gLimFTPreAuthRspTimer,
+ val, 0) != TX_SUCCESS) {
+ lim_log(mac_ctx, LOGP,
+ FL("Unable to change Join Failure timer"));
+ return;
+ }
+ break;
+ }
+}
+
diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c
index b79b8ca1aef7..31be129d8581 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.c
+++ b/core/mac/src/pe/lim/lim_timer_utils.c
@@ -58,128 +58,6 @@
convert ACTIVE DFS channel to DFS channels */
#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
-/**
- * lim_create_timers_host_roam() - Create timers used in host based roaming
- * @mac_ctx: Global MAC context
- *
- * Create reassoc and preauth timers
- *
- * Return: TX_SUCCESS or TX_TIMER_ERROR
- */
-uint32_t lim_create_timers_host_roam(tpAniSirGlobal mac_ctx)
-{
- uint32_t cfg_value;
- if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
- &cfg_value) != eSIR_SUCCESS)
- lim_log(mac_ctx, LOGP,
- FL("could not retrieve ReassocFailureTimeout value"));
-
- cfg_value = SYS_MS_TO_TICKS(cfg_value);
- /* Create Association failure timer and activate it later */
- if (tx_timer_create(mac_ctx,
- &mac_ctx->lim.limTimers.gLimReassocFailureTimer,
- "REASSOC FAILURE TIMEOUT", lim_assoc_failure_timer_handler,
- LIM_REASSOC, cfg_value, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
- lim_log(mac_ctx, LOGP, FL("failed to create Reassoc timer"));
- return TX_TIMER_ERROR;
- }
- cfg_value = 1000;
- cfg_value = SYS_MS_TO_TICKS(cfg_value);
- if (tx_timer_create(mac_ctx,
- &mac_ctx->lim.limTimers.gLimFTPreAuthRspTimer,
- "FT PREAUTH RSP TIMEOUT",
- lim_timer_handler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
- cfg_value, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
- lim_log(mac_ctx, LOGP, FL("failed to create Join fail timer"));
- goto err_roam_timer;
- }
- return TX_SUCCESS;
-
-err_roam_timer:
- tx_timer_delete(&mac_ctx->lim.limTimers.gLimReassocFailureTimer);
- return TX_TIMER_ERROR;
-}
-
-/**
- * lim_delete_timers_host_roam() - Delete timers used in host based roaming
- * @mac_ctx: Global MAC context
- *
- * Delete reassoc and preauth timers
- *
- * Return: none
- */
-void lim_delete_timers_host_roam(tpAniSirGlobal mac_ctx)
-{
- tLimTimers *lim_timer = &mac_ctx->lim.limTimers;
-
- /* Deactivate and delete Reassociation failure timer. */
- tx_timer_deactivate(&lim_timer->gLimReassocFailureTimer);
- tx_timer_delete(&lim_timer->gLimReassocFailureTimer);
-
- /* Deactivate and delete FT Preauth response timer */
- tx_timer_deactivate(&lim_timer->gLimFTPreAuthRspTimer);
- tx_timer_delete(&lim_timer->gLimFTPreAuthRspTimer);
-}
-
-/**
- * lim_deactivate_and_change_timer_host_roam() - Change timers in host roaming
- * @mac_ctx: Pointer to Global MAC structure
- * @timer_id: enum of timer to be deactivated and changed
- *
- * This function is called to deactivate and change a timer for future
- * re-activation for host roaming timers.
- *
- * Return: None
- */
-void lim_deactivate_and_change_timer_host_roam(tpAniSirGlobal mac_ctx,
- uint32_t timer_id)
-{
- uint32_t val = 0;
-
- switch (timer_id) {
- case eLIM_REASSOC_FAIL_TIMER:
- if (tx_timer_deactivate
- (&mac_ctx->lim.limTimers.gLimReassocFailureTimer) !=
- TX_SUCCESS) {
- lim_log(mac_ctx, LOGP,
- FL("unable to deactivate Reassoc fail timer"));
- }
- if (wlan_cfg_get_int(mac_ctx,
- WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
- &val) != eSIR_SUCCESS) {
- lim_log(mac_ctx, LOGP,
- FL("could not get ReassocFailureTimeout val"));
- }
- val = SYS_MS_TO_TICKS(val);
- if (tx_timer_change
- (&mac_ctx->lim.limTimers.gLimReassocFailureTimer, val,
- 0) != TX_SUCCESS) {
- lim_log(mac_ctx, LOGP,
- FL("unable to change Reassoc fail timer"));
- }
- break;
-
- case eLIM_FT_PREAUTH_RSP_TIMER:
- if (tx_timer_deactivate
- (&mac_ctx->lim.limTimers.gLimFTPreAuthRspTimer) !=
- TX_SUCCESS) {
- lim_log(mac_ctx, LOGP,
- FL("Unable to deactivate Preauth Fail timer"));
- return;
- }
- val = 1000;
- val = SYS_MS_TO_TICKS(val);
- if (tx_timer_change(
- &mac_ctx->lim.limTimers.gLimFTPreAuthRspTimer,
- val, 0) != TX_SUCCESS) {
- lim_log(mac_ctx, LOGP,
- FL("Unable to change Join Failure timer"));
- return;
- }
- break;
- }
-}
-
static bool lim_create_non_ap_timers(tpAniSirGlobal pMac)
{
uint32_t cfgValue;