blob: 7daa0571823090c450140cc6493a149da717f556 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +05302 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
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.
Jeff Johnson295189b2012-06-20 16:38:30 -070020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
Jeff Johnson295189b2012-06-20 16:38:30 -070022/*
Kiet Lam842dad02014-02-18 18:44:02 -080023 * 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/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 * This file limTimerUtils.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 "limTypes.h"
39#include "limUtils.h"
40#include "limAssocUtils.h"
41#include "limSecurityUtils.h"
42#include "pmmApi.h"
Padma, Santhosh Kumarb036fc72015-11-13 16:22:23 +053043#include "limApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070044
45// default value 5000 ms for background scan period when it is disabled
46#define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000
47// channel Switch Timer in ticks
48#define LIM_CHANNEL_SWITCH_TIMER_TICKS 1
49// Lim Quite timer in ticks
50#define LIM_QUIET_TIMER_TICKS 100
Jeff Johnsonfeddb2d2012-12-10 14:41:22 -080051// Lim Quite BSS timer interval in ticks
Jeff Johnson295189b2012-06-20 16:38:30 -070052#define LIM_QUIET_BSS_TIMER_TICK 100
53// Lim KeepAlive timer default (3000)ms
54#define LIM_KEEPALIVE_TIMER_MS 3000
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -080055// Lim JoinProbeRequest Retry timer default (200)ms
56#define LIM_JOIN_PROBE_REQ_TIMER_MS 200
Sushant Kaushik9e923872015-04-02 17:09:31 +053057#define LIM_AUTH_RETRY_TIMER_MS 60
58
Jeff Johnson295189b2012-06-20 16:38:30 -070059
60//default beacon interval value used in HB timer interval calculation
61#define LIM_HB_TIMER_BEACON_INTERVAL 100
Gopichand Nakkalad492d202013-05-10 02:50:47 +053062
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053063/* This timer is a periodic timer which expires at every 1 sec to
Gopichand Nakkalad492d202013-05-10 02:50:47 +053064 convert ACTIVE DFS channel to DFS channels */
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053065#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
Gopichand Nakkalad492d202013-05-10 02:50:47 +053066
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +053067#ifdef WLAN_FEATURE_LFR_MBB
68#define PREAUTH_REASSOC_TIMEOUT 500
69#endif
70
Jeff Johnson295189b2012-06-20 16:38:30 -070071/**
72 * limCreateTimers()
73 *
74 *FUNCTION:
75 * This function is called upon receiving
76 * 1. SME_START_REQ for STA in ESS role
77 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
78 *
79 *LOGIC:
80 *
81 *ASSUMPTIONS:
82 * NA
83 *
84 *NOTE:
85 * NA
86 *
87 * @param pMac - Pointer to Global MAC structure
88 *
89 * @return None
90 */
91
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070092v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070093limCreateTimers(tpAniSirGlobal pMac)
94{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070095 tANI_U32 cfgValue, i=0;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -080096 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -070097
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070098 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -070099
100 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
101 &cfgValue) != eSIR_SUCCESS)
102 {
103 /**
104 * Could not get MinChannelTimeout value
105 * from CFG. Log error.
106 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700107 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700108 }
109 cfgValue = SYS_MS_TO_TICKS(cfgValue);
110
111 // Create MIN/MAX channel timers and activate them later
112 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
113 "MIN CHANNEL TIMEOUT",
114 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
115 cfgValue, 0,
116 TX_NO_ACTIVATE) != TX_SUCCESS)
117 {
118 /// Could not start min channel timer.
119 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700120 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700121 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700122 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700123 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700124
125 /* Periodic probe request timer value is half of the Min channel
126 * timer. Probe request sends periodically till min/max channel
127 * timer expires
128 */
129
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800130 cfgValue1 = cfgValue/2 ;
131 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 {
133 // Create periodic probe request timer and activate them later
134 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
135 "Periodic Probe Request Timer",
136 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800137 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700138 TX_NO_ACTIVATE) != TX_SUCCESS)
139 {
140 /// Could not start Periodic Probe Req timer.
141 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700142 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700143 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700144 }
145 }
146
147
148 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
149 &cfgValue) != eSIR_SUCCESS)
150 {
151 /**
152 * Could not get MAXChannelTimeout value
153 * from CFG. Log error.
154 */
155 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700156 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700157 }
158 cfgValue = SYS_MS_TO_TICKS(cfgValue);
159
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800160 /* Limiting max numm of probe req for each channel scan */
161 pMac->lim.maxProbe = (cfgValue/cfgValue1);
162
Jeff Johnson295189b2012-06-20 16:38:30 -0700163 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
164 "MAX CHANNEL TIMEOUT",
165 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
166 cfgValue, 0,
167 TX_NO_ACTIVATE) != TX_SUCCESS)
168 {
169 /// Could not start max channel timer.
170 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700171 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700172
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700173 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700174 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700175 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700176
177 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
178 {
179 // Create Channel Switch Timer
180 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
181 "CHANNEL SWITCH TIMER",
182 limChannelSwitchTimerHandler,
183 0, // expiration_input
184 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
185 0, // reschedule_ticks
186 TX_NO_ACTIVATE) != TX_SUCCESS)
187 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700188 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700189 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700190 }
191
192 //
193 // Create Quiet Timer
194 // This is used on the STA to go and shut-off
195 // Tx/Rx "after" the specified quiteInterval
196 //
197 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
198 "QUIET TIMER",
199 limQuietTimerHandler,
200 SIR_LIM_QUIET_TIMEOUT, // expiration_input
201 LIM_QUIET_TIMER_TICKS, // initial_ticks
202 0, // reschedule_ticks
203 TX_NO_ACTIVATE) != TX_SUCCESS)
204 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700205 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700206 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700207 }
208
209 //
210 // Create Quiet BSS Timer
211 // After the specified quiteInterval, determined by
212 // gLimQuietTimer, this timer, gLimQuietBssTimer,
213 // trigger and put the STA to sleep for the specified
214 // gLimQuietDuration
215 //
216 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
217 "QUIET BSS TIMER",
218 limQuietBssTimerHandler,
219 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
220 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
221 0, // reschedule_ticks
222 TX_NO_ACTIVATE) != TX_SUCCESS)
223 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700224 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700225 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700226 }
227
228 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
229 &cfgValue) != eSIR_SUCCESS)
230 {
231 /**
232 * Could not get JoinFailureTimeout value
233 * from CFG. Log error.
234 */
235 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700236 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700237 }
238 cfgValue = SYS_MS_TO_TICKS(cfgValue);
239
240 // Create Join failure timer and activate it later
241 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
242 "JOIN FAILURE TIMEOUT",
243 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
244 cfgValue, 0,
245 TX_NO_ACTIVATE) != TX_SUCCESS)
246 {
247 /// Could not create Join failure timer.
248 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700249 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700250
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700251 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700252 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800253
Jeff Johnson62c27982013-02-27 17:53:55 -0800254 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800255 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
256 "Periodic Join Probe Request Timer",
257 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
258 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
259 TX_NO_ACTIVATE)) != TX_SUCCESS)
260 {
261 /// Could not create Periodic Join Probe Request timer.
262 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700263 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800264 goto err_timer;
265 }
Sushant Kaushik9e923872015-04-02 17:09:31 +0530266 //Send Auth frame every 60 ms
267 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
268 "Periodic AUTH Timer",
269 limTimerHandler, SIR_LIM_AUTH_RETRY_TIMEOUT,
270 SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0,
271 TX_NO_ACTIVATE)) != TX_SUCCESS)
272 {
273 /// Could not create Periodic Join Probe Request timer.
274 // Log error
275 limLog(pMac, LOGP, FL("could not create Periodic AUTH Timer timer"));
276 goto err_timer;
277 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700278 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
279 &cfgValue) != eSIR_SUCCESS)
280 {
281 /**
282 * Could not get AssocFailureTimeout value
283 * from CFG. Log error.
284 */
285 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700286 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700287 }
288 cfgValue = SYS_MS_TO_TICKS(cfgValue);
289
290 // Create Association failure timer and activate it later
291 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
292 "ASSOC FAILURE TIMEOUT",
293 limAssocFailureTimerHandler, LIM_ASSOC,
294 cfgValue, 0,
295 TX_NO_ACTIVATE) != TX_SUCCESS)
296 {
297 /// Could not create Assoc failure timer.
298 // Log error
299 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700300 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700301
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700302 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700303 }
304 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
305 &cfgValue) != eSIR_SUCCESS)
306 {
307 /**
308 * Could not get ReassocFailureTimeout value
309 * from CFG. Log error.
310 */
311 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700312 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700313 }
314 cfgValue = SYS_MS_TO_TICKS(cfgValue);
315
316 // Create Association failure timer and activate it later
317 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
318 "REASSOC FAILURE TIMEOUT",
319 limAssocFailureTimerHandler, LIM_REASSOC,
320 cfgValue, 0,
321 TX_NO_ACTIVATE) != TX_SUCCESS)
322 {
323 /// Could not create Reassoc failure timer.
324 // Log error
325 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700326 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700327
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700328 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700329 }
330
331 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700332 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700333
334 cfgValue = SYS_MS_TO_TICKS(cfgValue);
335
336 // Create Addts response timer and activate it later
337 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
338 "ADDTS RSP TIMEOUT",
339 limAddtsResponseTimerHandler,
340 SIR_LIM_ADDTS_RSP_TIMEOUT,
341 cfgValue, 0,
342 TX_NO_ACTIVATE) != TX_SUCCESS)
343 {
344 /// Could not create Auth failure timer.
345 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700346 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700347
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700348 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700349 }
350
351 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
352 &cfgValue) != eSIR_SUCCESS)
353 {
354 /**
355 * Could not get AuthFailureTimeout value
356 * from CFG. Log error.
357 */
358 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700359 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700360 }
361 cfgValue = SYS_MS_TO_TICKS(cfgValue);
362
363 // Create Auth failure timer and activate it later
364 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
365 "AUTH FAILURE TIMEOUT",
366 limTimerHandler,
367 SIR_LIM_AUTH_FAIL_TIMEOUT,
368 cfgValue, 0,
369 TX_NO_ACTIVATE) != TX_SUCCESS)
370 {
371 /// Could not create Auth failure timer.
372 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700373 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700374
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700375 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700376 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800377
Jeff Johnson295189b2012-06-20 16:38:30 -0700378 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
379 &cfgValue) != eSIR_SUCCESS)
380 {
381 /**
382 * Could not get BEACON_INTERVAL value
383 * from CFG. Log error.
384 */
385 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700386 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700387 }
388 cfgValue = SYS_MS_TO_TICKS(cfgValue);
389
390 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
391 "Heartbeat TIMEOUT",
392 limTimerHandler,
393 SIR_LIM_HEART_BEAT_TIMEOUT,
394 cfgValue,
395 0,
396 TX_NO_ACTIVATE) != TX_SUCCESS)
397 {
398 /// Could not start Heartbeat timer.
399 // Log error
400 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700401 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700402 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700403 }
404
405 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
406 &cfgValue) != eSIR_SUCCESS)
407 {
408 /**
409 * Could not get PROBE_AFTER_HB_FAILURE
410 * value from CFG. Log error.
411 */
412 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700413 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700414 }
415
416 // Change timer to reactivate it in future
417 cfgValue = SYS_MS_TO_TICKS(cfgValue);
418
419 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
420 "Probe after Heartbeat TIMEOUT",
421 limTimerHandler,
422 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
423 cfgValue,
424 0,
425 TX_NO_ACTIVATE) != TX_SUCCESS)
426 {
427 // Could not creat wt-probe-after-HeartBeat-failure timer.
428 // Log error
429 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700430 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700431 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700432 }
433
Jeff Johnson295189b2012-06-20 16:38:30 -0700434 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
435 &cfgValue) != eSIR_SUCCESS)
436 {
437 /**
438 * Could not get Background scan period value
439 * from CFG. Log error.
440 */
441 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700442 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700443 }
444
445 /*
446 * setting period to zero means disabling background scans when associated
447 * the way we do this is to set a flag indicating this and keeping
448 * the timer running, since it will be used for PDU leak workarounds
449 * as well as background scanning during SME idle states
450 */
451 if (cfgValue == 0)
452 {
453 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
454 pMac->lim.gLimBackgroundScanDisable = true;
455 }
456 else
457 pMac->lim.gLimBackgroundScanDisable = false;
458
459 cfgValue = SYS_MS_TO_TICKS(cfgValue);
460
461 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
462 "Background scan TIMEOUT",
463 limTimerHandler,
464 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
465 cfgValue,
466 cfgValue,
467 TX_NO_ACTIVATE) != TX_SUCCESS)
468 {
469 /// Could not start background scan timer.
470 // Log error
471 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700472 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700473 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700474 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700475 }
476
Jeff Johnson295189b2012-06-20 16:38:30 -0700477 /**
478 * Create keepalive timer and activate it right away for AP role
479 */
480
481 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
482 &cfgValue) != eSIR_SUCCESS)
483 {
484 /**
485 * Could not get keepalive timeout value
486 * from CFG. Log error.
487 */
488 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700489 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700490 }
491
492 // A value of zero implies keep alive should be disabled
493 if (cfgValue == 0)
494 {
495 cfgValue = LIM_KEEPALIVE_TIMER_MS;
496 pMac->sch.keepAlive = 0;
497 } else
498 pMac->sch.keepAlive = 1;
499
500
501 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
502
503 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
504 "KEEPALIVE_TIMEOUT",
505 limKeepaliveTmerHandler,
506 0,
507 cfgValue,
508 cfgValue,
509 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
510 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
511 != TX_SUCCESS)
512 {
513 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700514 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700515 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700516 }
517
518 /**
519 * Create all CNF_WAIT Timers upfront
520 */
521
522 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
523 &cfgValue) != eSIR_SUCCESS)
524 {
525 /**
526 * Could not get CNF_WAIT timeout value
527 * from CFG. Log error.
528 */
529 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700530 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700531 }
532 cfgValue = SYS_MS_TO_TICKS(cfgValue);
533
534 for (i=0; i<pMac->lim.maxStation; i++)
535 {
536 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
537 "CNF_MISS_TIMEOUT",
538 limCnfWaitTmerHandler,
539 (tANI_U32)i,
540 cfgValue,
541 0,
542 TX_NO_ACTIVATE) != TX_SUCCESS)
543 {
544 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700545 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700546 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700547 }
548 }
549
550 /*
551 ** Alloc and init table for the preAuth timer list
552 **
553 **/
554
555 // get max number of Preauthentication
556 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
557 &cfgValue) != eSIR_SUCCESS)
558 {
559 /*
560 ** Could not get max preauth value
561 ** from CFG. Log error.
562 **/
563 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700564 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700565 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700566 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530567 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_vmalloc(cfgValue*sizeof(tLimPreAuthNode));
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530568 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700569 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530570 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700571 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700572 }
573
574 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700575 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700576
577
Jeff Johnson295189b2012-06-20 16:38:30 -0700578 {
579 /**
580 * Create OLBC cache aging timer
581 */
582 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
583 &cfgValue) != eSIR_SUCCESS)
584 {
585 /**
586 * Could not get OLBC detect timeout value
587 * from CFG. Log error.
588 */
589 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700590 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700591 }
592
593 cfgValue = SYS_MS_TO_TICKS(cfgValue);
594
595 if (tx_timer_create(
596 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
597 "OLBC UPDATE CACHE TIMEOUT",
598 limUpdateOlbcCacheTimerHandler,
599 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
600 cfgValue,
601 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700602 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700603 {
604 // Cannot create update OLBC cache timer
605 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700606 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700607 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700608 }
609 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700610#ifdef WLAN_FEATURE_VOWIFI_11R
611 // In future we need to use the auth timer, cause
612 // the pre auth session will be introduced before sending
613 // Auth frame.
614 // We need to go off channel and come back to home channel
615 cfgValue = 1000;
616 cfgValue = SYS_MS_TO_TICKS(cfgValue);
617
618 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
619 "FT PREAUTH RSP TIMEOUT",
620 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
621 cfgValue, 0,
622 TX_NO_ACTIVATE) != TX_SUCCESS)
623 {
624 // Could not create Join failure timer.
625 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700626 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700627 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700628 }
629#endif
630
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530631#ifdef WLAN_FEATURE_LFR_MBB
632 cfgValue = PREAUTH_REASSOC_TIMEOUT;
633 cfgValue = SYS_MS_TO_TICKS(cfgValue);
634
635 if (tx_timer_create(&pMac->lim.limTimers.glim_pre_auth_mbb_rsp_timer,
636 "PREAUTH MBB RSP TIMEOUT",
637 limTimerHandler, SIR_LIM_PREAUTH_MBB_RSP_TIMEOUT,
638 cfgValue, 0,
639 TX_NO_ACTIVATE) != TX_SUCCESS)
640 {
641 limLog(pMac, LOGP, FL("could not create PREAUTH_MBB_RSP timer"));
642 goto err_timer;
643 }
Padma, Santhosh Kumarf4966dc2017-01-03 18:56:00 +0530644
645 cfgValue = PREAUTH_REASSOC_TIMEOUT;
646 cfgValue = SYS_MS_TO_TICKS(cfgValue);
647
648 if (tx_timer_create(&pMac->lim.limTimers.glim_reassoc_mbb_rsp_timer,
649 "REASSOC MBB RSP TIMEOUT",
650 limTimerHandler, SIR_LIM_REASSOC_MBB_RSP_TIMEOUT,
651 cfgValue, 0,
652 TX_NO_ACTIVATE) != TX_SUCCESS)
653 {
654 limLog(pMac, LOGP, FL("could not create REASSOC_MBB_RSP timer"));
655 goto err_timer;
656 }
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530657#endif
658
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800659#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700660 cfgValue = 5000;
661 cfgValue = SYS_MS_TO_TICKS(cfgValue);
662
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800663 if (tx_timer_create(&pMac->lim.limTimers.gLimEseTsmTimer,
664 "ESE TSM Stats TIMEOUT",
665 limTimerHandler, SIR_LIM_ESE_TSM_TIMEOUT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700666 cfgValue, 0,
667 TX_NO_ACTIVATE) != TX_SUCCESS)
668 {
669 // Could not create Join failure timer.
670 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700671 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700672 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700673 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800674#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700675
Jeff Johnson295189b2012-06-20 16:38:30 -0700676 cfgValue = 1000;
677 cfgValue = SYS_MS_TO_TICKS(cfgValue);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800678 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
679 "DISASSOC ACK TIMEOUT",
680 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
681 cfgValue, 0,
682 TX_NO_ACTIVATE) != TX_SUCCESS)
683 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700684 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800685 goto err_timer;
686 }
687
688 cfgValue = 1000;
689 cfgValue = SYS_MS_TO_TICKS(cfgValue);
690 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
691 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800692 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800693 cfgValue, 0,
694 TX_NO_ACTIVATE) != TX_SUCCESS)
695 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700696 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800697 goto err_timer;
698 }
Viral Modid86bde22012-12-10 13:09:21 -0800699
Viral Modid86bde22012-12-10 13:09:21 -0800700 cfgValue = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE; // (> no of BI* no of TUs per BI * 1TU in msec + p2p start time offset*1 TU in msec = 2*100*1.024 + 5*1.024 = 204.8 + 5.12 = 209.20)
701 cfgValue = SYS_MS_TO_TICKS(cfgValue);
702 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
703 "Single Shot NOA Insert timeout",
704 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
705 cfgValue, 0,
706 TX_NO_ACTIVATE) != TX_SUCCESS)
707 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700708 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800709 goto err_timer;
710 }
Viral Modid86bde22012-12-10 13:09:21 -0800711
Hanumantha Reddy Pothula97ea0952015-10-09 11:29:39 +0530712 cfgValue = WNI_CFG_ACTIVE_PASSIVE_CON_MAX;
713 if (eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_PASSIVE_CON,
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530714 &cfgValue))
715 {
716 limLog(pMac, LOGP,
717 FL("could not retrieve WNI_CFG_ACTIVE_PASSIVE_CON"));
718 }
719 if (cfgValue)
720 {
721 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
722 cfgValue = SYS_MS_TO_TICKS(cfgValue);
723 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530724 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
725 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
726 TX_NO_ACTIVATE) != TX_SUCCESS)
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530727 {
728 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
729 goto err_timer;
730 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530731 }
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530732 else
733 {
734 limLog(pMac, LOG1,
735 FL("gLimActiveToPassiveChannelTimer not created %d"), cfgValue);
736 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530737
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700738 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700739
740 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800741 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800742 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800743#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
744 tx_timer_delete(&pMac->lim.limTimers.gLimEseTsmTimer);
745#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700746 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530747#ifdef WLAN_FEATURE_LFR_MBB
748 tx_timer_delete(&pMac->lim.limTimers.glim_pre_auth_mbb_rsp_timer);
Padma, Santhosh Kumarf4966dc2017-01-03 18:56:00 +0530749 tx_timer_delete(&pMac->lim.limTimers.glim_reassoc_mbb_rsp_timer);
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530750#endif
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700751 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
752 while(((tANI_S32)--i) >= 0)
753 {
754 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
755 }
756 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700757 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
758 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
759 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
760 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
761 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
762 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
763 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800764 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800765 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Sushant Kaushik9e923872015-04-02 17:09:31 +0530766 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700767 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
768 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
769 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
770 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
771 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
772 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800773 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530774 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700775
776 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800777 {
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530778 vos_mem_vfree(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800779 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
780 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700781
782 return TX_TIMER_ERROR;
783
Jeff Johnson295189b2012-06-20 16:38:30 -0700784} /****** end limCreateTimers() ******/
785
786
787
788/**
789 * limTimerHandler()
790 *
791 *FUNCTION:
792 * This function is called upon
793 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
794 * 2. JOIN_FAILURE timer expiration while joining a BSS
795 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
796 * 4. Heartbeat timer expiration on STA
797 * 5. Background scan timer expiration on STA
798 * 6. AID release, Pre-auth cleanup and Link monitoring timer
799 * expiration on AP
800 *
801 *LOGIC:
802 *
803 *ASSUMPTIONS:
804 * NA
805 *
806 *NOTE:
807 * NA
808 *
809 * @param param - Message corresponding to the timer that expired
810 *
811 * @return None
812 */
813
814void
815limTimerHandler(void *pMacGlobal, tANI_U32 param)
816{
817 tANI_U32 statusCode;
818 tSirMsgQ msg;
819 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
820
821 // Prepare and post message to LIM Message Queue
822
823 msg.type = (tANI_U16) param;
824 msg.bodyptr = NULL;
825 msg.bodyval = 0;
826
Padma, Santhosh Kumarb036fc72015-11-13 16:22:23 +0530827 if ((statusCode = limPostMsgApiHighPri(pMac, &msg)) != eSIR_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700828 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700829 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700830 msg.type, statusCode);
831} /****** end limTimerHandler() ******/
832
833
834/**
835 * limAddtsResponseTimerHandler()
836 *
837 *FUNCTION:
838 * This function is called upon Addts response timer expiration on sta
839 *
840 *LOGIC:
841 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
842 * when this function is executed.
843 *
844 *ASSUMPTIONS:
845 * NA
846 *
847 *NOTE:
848 * NA
849 *
850 * @param param - pointer to pre-auth node
851 *
852 * @return None
853 */
854
855void
856limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
857{
858 tSirMsgQ msg;
859 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
860
861 // Prepare and post message to LIM Message Queue
862
863 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
864 msg.bodyval = param;
865 msg.bodyptr = NULL;
866
867 limPostMsgApi(pMac, &msg);
868} /****** end limAuthResponseTimerHandler() ******/
869
870
871/**
872 * limAuthResponseTimerHandler()
873 *
874 *FUNCTION:
875 * This function is called upon Auth response timer expiration on AP
876 *
877 *LOGIC:
878 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
879 * when this function is executed.
880 *
881 *ASSUMPTIONS:
882 * NA
883 *
884 *NOTE:
885 * NA
886 *
887 * @param param - pointer to pre-auth node
888 *
889 * @return None
890 */
891
892void
893limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
894{
895 tSirMsgQ msg;
896 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
897
898 // Prepare and post message to LIM Message Queue
899
900 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
901 msg.bodyptr = NULL;
902 msg.bodyval = (tANI_U32)param;
903
904 limPostMsgApi(pMac, &msg);
905} /****** end limAuthResponseTimerHandler() ******/
906
907
908
909/**
910 * limAssocFailureTimerHandler()
911 *
912 *FUNCTION:
913 * This function is called upon Re/Assoc failure timer expiration
914 * on STA
915 *
916 *LOGIC:
917 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
918 * when this function is executed.
919 *
920 *ASSUMPTIONS:
921 * NA
922 *
923 *NOTE:
924 * NA
925 *
926 * @param param - Indicates whether this is assoc or reassoc
927 * failure timeout
928 * @return None
929 */
930
931void
932limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
933{
934 tSirMsgQ msg;
935 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
936
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800937#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700938 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530939 (NULL != pMac->lim.pSessionEntry) &&
940 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700941 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700942 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Sachin Ahuja07a43012015-01-30 17:04:38 +0530943#ifdef FEATURE_WLAN_ESE
944 if (((pMac->lim.pSessionEntry->isESEconnection) &&
945 (pMac->lim.reAssocRetryAttempt <
946 (LIM_MAX_REASSOC_RETRY_LIMIT - 1)))||
947 ((!pMac->lim.pSessionEntry->isESEconnection) &&
948 (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT))
949 )
950#else
951 if (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
952#endif
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700953 {
954 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
955 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700956 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700957 return;
958 }
959 else
960 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700961 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700962 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
963 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530964 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700965 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
966 }
967 }
968 }
969#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700970 // Prepare and post message to LIM Message Queue
971
972 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
973 msg.bodyval = (tANI_U32)param;
974 msg.bodyptr = NULL;
975
976 limPostMsgApi(pMac, &msg);
977} /****** end limAssocFailureTimerHandler() ******/
978
979
980/**
981 * limUpdateOlbcCacheTimerHandler()
982 *
983 *FUNCTION:
984 * This function is called upon update olbc cache timer expiration
985 * on STA
986 *
987 *LOGIC:
988 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
989 * when this function is executed.
990 *
991 *ASSUMPTIONS:
992 * NA
993 *
994 *NOTE:
995 * NA
996 *
997 * @param
998 *
999 * @return None
1000 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001001void
1002limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
1003{
1004 tSirMsgQ msg;
1005 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
1006
1007 // Prepare and post message to LIM Message Queue
1008
1009 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
1010 msg.bodyval = 0;
1011 msg.bodyptr = NULL;
1012
1013 limPostMsgApi(pMac, &msg);
1014} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -07001015
1016/**
1017 * limDeactivateAndChangeTimer()
1018 *
1019 *FUNCTION:
1020 * This function is called to deactivate and change a timer
1021 * for future re-activation
1022 *
1023 *LOGIC:
1024 *
1025 *ASSUMPTIONS:
1026 * NA
1027 *
1028 *NOTE:
1029 * NA
1030 *
1031 * @param pMac - Pointer to Global MAC structure
1032 * @param timerId - enum of timer to be deactivated and changed
1033 * This enum is defined in limUtils.h file
1034 *
1035 * @return None
1036 */
1037
1038void
1039limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1040{
1041 tANI_U32 val=0, val1=0;
Sushant Kaushik9e923872015-04-02 17:09:31 +05301042 tpPESession psessionEntry;
Jeff Johnson295189b2012-06-20 16:38:30 -07001043
Jeff Johnson295189b2012-06-20 16:38:30 -07001044 switch (timerId)
1045 {
1046 case eLIM_ADDTS_RSP_TIMER:
1047 pMac->lim.gLimAddtsRspTimerCount++;
1048 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1049 {
1050 // Could not deactivate AddtsRsp Timer
1051 // Log error
1052 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001053 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001054 }
1055 break;
1056
1057 case eLIM_MIN_CHANNEL_TIMER:
1058 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1059 != TX_SUCCESS)
1060 {
1061 // Could not deactivate min channel timer.
1062 // Log error
1063 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001064 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001065 }
1066
Jeff Johnsone7245742012-09-05 17:12:55 -07001067#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001068 // If a background was triggered via Quiet BSS,
1069 // then we need to adjust the MIN and MAX channel
1070 // timer's accordingly to the Quiet duration that
1071 // was specified
1072 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1073 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1074 {
1075 // gLimQuietDuration is already cached in units of
1076 // system ticks. No conversion is reqd...
1077 val = pMac->lim.gLimSpecMgmt.quietDuration;
1078 }
1079 else
1080 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001081#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001082 if(pMac->lim.gpLimMlmScanReq)
1083 {
1084 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301085 if (pMac->btc.btc_scan_compromise_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001086 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301087 if (pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001088 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301089 val = SYS_MS_TO_TICKS(
1090 pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001091 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1092 }
1093 else
1094 {
1095 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1096 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301097 } else if (pMac->btc.btc_scan_compromise_sco &&
1098 pMac->roam.configParam.min_chntime_btc_sco) {
1099 val = SYS_MS_TO_TICKS(
1100 pMac->roam.configParam.min_chntime_btc_sco);
1101 limLog(pMac, LOG1,
1102 FL("Using BTC SCO Min Active Scan time %d"), val);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001103 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001104 }
1105 else
1106 {
1107 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1108 //No need to change min timer. This is not a scan
1109 break;
1110 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001111#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001112 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001113#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001114
1115 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1116 val, 0) != TX_SUCCESS)
1117 {
1118 // Could not change min channel timer.
1119 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001120 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001121 }
1122
1123 break;
1124
1125 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1126 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1127 != TX_SUCCESS)
1128 {
1129 // Could not deactivate min channel timer.
1130 // Log error
1131 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001132 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001133 }
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301134 if(pMac->lim.gpLimMlmScanReq)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001135 {
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301136 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301137 if (pMac->btc.btc_scan_compromise_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301138 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301139 if (pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301140 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301141 val = SYS_MS_TO_TICKS(
1142 pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)/2;
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301143 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1144 }
1145 else
1146 {
1147 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1148 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301149 } else if (pMac->btc.btc_scan_compromise_sco &&
1150 pMac->roam.configParam.min_chntime_btc_sco) {
1151 val = SYS_MS_TO_TICKS(
1152 pMac->roam.configParam.min_chntime_btc_sco / 2);
1153 limLog(pMac, LOG1,
1154 FL("Using BTC SCO Min Active Scan time %d"), val);
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301155 }
1156 }
1157 /*If val is 0 it means min Channel timer is 0 so take the value from maxChannelTimer*/
1158 if (!val)
1159 {
1160
1161 if(pMac->lim.gpLimMlmScanReq)
1162 {
1163 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime)/2;
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301164 if (pMac->btc.btc_scan_compromise_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301165 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301166 if (pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301167 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301168 val = SYS_MS_TO_TICKS(
1169 pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)/2;
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301170 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1171 }
1172 else
1173 {
1174 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1175 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301176 } else if (pMac->btc.btc_scan_compromise_sco &&
1177 pMac->roam.configParam.max_chntime_btc_sco) {
1178 val = SYS_MS_TO_TICKS(
1179 pMac->roam.configParam.max_chntime_btc_sco / 2);
1180 limLog(pMac, LOG1,
1181 FL("Using BTC SCO Max Active Scan time %d"), val);
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301182 }
1183 }
1184 else
1185 {
1186 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1187 //No need to change max timer. This is not a scan
1188 break;
1189 }
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001190 }
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301191 if (val)
Jeff Johnson295189b2012-06-20 16:38:30 -07001192 {
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301193 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1194 val, 0) != TX_SUCCESS)
1195 {
1196 // Could not change min channel timer.
1197 // Log error
1198 limLog(pMac, LOGE, FL("Unable to change periodic timer"));
1199 }
1200 }
1201 else
1202 {
1203 limLog(pMac, LOGE, FL("Do not change gLimPeriodicProbeReqTimer values,"
1204 "value = %d minchannel time = %d"
1205 "maxchannel time = %d"), val,
1206 pMac->lim.gpLimMlmScanReq->minChannelTime,
1207 pMac->lim.gpLimMlmScanReq->maxChannelTime);
Jeff Johnson295189b2012-06-20 16:38:30 -07001208 }
1209
1210 break;
1211
1212 case eLIM_MAX_CHANNEL_TIMER:
1213 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1214 != TX_SUCCESS)
1215 {
1216 // Could not deactivate max channel timer.
1217 // Log error
1218 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001219 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001220 }
1221
Jeff Johnson295189b2012-06-20 16:38:30 -07001222 // If a background was triggered via Quiet BSS,
1223 // then we need to adjust the MIN and MAX channel
1224 // timer's accordingly to the Quiet duration that
1225 // was specified
1226 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1227 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001228#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001229
1230 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1231 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1232 {
1233 // gLimQuietDuration is already cached in units of
1234 // system ticks. No conversion is reqd...
1235 val = pMac->lim.gLimSpecMgmt.quietDuration;
1236 }
1237 else
1238 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001239#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001240 if(pMac->lim.gpLimMlmScanReq)
1241 {
1242 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301243 if (pMac->btc.btc_scan_compromise_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001244 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301245 if (pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001246 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301247 val = SYS_MS_TO_TICKS(
1248 pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001249 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1250 }
1251 else
1252 {
1253 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1254 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301255 } else if (pMac->btc.btc_scan_compromise_sco &&
1256 pMac->roam.configParam.max_chntime_btc_sco) {
1257 val = SYS_MS_TO_TICKS(
1258 pMac->roam.configParam.max_chntime_btc_sco);
1259 limLog(pMac, LOG1,
1260 FL("Using BTC SCO Max Active Scan time %d"), val);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001261 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001262 }
1263 else
1264 {
1265 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1266 //No need to change max timer. This is not a scan
1267 break;
1268 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001269#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001270 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001271#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001272 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001273
1274 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1275 val, 0) != TX_SUCCESS)
1276 {
1277 // Could not change max channel timer.
1278 // Log error
1279 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001280 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001281 }
1282
1283 break;
1284
1285 case eLIM_JOIN_FAIL_TIMER:
1286 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1287 != TX_SUCCESS)
1288 {
1289 /**
1290 * Could not deactivate Join Failure
1291 * timer. Log error.
1292 */
1293 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001294 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 }
1296
1297 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1298 &val) != eSIR_SUCCESS)
1299 {
1300 /**
1301 * Could not get JoinFailureTimeout value
1302 * from CFG. Log error.
1303 */
1304 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001305 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001306 }
1307 val = SYS_MS_TO_TICKS(val);
1308
1309 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1310 val, 0) != TX_SUCCESS)
1311 {
1312 /**
1313 * Could not change Join Failure
1314 * timer. Log error.
1315 */
1316 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001317 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001318 }
1319
1320 break;
1321
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001322 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1323 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1324 != TX_SUCCESS)
1325 {
1326 // Could not deactivate periodic join req Times.
1327 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001328 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001329 }
1330
1331 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1332 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1333 val, 0) != TX_SUCCESS)
1334 {
1335 // Could not change periodic join req times.
1336 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001337 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001338 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001339
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001340 break;
1341
Jeff Johnson295189b2012-06-20 16:38:30 -07001342 case eLIM_AUTH_FAIL_TIMER:
1343 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1344 != TX_SUCCESS)
1345 {
1346 // Could not deactivate Auth failure timer.
1347 // Log error
1348 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001349 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 }
1351
1352 // Change timer to reactivate it in future
1353 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1354 &val) != eSIR_SUCCESS)
1355 {
1356 /**
1357 * Could not get AuthFailureTimeout value
1358 * from CFG. Log error.
1359 */
1360 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001361 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001362 }
1363 val = SYS_MS_TO_TICKS(val);
1364
1365 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1366 val, 0) != TX_SUCCESS)
1367 {
1368 // Could not change Authentication failure timer.
1369 // Log error
1370 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001371 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001372 }
1373
1374 break;
1375
Sushant Kaushik9e923872015-04-02 17:09:31 +05301376 case eLIM_AUTH_RETRY_TIMER:
1377
1378 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer)
1379 != TX_SUCCESS)
1380 {
1381 // Could not deactivate Auth Retry Timer.
1382 limLog(pMac, LOGP,
1383 FL("Unable to deactivate Auth Retry timer"));
1384 }
1385 if ((psessionEntry = peFindSessionBySessionId(pMac,
1386 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId))
1387 == NULL)
1388 {
1389 limLog(pMac, LOGP,
1390 FL("session does not exist for given SessionId : %d"),
1391 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId);
1392 break;
1393 }
1394 /* 3/5 of the beacon interval*/
1395 val = psessionEntry->beaconParams.beaconInterval * 3/5;
1396 val = SYS_MS_TO_TICKS(val);
1397 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
1398 val, 0) != TX_SUCCESS)
1399 {
1400 // Could not change Auth Retry timer.
1401 // Log error
1402 limLog(pMac, LOGP, FL("Unable to change Auth Retry timer"));
1403 }
1404
1405 break;
1406
Jeff Johnson295189b2012-06-20 16:38:30 -07001407 case eLIM_ASSOC_FAIL_TIMER:
1408 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1409 TX_SUCCESS)
1410 {
1411 // Could not deactivate Association failure timer.
1412 // Log error
1413 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001414 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001415 }
1416
1417 // Change timer to reactivate it in future
1418 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1419 &val) != eSIR_SUCCESS)
1420 {
1421 /**
1422 * Could not get AssocFailureTimeout value
1423 * from CFG. Log error.
1424 */
1425 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001426 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001427 }
1428 val = SYS_MS_TO_TICKS(val);
1429
1430 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1431 val, 0) != TX_SUCCESS)
1432 {
1433 // Could not change Association failure timer.
1434 // Log error
1435 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001436 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001437 }
1438
1439 break;
1440
1441 case eLIM_REASSOC_FAIL_TIMER:
1442 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1443 TX_SUCCESS)
1444 {
1445 // Could not deactivate Reassociation failure timer.
1446 // Log error
1447 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001448 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001449 }
1450
1451 // Change timer to reactivate it in future
1452 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1453 &val) != eSIR_SUCCESS)
1454 {
1455 /**
1456 * Could not get ReassocFailureTimeout value
1457 * from CFG. Log error.
1458 */
1459 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001460 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001461 }
1462 val = SYS_MS_TO_TICKS(val);
1463
1464 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1465 val, 0) != TX_SUCCESS)
1466 {
1467 // Could not change Reassociation failure timer.
1468 // Log error
1469 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001470 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001471 }
1472
1473 break;
1474
1475 case eLIM_HEART_BEAT_TIMER:
1476 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1477 TX_SUCCESS)
1478 {
1479 // Could not deactivate Heartbeat timer.
1480 // Log error
1481 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001482 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001483 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001484 else
1485 {
1486 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1487 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001488
1489 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1490 &val) != eSIR_SUCCESS)
1491 {
1492 /**
1493 * Could not get BEACON_INTERVAL value
1494 * from CFG. Log error.
1495 */
1496 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001497 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001498 }
1499
1500 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1501 eSIR_SUCCESS)
1502 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001503 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001504
1505 // Change timer to reactivate it in future
1506 val = SYS_MS_TO_TICKS(val * val1);
1507
1508 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1509 val, 0) != TX_SUCCESS)
1510 {
1511 // Could not change HeartBeat timer.
1512 // Log error
1513 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001514 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001515 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001516 else
1517 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001518 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001519 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001520 break;
1521
1522 case eLIM_PROBE_AFTER_HB_TIMER:
1523 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1524 TX_SUCCESS)
1525 {
1526 // Could not deactivate Heartbeat timer.
1527 // Log error
1528 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001529 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001530 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001531 else
1532 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301533 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001534 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001535
1536 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1537 &val) != eSIR_SUCCESS)
1538 {
1539 /**
1540 * Could not get PROBE_AFTER_HB_FAILURE
1541 * value from CFG. Log error.
1542 */
1543 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001544 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001545 }
1546
1547 // Change timer to reactivate it in future
1548 val = SYS_MS_TO_TICKS(val);
1549
1550 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1551 val, 0) != TX_SUCCESS)
1552 {
1553 // Could not change HeartBeat timer.
1554 // Log error
1555 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001556 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001557 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001558 else
1559 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001560 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001561 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001562
1563 break;
1564
1565 case eLIM_KEEPALIVE_TIMER:
1566 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1567 != TX_SUCCESS)
1568 {
1569 // Could not deactivate Keepalive timer.
1570 // Log error
1571 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001572 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001573 }
1574
1575 // Change timer to reactivate it in future
1576
1577 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1578 &val) != eSIR_SUCCESS)
1579 {
1580 /**
1581 * Could not get keepalive timeout value
1582 * from CFG. Log error.
1583 */
1584 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001585 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001586 }
1587 if (val == 0)
1588 {
1589 val = 3000;
1590 pMac->sch.keepAlive = 0;
1591 } else
1592 pMac->sch.keepAlive = 1;
1593
1594
1595
1596 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1597
1598 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1599 val, val) != TX_SUCCESS)
1600 {
1601 // Could not change KeepaliveTimer timer.
1602 // Log error
1603 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001604 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001605 }
1606
1607 break;
1608
Jeff Johnson295189b2012-06-20 16:38:30 -07001609 case eLIM_BACKGROUND_SCAN_TIMER:
1610 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1611 != TX_SUCCESS)
1612 {
1613 // Could not deactivate BackgroundScanTimer timer.
1614 // Log error
1615 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001616 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001617 }
1618
1619 // Change timer to reactivate it in future
1620 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1621 &val) != eSIR_SUCCESS)
1622 {
1623 /**
1624 * Could not get Background scan period value
1625 * from CFG. Log error.
1626 */
1627 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001628 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001629 }
1630 if (val == 0)
1631 {
1632 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1633 pMac->lim.gLimBackgroundScanDisable = true;
1634 }
1635 else
1636 pMac->lim.gLimBackgroundScanDisable = false;
1637
1638 val = SYS_MS_TO_TICKS(val);
1639
1640 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1641 val, val) != TX_SUCCESS)
1642 {
1643 // Could not change BackgroundScanTimer timer.
1644 // Log error
1645 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001646 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001647 }
1648
1649 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001650
Jeff Johnsone7245742012-09-05 17:12:55 -07001651#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001652 case eLIM_CHANNEL_SWITCH_TIMER:
1653 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1654 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001655 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001656 return;
1657 }
1658
1659 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1660 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1661 0) != TX_SUCCESS)
1662 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001663 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001664 return;
1665 }
1666 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001667#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001668
1669 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001670 break;
1671
Jeff Johnsone7245742012-09-05 17:12:55 -07001672#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001673 case eLIM_QUIET_BSS_TIMER:
1674 if (TX_SUCCESS !=
1675 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1676 {
1677 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001678 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001679 }
1680
1681 // gLimQuietDuration appears to be in units of ticks
1682 // Use it as is
1683 if (TX_SUCCESS !=
1684 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1685 pMac->lim.gLimSpecMgmt.quietDuration,
1686 0))
1687 {
1688 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001689 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001690 }
1691 break;
1692
1693 case eLIM_QUIET_TIMER:
1694 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1695 {
1696 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001697 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001698 }
1699
1700 // Set the NEW timeout value, in ticks
1701 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1702 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1703 {
1704 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001705 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001706 }
1707 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001708#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001709
Jeff Johnson295189b2012-06-20 16:38:30 -07001710#if 0
1711 case eLIM_WPS_OVERLAP_TIMER:
1712 {
1713 // Restart Learn Interval timer
1714
1715 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1716
1717 if (tx_timer_deactivate(
1718 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1719 {
1720 // Could not deactivate Learn Interval timer.
1721 // Log error
1722 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001723 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001724 }
1725
1726 if (tx_timer_change(
1727 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1728 WPSOverlapTimer, 0) != TX_SUCCESS)
1729 {
1730 // Could not change Learn Interval timer.
1731 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001732 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001733
1734 return;
1735 }
1736
1737 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001738 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001739 WPSOverlapTimer);
1740 }
1741 break;
1742#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001743
1744#ifdef WLAN_FEATURE_VOWIFI_11R
1745 case eLIM_FT_PREAUTH_RSP_TIMER:
1746 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1747 {
1748 /**
1749 ** Could not deactivate Join Failure
1750 ** timer. Log error.
1751 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001752 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001753 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001754 }
1755 val = 1000;
1756 val = SYS_MS_TO_TICKS(val);
1757 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1758 val, 0) != TX_SUCCESS)
1759 {
1760 /**
1761 * Could not change Join Failure
1762 * timer. Log error.
1763 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001764 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001765 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001766 }
1767 break;
1768#endif
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +05301769
1770#ifdef WLAN_FEATURE_LFR_MBB
1771 case eLIM_PREAUTH_MBB_RSP_TIMER:
1772 if (tx_timer_deactivate(&pMac->lim.limTimers.
1773 glim_pre_auth_mbb_rsp_timer) != TX_SUCCESS) {
1774 limLog(pMac, LOGP,
1775 FL("Unable to deactivate preauth response mbb timer"));
1776 return;
1777 }
1778 break;
Padma, Santhosh Kumarf4966dc2017-01-03 18:56:00 +05301779 case eLIM_REASSOC_MBB_RSP_TIMER:
1780 if (tx_timer_deactivate(&pMac->lim.limTimers.
1781 glim_reassoc_mbb_rsp_timer) != TX_SUCCESS) {
1782 limLog(pMac, LOGP,
1783 FL("Unable to deactivate reassoc response mbb timer"));
1784 return;
1785 }
1786 break;
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +05301787#endif
1788
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001789#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001790 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001791 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001792 != TX_SUCCESS)
1793 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001794 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001795 }
1796 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001797#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301798
1799 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1800 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1801 {
1802 /**
1803 ** Could not deactivate Active to passive channel timer.
1804 ** Log error.
1805 **/
1806 limLog(pMac, LOGP, FL("Unable to Deactivate "
1807 "Active to passive channel timer"));
1808 return;
1809 }
1810 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1811 val = SYS_MS_TO_TICKS(val);
1812 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1813 val, 0) != TX_SUCCESS)
1814 {
1815 /**
1816 * Could not change timer to check scan type for passive channel.
1817 * timer. Log error.
1818 */
1819 limLog(pMac, LOGP, FL("Unable to change timer"));
1820 return;
1821 }
1822 break;
1823
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001824 case eLIM_DISASSOC_ACK_TIMER:
1825 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1826 {
1827 /**
1828 ** Could not deactivate Join Failure
1829 ** timer. Log error.
1830 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001831 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001832 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001833 }
1834 val = 1000;
1835 val = SYS_MS_TO_TICKS(val);
1836 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1837 val, 0) != TX_SUCCESS)
1838 {
1839 /**
1840 * Could not change Join Failure
1841 * timer. Log error.
1842 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001843 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001844 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001845 }
1846 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001847
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001848 case eLIM_DEAUTH_ACK_TIMER:
1849 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1850 {
1851 /**
1852 ** Could not deactivate Join Failure
1853 ** timer. Log error.
1854 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001855 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001856 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001857 }
1858 val = 1000;
1859 val = SYS_MS_TO_TICKS(val);
1860 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1861 val, 0) != TX_SUCCESS)
1862 {
1863 /**
1864 * Could not change Join Failure
1865 * timer. Log error.
1866 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001867 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001868 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001869 }
1870 break;
Viral Modid86bde22012-12-10 13:09:21 -08001871
Viral Modid86bde22012-12-10 13:09:21 -08001872 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1873 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1874 {
1875 /**
1876 ** Could not deactivate SingleShot NOA Insert
1877 ** timer. Log error.
1878 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001879 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001880 return;
1881 }
1882 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1883 val = SYS_MS_TO_TICKS(val);
1884 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1885 val, 0) != TX_SUCCESS)
1886 {
1887 /**
1888 * Could not change Single Shot NOA Insert
1889 * timer. Log error.
1890 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001891 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001892 return;
1893 }
1894 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001895
Jeff Johnson295189b2012-06-20 16:38:30 -07001896 default:
1897 // Invalid timerId. Log error
1898 break;
1899 }
1900} /****** end limDeactivateAndChangeTimer() ******/
1901
1902
1903
1904/**---------------------------------------------------------------
1905\fn limHeartBeatDeactivateAndChangeTimer
1906\brief This function deactivates and changes the heart beat
1907\ timer, eLIM_HEART_BEAT_TIMER.
1908\
1909\param pMac
1910\param psessionEntry
1911\return None
1912------------------------------------------------------------------*/
1913void
1914limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1915{
Ravi Joshid0699502013-07-08 15:48:47 -07001916 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001917
Siddharth Bhal224da542014-05-28 07:07:46 +05301918 if (NULL == psessionEntry)
1919 {
1920 limLog(pMac, LOGE, FL("%s: received session id NULL."
1921 " Heartbeat timer config failed"), __func__);
1922 return;
1923 }
1924
Yathish9f22e662012-12-10 14:21:35 -08001925#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001926 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1927 return;
Yathish9f22e662012-12-10 14:21:35 -08001928#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001929
Ravi Joshid0699502013-07-08 15:48:47 -07001930 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1931 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001932
Ravi Joshid0699502013-07-08 15:48:47 -07001933 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1934 changing. to avoid this problem, HeartBeat interval is made constant, by
1935 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001936
Ravi Joshid0699502013-07-08 15:48:47 -07001937 //val = psessionEntry->beaconParams.beaconInterval;
1938 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001939
Ravi Joshid0699502013-07-08 15:48:47 -07001940 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1941 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001942
Ravi Joshid0699502013-07-08 15:48:47 -07001943 PELOGW(limLog(pMac,LOGW,
1944 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1945 val1, psessionEntry->beaconParams.beaconInterval,
1946 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001947
Ravi Joshid0699502013-07-08 15:48:47 -07001948 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1949 * enough to judge the peer device inactivity when 32 peers are connected.
1950 * Hence increasing the HB timer timeout to
1951 * HBtimeout = (TBTT * num_beacons * num_peers)
1952 */
1953 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1954 pMac->lim.gLimNumIbssPeers > 0)
1955 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001956 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001957 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001958
Ravi Joshid0699502013-07-08 15:48:47 -07001959 // Change timer to reactivate it in future
1960 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001961
Ravi Joshid0699502013-07-08 15:48:47 -07001962 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1963 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001964
1965} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1966
1967
1968/**---------------------------------------------------------------
1969\fn limReactivateHeartBeatTimer
1970\brief This function s called to deactivate, change and
1971\ activate a timer.
1972\
1973\param pMac - Pointer to Global MAC structure
1974\param psessionEntry
1975\return None
1976------------------------------------------------------------------*/
1977void
1978limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1979{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301980 if (NULL == psessionEntry)
1981 {
1982 limLog(pMac, LOGE, FL("%s: received session id NULL."
1983 " Heartbeat timer config failed"), __func__);
1984 return;
1985 }
1986
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001987 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001988
Yathish9f22e662012-12-10 14:21:35 -08001989#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1990 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001991 {
1992 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001993 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001994 }
Yathish9f22e662012-12-10 14:21:35 -08001995#endif
1996
Jeff Johnson295189b2012-06-20 16:38:30 -07001997 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001998
1999 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002000 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
2001 {
2002 /*
2003 * There is increasing need to limit the apps wakeup due to WLAN
2004 * activity. During HB monitoring, the beacons from peer are sent to
2005 * the host causing the host to wakeup. Hence, offloading the HB
2006 * monitoring to LMAC
2007 */
2008 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
2009 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
2010 {
2011 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
2012 {
2013 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
2014 }
2015 else
2016 {
2017 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
2018 }
2019 }
2020 else
2021 {
2022 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
2023 {
2024 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
2025 }
2026 else
2027 {
2028 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
2029 }
2030 }
2031 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07002032 }
2033
2034} /****** end limReactivateHeartBeatTimer() ******/
2035
Jeff Johnson295189b2012-06-20 16:38:30 -07002036
2037/**
2038 * limActivateHearBeatTimer()
2039 *
2040 *
2041 * @brief: This function is called to activate heartbeat timer
2042 *
2043 *LOGIC:
2044 *
2045 *ASSUMPTIONS:
2046 * NA
2047 *
2048 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2049 *
2050 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002051 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07002052 *
2053 * @return TX_SUCCESS - timer is activated
2054 * errors - fail to start the timer
2055 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002056v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002057{
2058 v_UINT_t status = TX_TIMER_ERROR;
2059
Yathish9f22e662012-12-10 14:21:35 -08002060#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2061 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07002062 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08002063#endif
2064
Jeff Johnson295189b2012-06-20 16:38:30 -07002065 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
2066 {
2067 //consider 0 interval a ok case
2068 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
2069 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002070 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
2071 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
2072 {
2073 /* HB offload in IBSS mode */
2074 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2075 if (TX_SUCCESS != status)
2076 {
2077 PELOGE(limLog(pMac, LOGE,
2078 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
2079 status);)
2080 }
2081 else
2082 {
2083 PELOGE(limLog(pMac, LOGE,
2084 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
2085 __func__);)
2086 }
2087
2088 }
2089 else
2090 {
2091 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2092 if ( TX_SUCCESS != status )
2093 {
2094 PELOGE(limLog(pMac, LOGE,
2095 FL("could not activate Heartbeat timer status(%d)"), status);)
2096 }
2097 else
2098 {
2099 PELOGE(limLog(pMac, LOGW,
2100 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2101 }
2102 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002103 }
2104 else
2105 {
2106 status = TX_SUCCESS;
2107 }
2108 }
2109
2110 return (status);
2111}
2112
2113
2114
2115/**
2116 * limDeactivateAndChangePerStaIdTimer()
2117 *
2118 *
2119 * @brief: This function is called to deactivate and change a per STA timer
2120 * for future re-activation
2121 *
2122 *LOGIC:
2123 *
2124 *ASSUMPTIONS:
2125 * NA
2126 *
2127 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2128 *
2129 * @param pMac - Pointer to Global MAC structure
2130 * @param timerId - enum of timer to be deactivated and changed
2131 * This enum is defined in limUtils.h file
2132 * @param staId - staId
2133 *
2134 * @return None
2135 */
2136
2137void
2138limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2139{
2140 tANI_U32 val;
Jeff Johnson295189b2012-06-20 16:38:30 -07002141
2142 switch (timerId)
2143 {
2144 case eLIM_CNF_WAIT_TIMER:
2145
2146 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2147 != TX_SUCCESS)
2148 {
2149 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002150 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002151
2152 }
2153
2154 // Change timer to reactivate it in future
2155
2156 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2157 &val) != eSIR_SUCCESS)
2158 {
2159 /**
2160 * Could not get cnf timeout value
2161 * from CFG. Log error.
2162 */
2163 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002164 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002165 }
2166 val = SYS_MS_TO_TICKS(val);
2167
2168 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2169 val, val) != TX_SUCCESS)
2170 {
2171 // Could not change cnf timer.
2172 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002173 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002174 }
2175
2176 break;
2177
2178 case eLIM_AUTH_RSP_TIMER:
2179 {
2180 tLimPreAuthNode *pAuthNode;
2181
2182 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2183
2184 if (pAuthNode == NULL)
2185 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002186 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002187 break;
2188 }
2189
2190 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2191 {
2192 // Could not deactivate auth response timer.
2193 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002194 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002195 }
2196
2197 // Change timer to reactivate it in future
2198
2199 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2200 {
2201 /**
2202 * Could not get auth rsp timeout value
2203 * from CFG. Log error.
2204 */
2205 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002206 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002207 }
2208
2209 val = SYS_MS_TO_TICKS(val);
2210
2211 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2212 {
2213 // Could not change auth rsp timer.
2214 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002215 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002216 }
2217 }
2218 break;
2219
Jeff Johnson295189b2012-06-20 16:38:30 -07002220
2221 default:
2222 // Invalid timerId. Log error
2223 break;
2224
2225 }
2226}
2227
2228
2229/**
2230 * limActivateCnfTimer()
2231 *
2232 *FUNCTION:
2233 * This function is called to activate a per STA timer
2234 *
2235 *LOGIC:
2236 *
2237 *ASSUMPTIONS:
2238 * NA
2239 *
2240 *NOTE:
2241 * NA
2242 *
2243 * @param pMac - Pointer to Global MAC structure
2244 * @param StaId - staId
2245 *
2246 * @return None
2247 */
2248
2249void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2250{
Jeff Johnson295189b2012-06-20 16:38:30 -07002251 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2252 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2253 != TX_SUCCESS)
2254 {
2255 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002256 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002257 }
2258}
2259
2260/**
2261 * limActivateAuthRspTimer()
2262 *
2263 *FUNCTION:
2264 * This function is called to activate a per STA timer
2265 *
2266 *LOGIC:
2267 *
2268 *ASSUMPTIONS:
2269 * NA
2270 *
2271 *NOTE:
2272 * NA
2273 *
2274 * @param pMac - Pointer to Global MAC structure
2275 * @param id - id
2276 *
2277 * @return None
2278 */
2279
2280void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2281{
Jeff Johnson295189b2012-06-20 16:38:30 -07002282 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2283 {
2284 /// Could not activate auth rsp timer.
2285 // Log error
2286 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002287 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002288 }
2289}
2290
2291
2292/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002293 * limAssocCnfWaitTmerHandler()
2294 *
2295 *FUNCTION:
2296 * This function post a message to send a disassociate frame out.
2297 *
2298 *LOGIC:
2299 *
2300 *ASSUMPTIONS:
2301 *
2302 *NOTE:
2303 * NA
2304 *
2305 * @param
2306 *
2307 * @return None
2308 */
2309
2310void
2311limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2312{
2313 tSirMsgQ msg;
2314 tANI_U32 statusCode;
2315 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2316
2317 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2318 msg.bodyval = (tANI_U32)param;
2319 msg.bodyptr = NULL;
2320
2321 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2322 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002323 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002324
2325}
2326
2327/**
2328 * limKeepaliveTmerHandler()
2329 *
2330 *FUNCTION:
2331 * This function post a message to send a NULL data frame.
2332 *
2333 *LOGIC:
2334 *
2335 *ASSUMPTIONS:
2336 *
2337 *NOTE:
2338 * NA
2339 *
2340 * @param
2341 *
2342 * @return None
2343 */
2344
2345void
2346limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2347{
2348 tSirMsgQ msg;
2349 tANI_U32 statusCode;
2350 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2351
2352 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2353 msg.bodyval = (tANI_U32)param;
2354 msg.bodyptr = NULL;
2355
2356 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2357 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002358 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002359
2360}
2361
2362void
2363limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2364{
2365 tSirMsgQ msg;
2366 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2367
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302368 limLog(pMac, LOG1,
2369 FL("ChannelSwitch Timer expired. Posting msg to LIM "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002370
2371 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2372 msg.bodyval = (tANI_U32)param;
2373 msg.bodyptr = NULL;
2374
2375 limPostMsgApi(pMac, &msg);
2376}
2377
2378void
2379limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2380{
2381 tSirMsgQ msg;
2382 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2383
2384 msg.type = SIR_LIM_QUIET_TIMEOUT;
2385 msg.bodyval = (tANI_U32)param;
2386 msg.bodyptr = NULL;
2387
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302388 limLog(pMac, LOG1,
2389 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002390 limPostMsgApi(pMac, &msg);
2391}
2392
2393void
2394limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2395{
2396 tSirMsgQ msg;
2397 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2398
2399 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2400 msg.bodyval = (tANI_U32)param;
2401 msg.bodyptr = NULL;
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302402 limLog(pMac, LOG1,
2403 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002404 limPostMsgApi(pMac, &msg);
2405}
Jeff Johnson295189b2012-06-20 16:38:30 -07002406#if 0
2407void
2408limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2409{
2410 tSirMsgQ msg;
2411 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2412
2413 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2414 msg.bodyval = (tANI_U32)param;
2415 msg.bodyptr = NULL;
2416 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002417 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002418 limPostMsgApi(pMac, &msg);
2419}
2420#endif
Yathish9f22e662012-12-10 14:21:35 -08002421
2422#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2423/* ACTIVE_MODE_HB_OFFLOAD */
2424/**
2425 * limMissedBeaconInActiveMode()
2426 *
2427 *FUNCTION:
2428 * This function handle beacon miss indication from FW
2429 * in Active mode.
2430 *
2431 *LOGIC:
2432 *
2433 *ASSUMPTIONS:
2434 * NA
2435 *
2436 *NOTE:
2437 * NA
2438 *
2439 * @param param - Msg Type
2440 *
2441 * @return None
2442 */
2443void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002444limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002445{
2446 tANI_U32 statusCode;
2447 tSirMsgQ msg;
2448 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2449
2450 // Prepare and post message to LIM Message Queue
2451 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002452 {
Yathish9f22e662012-12-10 14:21:35 -08002453 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002454 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002455 msg.bodyval = 0;
2456 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002457 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002458 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2459 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002460 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002461 msg.type, statusCode);
2462 }
2463}
2464#endif