mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
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
This commit is contained in:
parent
b6ef113b4b
commit
4204eed710
3 changed files with 154 additions and 122 deletions
1
Kbuild
1
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
|
||||
|
||||
|
|
|
|||
153
core/mac/src/pe/lim/lim_roam_timer_utils.c
Normal file
153
core/mac/src/pe/lim/lim_roam_timer_utils.c
Normal file
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue