Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame^] | 2 | * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * This file lim_timer_utils.cc contains the utility functions |
| 30 | * LIM uses for handling various timers. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 02/13/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | */ |
| 37 | |
| 38 | #include "lim_types.h" |
| 39 | #include "lim_utils.h" |
| 40 | #include "lim_assoc_utils.h" |
| 41 | #include "lim_security_utils.h" |
Padma, Santhosh Kumar | 9509135 | 2016-08-16 15:23:31 +0530 | [diff] [blame] | 42 | #include <lim_api.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 43 | |
| 44 | /* channel Switch Timer in ticks */ |
| 45 | #define LIM_CHANNEL_SWITCH_TIMER_TICKS 1 |
| 46 | /* Lim Quite timer in ticks */ |
| 47 | #define LIM_QUIET_TIMER_TICKS 100 |
| 48 | /* Lim Quite BSS timer interval in ticks */ |
| 49 | #define LIM_QUIET_BSS_TIMER_TICK 100 |
| 50 | /* Lim KeepAlive timer default (3000)ms */ |
| 51 | #define LIM_KEEPALIVE_TIMER_MS 3000 |
| 52 | /* Lim JoinProbeRequest Retry timer default (200)ms */ |
| 53 | #define LIM_JOIN_PROBE_REQ_TIMER_MS 200 |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 54 | /* Lim Periodic Auth Retry timer default 60 ms */ |
| 55 | #define LIM_AUTH_RETRY_TIMER_MS 60 |
| 56 | |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame^] | 57 | /* |
| 58 | * SAE auth timer of 5secs. This is required for duration of entire SAE |
| 59 | * authentication. |
| 60 | */ |
| 61 | #define LIM_AUTH_SAE_TIMER_MS 5000 |
| 62 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | |
| 64 | /* This timer is a periodic timer which expires at every 1 sec to |
| 65 | convert ACTIVE DFS channel to DFS channels */ |
| 66 | #define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000 |
| 67 | |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 68 | static bool lim_create_non_ap_timers(tpAniSirGlobal pMac) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 69 | { |
| 70 | uint32_t cfgValue; |
| 71 | /* Create Channel Switch Timer */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 72 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimChannelSwitchTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 73 | "CHANNEL SWITCH TIMER", |
| 74 | lim_channel_switch_timer_handler, 0, |
| 75 | LIM_CHANNEL_SWITCH_TIMER_TICKS, |
| 76 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 77 | pe_err("failed to create Ch Switch timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 78 | return false; |
| 79 | } |
| 80 | /* Create Quiet Timer |
| 81 | * This is used on the STA to go and shut-off Tx/Rx "after" the |
| 82 | * specified quiteInterval |
| 83 | */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 84 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimQuietTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 85 | "QUIET TIMER", lim_quiet_timer_handler, |
| 86 | SIR_LIM_QUIET_TIMEOUT, LIM_QUIET_TIMER_TICKS, |
| 87 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 88 | pe_err("failed to create Quiet Begin Timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | return false; |
| 90 | } |
| 91 | /* Create Quiet BSS Timer |
| 92 | * After the specified quiteInterval, determined by gLimQuietTimer, this |
| 93 | * timer, gLimQuietBssTimer, trigger and put the STA to sleep for the |
| 94 | * specified gLimQuietDuration |
| 95 | */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 96 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimQuietBssTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 97 | "QUIET BSS TIMER", lim_quiet_bss_timer_handler, |
| 98 | SIR_LIM_QUIET_BSS_TIMEOUT, LIM_QUIET_BSS_TIMER_TICK, |
| 99 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 100 | pe_err("failed to create Quiet Bss Timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 101 | return false; |
| 102 | } |
| 103 | |
| 104 | if (wlan_cfg_get_int(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, |
| 105 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 106 | pe_err("could not retrieve JoinFailureTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 107 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 108 | /* Create Join failure timer and activate it later */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 109 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimJoinFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 110 | "JOIN FAILURE TIMEOUT", |
| 111 | lim_timer_handler, SIR_LIM_JOIN_FAIL_TIMEOUT, |
| 112 | cfgValue, 0, |
| 113 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
| 114 | /* / Could not create Join failure timer. */ |
| 115 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 116 | pe_err("could not create Join failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 117 | return false; |
| 118 | } |
| 119 | /* Send unicast probe req frame every 200 ms */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 120 | if (tx_timer_create(pMac, |
| 121 | &pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 122 | "Periodic Join Probe Request Timer", |
| 123 | lim_timer_handler, |
| 124 | SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT, |
| 125 | SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0, |
| 126 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 127 | pe_err("could not create Periodic Join Probe Request tmr"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 128 | return false; |
| 129 | } |
| 130 | |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 131 | /* Send Auth frame every 60 ms */ |
| 132 | if ((tx_timer_create(pMac, |
| 133 | &pMac->lim.limTimers.g_lim_periodic_auth_retry_timer, |
| 134 | "Periodic AUTH Timer", |
| 135 | lim_timer_handler, SIR_LIM_AUTH_RETRY_TIMEOUT, |
| 136 | SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0, |
| 137 | TX_NO_ACTIVATE)) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 138 | pe_err("could not create Periodic AUTH Timer"); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 139 | return false; |
| 140 | } |
| 141 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 142 | if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, |
| 143 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 144 | pe_err("could not retrieve AssocFailureTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 145 | |
| 146 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 147 | /* Create Association failure timer and activate it later */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 148 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimAssocFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 149 | "ASSOC FAILURE TIMEOUT", |
| 150 | lim_assoc_failure_timer_handler, LIM_ASSOC, |
| 151 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 152 | pe_err("could not create Association failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 153 | return false; |
| 154 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 155 | |
| 156 | if (wlan_cfg_get_int(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) |
| 157 | != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 158 | pe_err("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 159 | |
| 160 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 161 | |
| 162 | /* Create Addts response timer and activate it later */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 163 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimAddtsRspTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 164 | "ADDTS RSP TIMEOUT", |
| 165 | lim_addts_response_timer_handler, |
| 166 | SIR_LIM_ADDTS_RSP_TIMEOUT, |
| 167 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 168 | pe_err("could not create Addts response timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 169 | return false; |
| 170 | } |
| 171 | |
| 172 | if (wlan_cfg_get_int(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 173 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 174 | pe_err("could not retrieve AuthFailureTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 175 | |
| 176 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 177 | /* Create Auth failure timer and activate it later */ |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 178 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimAuthFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 179 | "AUTH FAILURE TIMEOUT", |
| 180 | lim_timer_handler, |
| 181 | SIR_LIM_AUTH_FAIL_TIMEOUT, |
| 182 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 183 | pe_err("could not create Auth failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | return false; |
| 185 | } |
| 186 | |
| 187 | if (wlan_cfg_get_int(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, |
| 188 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 189 | pe_err("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 190 | |
| 191 | /* Change timer to reactivate it in future */ |
| 192 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 193 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimProbeAfterHBTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 194 | "Probe after Heartbeat TIMEOUT", |
| 195 | lim_timer_handler, |
| 196 | SIR_LIM_PROBE_HB_FAILURE_TIMEOUT, |
| 197 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 198 | pe_err("unable to create ProbeAfterHBTimer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 199 | return false; |
| 200 | } |
| 201 | |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame^] | 202 | /* |
| 203 | * SAE auth timer of 5secs. This is required for duration of entire SAE |
| 204 | * authentication. |
| 205 | */ |
| 206 | if ((tx_timer_create(pMac, |
| 207 | &pMac->lim.limTimers.sae_auth_timer, |
| 208 | "SAE AUTH Timer", |
| 209 | lim_timer_handler, SIR_LIM_AUTH_SAE_TIMEOUT, |
| 210 | SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS), 0, |
| 211 | TX_NO_ACTIVATE)) != TX_SUCCESS) { |
| 212 | pe_err("could not create SAE AUTH Timer"); |
| 213 | return false; |
| 214 | } |
| 215 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 216 | return true; |
| 217 | } |
| 218 | /** |
| 219 | * lim_create_timers() |
| 220 | * |
| 221 | * @pMac : Pointer to Global MAC structure |
| 222 | * |
| 223 | * This function is called upon receiving |
| 224 | * 1. SME_START_REQ for STA in ESS role |
| 225 | * 2. SME_START_BSS_REQ for AP role & STA in IBSS role |
| 226 | * |
| 227 | * @return : status of operation |
| 228 | */ |
| 229 | |
| 230 | uint32_t lim_create_timers(tpAniSirGlobal pMac) |
| 231 | { |
| 232 | uint32_t cfgValue, i = 0; |
| 233 | uint32_t cfgValue1; |
| 234 | |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 235 | pe_debug("Creating Timers used by LIM module in Role: %d", |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 236 | pMac->lim.gLimSystemRole); |
| 237 | /* Create timers required for host roaming feature */ |
| 238 | if (TX_SUCCESS != lim_create_timers_host_roam(pMac)) |
| 239 | return TX_TIMER_ERROR; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 240 | |
| 241 | if (wlan_cfg_get_int(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME, |
| 242 | &cfgValue) != eSIR_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 243 | pe_err("could not retrieve MinChannelTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 244 | } |
| 245 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 246 | /* Periodic probe request timer value is half of the Min channel |
| 247 | * timer. Probe request sends periodically till min/max channel |
| 248 | * timer expires |
| 249 | */ |
| 250 | cfgValue1 = cfgValue / 2; |
| 251 | /* Create periodic probe request timer and activate them later */ |
| 252 | if (cfgValue1 >= 1 |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 253 | && (tx_timer_create(pMac, |
| 254 | &pMac->lim.limTimers.gLimPeriodicProbeReqTimer, |
| 255 | "Periodic Probe Request Timer", lim_timer_handler, |
| 256 | SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT, cfgValue1, 0, |
| 257 | TX_NO_ACTIVATE) != TX_SUCCESS)) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 258 | pe_err("could not create periodic probe timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 259 | goto err_timer; |
| 260 | } |
| 261 | |
| 262 | if (wlan_cfg_get_int(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME, |
| 263 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 264 | pe_err("could not retrieve MAXChannelTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 265 | |
| 266 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 267 | /* Limiting max numm of probe req for each channel scan */ |
| 268 | pMac->lim.maxProbe = (cfgValue / cfgValue1); |
| 269 | |
| 270 | if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE) |
| 271 | if (false == lim_create_non_ap_timers(pMac)) |
| 272 | goto err_timer; |
| 273 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 274 | /* Create all CNF_WAIT Timers upfront */ |
| 275 | if (wlan_cfg_get_int(pMac, WNI_CFG_WT_CNF_TIMEOUT, &cfgValue) |
| 276 | != eSIR_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 277 | pe_err("could not retrieve CNF timeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 281 | for (i = 0; i < (pMac->lim.maxStation + 1); i++) { |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 282 | if (tx_timer_create(pMac, |
| 283 | &pMac->lim.limTimers.gpLimCnfWaitTimer[i], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 284 | "CNF_MISS_TIMEOUT", |
| 285 | lim_cnf_wait_tmer_handler, |
| 286 | (uint32_t) i, cfgValue, |
| 287 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 288 | pe_err("Cannot create CNF wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 289 | goto err_timer; |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | /* Alloc and init table for the preAuth timer list */ |
| 294 | if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_NUM_PRE_AUTH, |
| 295 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 296 | pe_err("could not retrieve mac preauth value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 297 | pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue; |
| 298 | pMac->lim.gLimPreAuthTimerTable.pTable = |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 299 | qdf_mem_malloc(cfgValue * sizeof(tLimPreAuthNode *)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 300 | |
| 301 | if (pMac->lim.gLimPreAuthTimerTable.pTable == NULL) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 302 | pe_err("AllocateMemory failed!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 303 | goto err_timer; |
| 304 | } |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 305 | |
| 306 | for (i = 0; i < cfgValue; i++) { |
| 307 | pMac->lim.gLimPreAuthTimerTable.pTable[i] = |
| 308 | qdf_mem_malloc(sizeof(tLimPreAuthNode)); |
| 309 | if (pMac->lim.gLimPreAuthTimerTable.pTable[i] == NULL) { |
| 310 | pMac->lim.gLimPreAuthTimerTable.numEntry = 0; |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 311 | pe_err("AllocateMemory failed!"); |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 312 | goto err_timer; |
| 313 | } |
| 314 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 315 | |
| 316 | lim_init_pre_auth_timer_table(pMac, &pMac->lim.gLimPreAuthTimerTable); |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 317 | pe_debug("alloc and init table for preAuth timers"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 318 | |
| 319 | if (wlan_cfg_get_int(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT, |
| 320 | &cfgValue) != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 321 | pe_err("could not retrieve OLBD detect timeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 322 | |
| 323 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 324 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 325 | "OLBC UPDATE CACHE TIMEOUT", |
| 326 | lim_update_olbc_cache_timer_handler, |
| 327 | SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT, cfgValue, |
| 328 | cfgValue, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 329 | pe_err("Cannot create update OLBC cache tmr"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 330 | goto err_timer; |
| 331 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 332 | |
| 333 | cfgValue = 1000; |
| 334 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 335 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimDisassocAckTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | "DISASSOC ACK TIMEOUT", |
| 337 | lim_timer_handler, SIR_LIM_DISASSOC_ACK_TIMEOUT, |
| 338 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 339 | pe_err("could not DISASSOC ACK TIMEOUT timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 340 | goto err_timer; |
| 341 | } |
| 342 | |
| 343 | cfgValue = 1000; |
| 344 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 345 | if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimDeauthAckTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 346 | "DISASSOC ACK TIMEOUT", |
| 347 | lim_timer_handler, SIR_LIM_DEAUTH_ACK_TIMEOUT, |
| 348 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 349 | pe_err("could not create DEAUTH ACK TIMEOUT timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 350 | goto err_timer; |
| 351 | } |
| 352 | |
| 353 | /* (> no of BI* no of TUs per BI * 1TU in msec + |
| 354 | * p2p start time offset*1 TU in msec = 2*100*1.024 + 5*1.024 |
| 355 | * = 204.8 + 5.12 = 209.20) |
| 356 | */ |
| 357 | cfgValue = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE; |
| 358 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 359 | if (tx_timer_create(pMac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 360 | &pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer, |
| 361 | "Single Shot NOA Insert timeout", lim_timer_handler, |
| 362 | SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT, cfgValue, 0, |
| 363 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 364 | pe_err("Can't create Single Shot NOA Insert Timeout tmr"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 365 | goto err_timer; |
| 366 | } |
| 367 | |
| 368 | cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT; |
| 369 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Naveen Rawat | 22b1a93 | 2015-08-26 12:13:18 -0700 | [diff] [blame] | 370 | if (tx_timer_create(pMac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 371 | &pMac->lim.limTimers.gLimActiveToPassiveChannelTimer, |
| 372 | "ACTIVE TO PASSIVE CHANNEL", lim_timer_handler, |
| 373 | SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0, |
| 374 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 375 | pe_warn("could not create timer for passive channel to active channel"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 376 | goto err_timer; |
| 377 | } |
| 378 | |
| 379 | return TX_SUCCESS; |
| 380 | |
| 381 | err_timer: |
Abhishek Singh | 748d8a2 | 2017-08-21 15:19:37 +0530 | [diff] [blame] | 382 | lim_delete_timers_host_roam(pMac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 383 | tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer); |
| 384 | tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 385 | tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
| 386 | while (((int32_t)-- i) >= 0) { |
| 387 | tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]); |
| 388 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 389 | tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 390 | tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer); |
| 391 | tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 392 | tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer); |
| 393 | tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer); |
| 394 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 395 | tx_timer_delete(&pMac->lim.limTimers.g_lim_periodic_auth_retry_timer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 396 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer); |
| 397 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer); |
| 398 | tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer); |
| 399 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer); |
| 400 | tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer); |
| 401 | tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer); |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame^] | 402 | tx_timer_delete(&pMac->lim.limTimers.sae_auth_timer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 403 | |
| 404 | if (NULL != pMac->lim.gLimPreAuthTimerTable.pTable) { |
Naveen Rawat | 2546093 | 2016-02-05 16:56:08 -0800 | [diff] [blame] | 405 | for (i = 0; i < pMac->lim.gLimPreAuthTimerTable.numEntry; i++) |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 406 | qdf_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable[i]); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 407 | qdf_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | pMac->lim.gLimPreAuthTimerTable.pTable = NULL; |
| 409 | } |
| 410 | return TX_TIMER_ERROR; |
| 411 | } /****** end lim_create_timers() ******/ |
| 412 | |
| 413 | /** |
| 414 | * lim_timer_handler() |
| 415 | * |
| 416 | ***FUNCTION: |
| 417 | * This function is called upon |
| 418 | * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning |
| 419 | * 2. JOIN_FAILURE timer expiration while joining a BSS |
| 420 | * 3. AUTH_FAILURE timer expiration while authenticating with a peer |
| 421 | * 4. Heartbeat timer expiration on STA |
| 422 | * 5. Background scan timer expiration on STA |
| 423 | * 6. AID release, Pre-auth cleanup and Link monitoring timer |
| 424 | * expiration on AP |
| 425 | * |
| 426 | ***LOGIC: |
| 427 | * |
| 428 | ***ASSUMPTIONS: |
| 429 | * NA |
| 430 | * |
| 431 | ***NOTE: |
| 432 | * NA |
| 433 | * |
| 434 | * @param param - Message corresponding to the timer that expired |
| 435 | * |
| 436 | * @return None |
| 437 | */ |
| 438 | |
| 439 | void lim_timer_handler(void *pMacGlobal, uint32_t param) |
| 440 | { |
| 441 | uint32_t statusCode; |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 442 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 443 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 444 | |
| 445 | /* Prepare and post message to LIM Message Queue */ |
| 446 | |
| 447 | msg.type = (uint16_t) param; |
| 448 | msg.bodyptr = NULL; |
| 449 | msg.bodyval = 0; |
| 450 | |
Padma, Santhosh Kumar | 9509135 | 2016-08-16 15:23:31 +0530 | [diff] [blame] | 451 | statusCode = lim_post_msg_high_priority(pMac, &msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 452 | if (statusCode != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 453 | pe_err("posting message: %X to LIM failed, reason: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 454 | msg.type, statusCode); |
| 455 | } /****** end lim_timer_handler() ******/ |
| 456 | |
| 457 | /** |
| 458 | * lim_addts_response_timer_handler() |
| 459 | * |
| 460 | ***FUNCTION: |
| 461 | * This function is called upon Addts response timer expiration on sta |
| 462 | * |
| 463 | ***LOGIC: |
| 464 | * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 465 | * when this function is executed. |
| 466 | * |
| 467 | ***ASSUMPTIONS: |
| 468 | * NA |
| 469 | * |
| 470 | ***NOTE: |
| 471 | * NA |
| 472 | * |
| 473 | * @param param - pointer to pre-auth node |
| 474 | * |
| 475 | * @return None |
| 476 | */ |
| 477 | |
| 478 | void lim_addts_response_timer_handler(void *pMacGlobal, uint32_t param) |
| 479 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 480 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 481 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 482 | |
| 483 | /* Prepare and post message to LIM Message Queue */ |
| 484 | |
| 485 | msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT; |
| 486 | msg.bodyval = param; |
| 487 | msg.bodyptr = NULL; |
| 488 | |
| 489 | lim_post_msg_api(pMac, &msg); |
| 490 | } /****** end lim_auth_response_timer_handler() ******/ |
| 491 | |
| 492 | /** |
| 493 | * lim_auth_response_timer_handler() |
| 494 | * |
| 495 | ***FUNCTION: |
| 496 | * This function is called upon Auth response timer expiration on AP |
| 497 | * |
| 498 | ***LOGIC: |
| 499 | * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 500 | * when this function is executed. |
| 501 | * |
| 502 | ***ASSUMPTIONS: |
| 503 | * NA |
| 504 | * |
| 505 | ***NOTE: |
| 506 | * NA |
| 507 | * |
| 508 | * @param param - pointer to pre-auth node |
| 509 | * |
| 510 | * @return None |
| 511 | */ |
| 512 | |
| 513 | void lim_auth_response_timer_handler(void *pMacGlobal, uint32_t param) |
| 514 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 515 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 516 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 517 | |
| 518 | /* Prepare and post message to LIM Message Queue */ |
| 519 | |
| 520 | msg.type = SIR_LIM_AUTH_RSP_TIMEOUT; |
| 521 | msg.bodyptr = NULL; |
| 522 | msg.bodyval = (uint32_t) param; |
| 523 | |
| 524 | lim_post_msg_api(pMac, &msg); |
| 525 | } /****** end lim_auth_response_timer_handler() ******/ |
| 526 | |
| 527 | /** |
| 528 | * lim_assoc_failure_timer_handler() |
| 529 | * |
| 530 | * @mac_global : Pointer to Global MAC structure |
| 531 | * @param : Indicates whether this is assoc or reassoc failure timeout |
| 532 | * |
| 533 | * This function is called upon Re/Assoc failure timer expiration on STA. |
| 534 | * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ when this |
| 535 | * function is executed. |
| 536 | * |
| 537 | * Return void |
| 538 | */ |
| 539 | void lim_assoc_failure_timer_handler(void *mac_global, uint32_t param) |
| 540 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 541 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 542 | tpAniSirGlobal mac_ctx = (tpAniSirGlobal) mac_global; |
| 543 | tpPESession session = NULL; |
| 544 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 545 | session = mac_ctx->lim.pSessionEntry; |
| 546 | if (LIM_REASSOC == param && NULL != session |
| 547 | && session->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 548 | pe_err("Reassoc timeout happened"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 549 | if (mac_ctx->lim.reAssocRetryAttempt < |
| 550 | LIM_MAX_REASSOC_RETRY_LIMIT) { |
| 551 | lim_send_retry_reassoc_req_frame(mac_ctx, |
| 552 | session->pLimMlmReassocRetryReq, session); |
| 553 | mac_ctx->lim.reAssocRetryAttempt++; |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 554 | pe_warn("Reassoc request retry is sent %d times", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 555 | mac_ctx->lim.reAssocRetryAttempt); |
| 556 | return; |
| 557 | } else { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 558 | pe_warn("Reassoc request retry MAX: %d reached", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 559 | LIM_MAX_REASSOC_RETRY_LIMIT); |
| 560 | if (NULL != session->pLimMlmReassocRetryReq) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 561 | qdf_mem_free(session->pLimMlmReassocRetryReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 562 | session->pLimMlmReassocRetryReq = NULL; |
| 563 | } |
| 564 | } |
| 565 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 566 | /* Prepare and post message to LIM Message Queue */ |
| 567 | msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT; |
| 568 | msg.bodyval = (uint32_t) param; |
| 569 | msg.bodyptr = NULL; |
| 570 | lim_post_msg_api(mac_ctx, &msg); |
| 571 | } /****** end lim_assoc_failure_timer_handler() ******/ |
| 572 | |
| 573 | /** |
| 574 | * lim_update_olbc_cache_timer_handler() |
| 575 | * |
| 576 | ***FUNCTION: |
| 577 | * This function is called upon update olbc cache timer expiration |
| 578 | * on STA |
| 579 | * |
| 580 | ***LOGIC: |
| 581 | * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ |
| 582 | * when this function is executed. |
| 583 | * |
| 584 | ***ASSUMPTIONS: |
| 585 | * NA |
| 586 | * |
| 587 | ***NOTE: |
| 588 | * NA |
| 589 | * |
| 590 | * @param |
| 591 | * |
| 592 | * @return None |
| 593 | */ |
| 594 | void lim_update_olbc_cache_timer_handler(void *pMacGlobal, uint32_t param) |
| 595 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 596 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 598 | |
| 599 | /* Prepare and post message to LIM Message Queue */ |
| 600 | |
| 601 | msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT; |
| 602 | msg.bodyval = 0; |
| 603 | msg.bodyptr = NULL; |
| 604 | |
| 605 | lim_post_msg_api(pMac, &msg); |
| 606 | } /****** end lim_update_olbc_cache_timer_handler() ******/ |
| 607 | |
| 608 | /** |
| 609 | * lim_deactivate_and_change_timer() |
| 610 | * |
| 611 | ***FUNCTION: |
| 612 | * This function is called to deactivate and change a timer |
| 613 | * for future re-activation |
| 614 | * |
| 615 | ***LOGIC: |
| 616 | * |
| 617 | ***ASSUMPTIONS: |
| 618 | * NA |
| 619 | * |
| 620 | ***NOTE: |
| 621 | * NA |
| 622 | * |
| 623 | * @param pMac - Pointer to Global MAC structure |
| 624 | * @param timerId - enum of timer to be deactivated and changed |
| 625 | * This enum is defined in lim_utils.h file |
| 626 | * |
| 627 | * @return None |
| 628 | */ |
| 629 | |
| 630 | void lim_deactivate_and_change_timer(tpAniSirGlobal pMac, uint32_t timerId) |
| 631 | { |
| 632 | uint32_t val = 0; |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 633 | tpPESession session_entry; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 634 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 635 | switch (timerId) { |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 636 | case eLIM_REASSOC_FAIL_TIMER: |
| 637 | case eLIM_FT_PREAUTH_RSP_TIMER: |
| 638 | lim_deactivate_and_change_timer_host_roam(pMac, timerId); |
| 639 | break; |
| 640 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 641 | case eLIM_ADDTS_RSP_TIMER: |
| 642 | pMac->lim.gLimAddtsRspTimerCount++; |
| 643 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) |
| 644 | != TX_SUCCESS) { |
| 645 | /* Could not deactivate AddtsRsp Timer */ |
| 646 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 647 | pe_err("Unable to deactivate AddtsRsp timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 648 | } |
| 649 | break; |
| 650 | |
| 651 | case eLIM_PERIODIC_PROBE_REQ_TIMER: |
| 652 | if (tx_timer_deactivate |
| 653 | (&pMac->lim.limTimers.gLimPeriodicProbeReqTimer) |
| 654 | != TX_SUCCESS) { |
| 655 | /* Could not deactivate min channel timer. */ |
| 656 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 657 | pe_err("Unable to deactivate periodic timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 658 | } |
| 659 | |
| 660 | val = |
| 661 | SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime) / |
| 662 | 2; |
Anurag Chouhan | 1a73428 | 2016-09-03 16:23:00 +0530 | [diff] [blame] | 663 | if (val) { |
| 664 | if (tx_timer_change( |
| 665 | &pMac->lim.limTimers.gLimPeriodicProbeReqTimer, |
| 666 | val, 0) != TX_SUCCESS) { |
| 667 | /* Could not change min channel timer. */ |
| 668 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 669 | pe_err("Unable to change periodic timer"); |
Anurag Chouhan | 1a73428 | 2016-09-03 16:23:00 +0530 | [diff] [blame] | 670 | } |
| 671 | } else |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 672 | pe_err("Do not change gLimPeriodicProbeReqTimer values," |
| 673 | "value: %d minchannel time: %d" |
| 674 | "maxchannel time: %d", val, |
Anurag Chouhan | 1a73428 | 2016-09-03 16:23:00 +0530 | [diff] [blame] | 675 | pMac->lim.gpLimMlmScanReq->minChannelTime, |
| 676 | pMac->lim.gpLimMlmScanReq->maxChannelTime); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 677 | |
| 678 | break; |
| 679 | |
| 680 | case eLIM_JOIN_FAIL_TIMER: |
| 681 | if (tx_timer_deactivate |
| 682 | (&pMac->lim.limTimers.gLimJoinFailureTimer) |
| 683 | != TX_SUCCESS) { |
| 684 | /** |
| 685 | * Could not deactivate Join Failure |
| 686 | * timer. Log error. |
| 687 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 688 | pe_err("Unable to deactivate Join Failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 689 | } |
| 690 | |
| 691 | if (wlan_cfg_get_int(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, |
| 692 | &val) != eSIR_SUCCESS) { |
| 693 | /** |
| 694 | * Could not get JoinFailureTimeout value |
| 695 | * from CFG. Log error. |
| 696 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 697 | pe_err("could not retrieve JoinFailureTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 698 | } |
| 699 | val = SYS_MS_TO_TICKS(val); |
| 700 | |
| 701 | if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer, |
| 702 | val, 0) != TX_SUCCESS) { |
| 703 | /** |
| 704 | * Could not change Join Failure |
| 705 | * timer. Log error. |
| 706 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 707 | pe_err("Unable to change Join Failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | break; |
| 711 | |
| 712 | case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER: |
| 713 | if (tx_timer_deactivate |
| 714 | (&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer) |
| 715 | != TX_SUCCESS) { |
| 716 | /* Could not deactivate periodic join req Times. */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 717 | pe_err("Unable to deactivate periodic join request timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS); |
| 721 | if (tx_timer_change |
| 722 | (&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer, val, |
| 723 | 0) != TX_SUCCESS) { |
| 724 | /* Could not change periodic join req times. */ |
| 725 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 726 | pe_err("Unable to change periodic join request timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | break; |
| 730 | |
| 731 | case eLIM_AUTH_FAIL_TIMER: |
| 732 | if (tx_timer_deactivate |
| 733 | (&pMac->lim.limTimers.gLimAuthFailureTimer) |
| 734 | != TX_SUCCESS) { |
| 735 | /* Could not deactivate Auth failure timer. */ |
| 736 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 737 | pe_err("Unable to deactivate auth failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 738 | } |
| 739 | /* Change timer to reactivate it in future */ |
| 740 | if (wlan_cfg_get_int(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 741 | &val) != eSIR_SUCCESS) { |
| 742 | /** |
| 743 | * Could not get AuthFailureTimeout value |
| 744 | * from CFG. Log error. |
| 745 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 746 | pe_err("could not retrieve AuthFailureTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 747 | } |
| 748 | val = SYS_MS_TO_TICKS(val); |
| 749 | |
| 750 | if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer, |
| 751 | val, 0) != TX_SUCCESS) { |
| 752 | /* Could not change Authentication failure timer. */ |
| 753 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 754 | pe_err("unable to change Auth failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 755 | } |
| 756 | |
| 757 | break; |
| 758 | |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 759 | case eLIM_AUTH_RETRY_TIMER: |
| 760 | |
| 761 | if (tx_timer_deactivate |
| 762 | (&pMac->lim.limTimers.g_lim_periodic_auth_retry_timer) |
| 763 | != TX_SUCCESS) { |
| 764 | /* Could not deactivate Auth Retry Timer. */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 765 | pe_err("Unable to deactivate Auth Retry timer"); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 766 | } |
| 767 | session_entry = pe_find_session_by_session_id(pMac, |
| 768 | pMac->lim.limTimers. |
| 769 | g_lim_periodic_auth_retry_timer.sessionId); |
| 770 | if (NULL == session_entry) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 771 | pe_err("session does not exist for given SessionId : %d", |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 772 | pMac->lim.limTimers. |
| 773 | g_lim_periodic_auth_retry_timer.sessionId); |
| 774 | break; |
| 775 | } |
| 776 | /* 3/5 of the beacon interval */ |
| 777 | val = (session_entry->beaconParams.beaconInterval * 3) / 5; |
| 778 | val = SYS_MS_TO_TICKS(val); |
| 779 | if (tx_timer_change |
| 780 | (&pMac->lim.limTimers.g_lim_periodic_auth_retry_timer, |
| 781 | val, 0) != TX_SUCCESS) { |
| 782 | /* Could not change Auth Retry timer. */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 783 | pe_err("Unable to change Auth Retry timer"); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 784 | } |
| 785 | break; |
| 786 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 787 | case eLIM_ASSOC_FAIL_TIMER: |
| 788 | if (tx_timer_deactivate |
| 789 | (&pMac->lim.limTimers.gLimAssocFailureTimer) != |
| 790 | TX_SUCCESS) { |
| 791 | /* Could not deactivate Association failure timer. */ |
| 792 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 793 | pe_err("unable to deactivate Association failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 794 | } |
| 795 | /* Change timer to reactivate it in future */ |
| 796 | if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, |
| 797 | &val) != eSIR_SUCCESS) { |
| 798 | /** |
| 799 | * Could not get AssocFailureTimeout value |
| 800 | * from CFG. Log error. |
| 801 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 802 | pe_err("could not retrieve AssocFailureTimeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 803 | } |
| 804 | val = SYS_MS_TO_TICKS(val); |
| 805 | |
| 806 | if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer, |
| 807 | val, 0) != TX_SUCCESS) { |
| 808 | /* Could not change Association failure timer. */ |
| 809 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 810 | pe_err("unable to change Assoc failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 811 | } |
| 812 | |
| 813 | break; |
| 814 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 815 | case eLIM_PROBE_AFTER_HB_TIMER: |
| 816 | if (tx_timer_deactivate |
| 817 | (&pMac->lim.limTimers.gLimProbeAfterHBTimer) != |
| 818 | TX_SUCCESS) { |
| 819 | /* Could not deactivate Heartbeat timer. */ |
| 820 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 821 | pe_err("unable to deactivate probeAfterHBTimer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 822 | } else { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 823 | pe_debug("Deactivated probe after hb timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 824 | } |
| 825 | |
| 826 | if (wlan_cfg_get_int(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, |
| 827 | &val) != eSIR_SUCCESS) { |
| 828 | /** |
| 829 | * Could not get PROBE_AFTER_HB_FAILURE |
| 830 | * value from CFG. Log error. |
| 831 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 832 | pe_err("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 833 | } |
| 834 | /* Change timer to reactivate it in future */ |
| 835 | val = SYS_MS_TO_TICKS(val); |
| 836 | |
| 837 | if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer, |
| 838 | val, 0) != TX_SUCCESS) { |
| 839 | /* Could not change HeartBeat timer. */ |
| 840 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 841 | pe_err("unable to change ProbeAfterHBTimer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 842 | } else { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 843 | pe_debug("Probe after HB timer value is changed: %u", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 844 | val); |
| 845 | } |
| 846 | |
| 847 | break; |
| 848 | |
| 849 | case eLIM_LEARN_DURATION_TIMER: |
| 850 | break; |
| 851 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 852 | case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
| 853 | if (tx_timer_deactivate |
| 854 | (&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != |
| 855 | TX_SUCCESS) { |
| 856 | /** |
| 857 | ** Could not deactivate Active to passive channel timer. |
| 858 | ** Log error. |
| 859 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 860 | pe_err("Unable to Deactivate Active to passive channel timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 861 | return; |
| 862 | } |
| 863 | val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT; |
| 864 | val = SYS_MS_TO_TICKS(val); |
| 865 | if (tx_timer_change |
| 866 | (&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer, val, |
| 867 | 0) != TX_SUCCESS) { |
| 868 | /** |
| 869 | * Could not change timer to check scan type for passive channel. |
| 870 | * timer. Log error. |
| 871 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 872 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 873 | return; |
| 874 | } |
| 875 | break; |
| 876 | |
| 877 | case eLIM_DISASSOC_ACK_TIMER: |
| 878 | if (tx_timer_deactivate |
| 879 | (&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS) { |
| 880 | /** |
| 881 | ** Could not deactivate Join Failure |
| 882 | ** timer. Log error. |
| 883 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 884 | pe_err("Unable to deactivate Disassoc ack timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 885 | return; |
| 886 | } |
| 887 | val = 1000; |
| 888 | val = SYS_MS_TO_TICKS(val); |
| 889 | if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer, |
| 890 | val, 0) != TX_SUCCESS) { |
| 891 | /** |
| 892 | * Could not change Join Failure |
| 893 | * timer. Log error. |
| 894 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 895 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 896 | return; |
| 897 | } |
| 898 | break; |
| 899 | |
| 900 | case eLIM_DEAUTH_ACK_TIMER: |
| 901 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) |
| 902 | != TX_SUCCESS) { |
| 903 | /** |
| 904 | ** Could not deactivate Join Failure |
| 905 | ** timer. Log error. |
| 906 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 907 | pe_err("Unable to deactivate Deauth ack timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 908 | return; |
| 909 | } |
| 910 | val = 1000; |
| 911 | val = SYS_MS_TO_TICKS(val); |
| 912 | if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer, |
| 913 | val, 0) != TX_SUCCESS) { |
| 914 | /** |
| 915 | * Could not change Join Failure |
| 916 | * timer. Log error. |
| 917 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 918 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 919 | return; |
| 920 | } |
| 921 | break; |
| 922 | |
| 923 | case eLIM_INSERT_SINGLESHOT_NOA_TIMER: |
| 924 | if (tx_timer_deactivate |
| 925 | (&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != |
| 926 | TX_SUCCESS) { |
| 927 | /** |
| 928 | ** Could not deactivate SingleShot NOA Insert |
| 929 | ** timer. Log error. |
| 930 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 931 | pe_err("Unable to deactivate SingleShot NOA Insert timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 932 | return; |
| 933 | } |
| 934 | val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE; |
| 935 | val = SYS_MS_TO_TICKS(val); |
| 936 | if (tx_timer_change |
| 937 | (&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer, val, |
| 938 | 0) != TX_SUCCESS) { |
| 939 | /** |
| 940 | * Could not change Single Shot NOA Insert |
| 941 | * timer. Log error. |
| 942 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 943 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 944 | return; |
| 945 | } |
| 946 | break; |
| 947 | |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame^] | 948 | case eLIM_AUTH_SAE_TIMER: |
| 949 | if (tx_timer_deactivate |
| 950 | (&pMac->lim.limTimers.sae_auth_timer) |
| 951 | != TX_SUCCESS) |
| 952 | pe_err("Unable to deactivate SAE auth timer"); |
| 953 | |
| 954 | /* Change timer to reactivate it in future */ |
| 955 | val = SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS); |
| 956 | |
| 957 | if (tx_timer_change(&pMac->lim.limTimers.sae_auth_timer, |
| 958 | val, 0) != TX_SUCCESS) |
| 959 | pe_err("unable to change SAE auth timer"); |
| 960 | |
| 961 | break; |
| 962 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 963 | default: |
| 964 | /* Invalid timerId. Log error */ |
| 965 | break; |
| 966 | } |
| 967 | } /****** end lim_deactivate_and_change_timer() ******/ |
| 968 | |
| 969 | /** |
| 970 | * lim_deactivate_and_change_per_sta_id_timer() |
| 971 | * |
| 972 | * |
| 973 | * @brief: This function is called to deactivate and change a per STA timer |
| 974 | * for future re-activation |
| 975 | * |
| 976 | ***LOGIC: |
| 977 | * |
| 978 | ***ASSUMPTIONS: |
| 979 | * NA |
| 980 | * |
| 981 | * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index. |
| 982 | * |
| 983 | * @param pMac - Pointer to Global MAC structure |
| 984 | * @param timerId - enum of timer to be deactivated and changed |
| 985 | * This enum is defined in lim_utils.h file |
| 986 | * @param staId - staId |
| 987 | * |
| 988 | * @return None |
| 989 | */ |
| 990 | |
| 991 | void |
| 992 | lim_deactivate_and_change_per_sta_id_timer(tpAniSirGlobal pMac, uint32_t timerId, |
| 993 | uint16_t staId) |
| 994 | { |
| 995 | uint32_t val; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 996 | |
| 997 | switch (timerId) { |
| 998 | case eLIM_CNF_WAIT_TIMER: |
| 999 | |
| 1000 | if (tx_timer_deactivate |
| 1001 | (&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
| 1002 | != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1003 | pe_err("unable to deactivate CNF wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1004 | } |
| 1005 | /* Change timer to reactivate it in future */ |
| 1006 | |
| 1007 | if (wlan_cfg_get_int(pMac, WNI_CFG_WT_CNF_TIMEOUT, |
| 1008 | &val) != eSIR_SUCCESS) { |
| 1009 | /** |
| 1010 | * Could not get cnf timeout value |
| 1011 | * from CFG. Log error. |
| 1012 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1013 | pe_err("could not retrieve cnf timeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1014 | } |
| 1015 | val = SYS_MS_TO_TICKS(val); |
| 1016 | |
| 1017 | if (tx_timer_change |
| 1018 | (&pMac->lim.limTimers.gpLimCnfWaitTimer[staId], val, |
| 1019 | val) != TX_SUCCESS) { |
| 1020 | /* Could not change cnf timer. */ |
| 1021 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1022 | pe_err("unable to change cnf wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1023 | } |
| 1024 | |
| 1025 | break; |
| 1026 | |
| 1027 | case eLIM_AUTH_RSP_TIMER: |
| 1028 | { |
| 1029 | tLimPreAuthNode *pAuthNode; |
| 1030 | |
| 1031 | pAuthNode = |
| 1032 | lim_get_pre_auth_node_from_index(pMac, |
| 1033 | &pMac->lim. |
| 1034 | gLimPreAuthTimerTable, |
| 1035 | staId); |
| 1036 | |
| 1037 | if (pAuthNode == NULL) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1038 | pe_err("Invalid Pre Auth Index passed :%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1039 | staId); |
| 1040 | break; |
| 1041 | } |
| 1042 | |
| 1043 | if (tx_timer_deactivate(&pAuthNode->timer) != |
| 1044 | TX_SUCCESS) { |
| 1045 | /* Could not deactivate auth response timer. */ |
| 1046 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1047 | pe_err("unable to deactivate auth response timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1048 | } |
| 1049 | /* Change timer to reactivate it in future */ |
| 1050 | |
| 1051 | if (wlan_cfg_get_int |
| 1052 | (pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, |
| 1053 | &val) != eSIR_SUCCESS) { |
| 1054 | /** |
| 1055 | * Could not get auth rsp timeout value |
| 1056 | * from CFG. Log error. |
| 1057 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1058 | pe_err("could not retrieve auth response timeout value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1059 | } |
| 1060 | |
| 1061 | val = SYS_MS_TO_TICKS(val); |
| 1062 | |
| 1063 | if (tx_timer_change(&pAuthNode->timer, val, 0) != |
| 1064 | TX_SUCCESS) { |
| 1065 | /* Could not change auth rsp timer. */ |
| 1066 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1067 | pe_err("unable to change auth rsp timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1068 | } |
| 1069 | } |
| 1070 | break; |
| 1071 | |
| 1072 | default: |
| 1073 | /* Invalid timerId. Log error */ |
| 1074 | break; |
| 1075 | |
| 1076 | } |
| 1077 | } |
| 1078 | |
| 1079 | /** |
| 1080 | * lim_activate_cnf_timer() |
| 1081 | * |
| 1082 | ***FUNCTION: |
| 1083 | * This function is called to activate a per STA timer |
| 1084 | * |
| 1085 | ***LOGIC: |
| 1086 | * |
| 1087 | ***ASSUMPTIONS: |
| 1088 | * NA |
| 1089 | * |
| 1090 | ***NOTE: |
| 1091 | * NA |
| 1092 | * |
| 1093 | * @param pMac - Pointer to Global MAC structure |
| 1094 | * @param StaId - staId |
| 1095 | * |
| 1096 | * @return None |
| 1097 | */ |
| 1098 | |
| 1099 | void lim_activate_cnf_timer(tpAniSirGlobal pMac, uint16_t staId, |
| 1100 | tpPESession psessionEntry) |
| 1101 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1102 | pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = |
| 1103 | psessionEntry->peSessionId; |
| 1104 | if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
| 1105 | != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1106 | pe_err("could not activate cnf wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1107 | } |
| 1108 | } |
| 1109 | |
| 1110 | /** |
| 1111 | * lim_activate_auth_rsp_timer() |
| 1112 | * |
| 1113 | ***FUNCTION: |
| 1114 | * This function is called to activate a per STA timer |
| 1115 | * |
| 1116 | ***LOGIC: |
| 1117 | * |
| 1118 | ***ASSUMPTIONS: |
| 1119 | * NA |
| 1120 | * |
| 1121 | ***NOTE: |
| 1122 | * NA |
| 1123 | * |
| 1124 | * @param pMac - Pointer to Global MAC structure |
| 1125 | * @param id - id |
| 1126 | * |
| 1127 | * @return None |
| 1128 | */ |
| 1129 | |
| 1130 | void lim_activate_auth_rsp_timer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode) |
| 1131 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1132 | if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS) { |
| 1133 | /* / Could not activate auth rsp timer. */ |
| 1134 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1135 | pe_err("could not activate auth rsp timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1136 | } |
| 1137 | } |
| 1138 | |
| 1139 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1140 | * limAssocCnfWaitTmerHandler() |
| 1141 | * |
| 1142 | ***FUNCTION: |
| 1143 | * This function post a message to send a disassociate frame out. |
| 1144 | * |
| 1145 | ***LOGIC: |
| 1146 | * |
| 1147 | ***ASSUMPTIONS: |
| 1148 | * |
| 1149 | ***NOTE: |
| 1150 | * NA |
| 1151 | * |
| 1152 | * @param |
| 1153 | * |
| 1154 | * @return None |
| 1155 | */ |
| 1156 | |
| 1157 | void lim_cnf_wait_tmer_handler(void *pMacGlobal, uint32_t param) |
| 1158 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 1159 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1160 | uint32_t statusCode; |
| 1161 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 1162 | |
| 1163 | msg.type = SIR_LIM_CNF_WAIT_TIMEOUT; |
| 1164 | msg.bodyval = (uint32_t) param; |
| 1165 | msg.bodyptr = NULL; |
| 1166 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1167 | statusCode = lim_post_msg_api(pMac, &msg); |
| 1168 | if (statusCode != eSIR_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1169 | pe_err("posting to LIM failed, reason: %d", statusCode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1170 | |
| 1171 | } |
| 1172 | |
| 1173 | void lim_channel_switch_timer_handler(void *pMacGlobal, uint32_t param) |
| 1174 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 1175 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1176 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 1177 | |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1178 | pe_debug("ChannelSwitch Timer expired. Posting msg to LIM"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1179 | |
| 1180 | msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT; |
| 1181 | msg.bodyval = (uint32_t) param; |
| 1182 | msg.bodyptr = NULL; |
| 1183 | |
| 1184 | lim_post_msg_api(pMac, &msg); |
| 1185 | } |
| 1186 | |
| 1187 | void lim_quiet_timer_handler(void *pMacGlobal, uint32_t param) |
| 1188 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 1189 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1190 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 1191 | |
| 1192 | msg.type = SIR_LIM_QUIET_TIMEOUT; |
| 1193 | msg.bodyval = (uint32_t) param; |
| 1194 | msg.bodyptr = NULL; |
| 1195 | |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1196 | pe_debug("Post SIR_LIM_QUIET_TIMEOUT msg"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1197 | lim_post_msg_api(pMac, &msg); |
| 1198 | } |
| 1199 | |
| 1200 | void lim_quiet_bss_timer_handler(void *pMacGlobal, uint32_t param) |
| 1201 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 1202 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1203 | tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; |
| 1204 | |
| 1205 | msg.type = SIR_LIM_QUIET_BSS_TIMEOUT; |
| 1206 | msg.bodyval = (uint32_t) param; |
| 1207 | msg.bodyptr = NULL; |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 1208 | pe_debug("Post SIR_LIM_QUIET_BSS_TIMEOUT msg"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1209 | lim_post_msg_api(pMac, &msg); |
| 1210 | } |
| 1211 | |