blob: a54ca44fe1084169a0986968a9f7f22d24ed5ecc [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
Jeff Johnson295189b2012-06-20 16:38:30 -070041/*
42 * Airgo Networks, Inc proprietary. All rights reserved.
43 * This file limTimerUtils.cc contains the utility functions
44 * LIM uses for handling various timers.
45 * Author: Chandra Modumudi
46 * Date: 02/13/02
47 * History:-
48 * Date Modified by Modification Information
49 * --------------------------------------------------------------------
50 */
51
52#include "limTypes.h"
53#include "limUtils.h"
54#include "limAssocUtils.h"
55#include "limSecurityUtils.h"
56#include "pmmApi.h"
57
58
59// default value 5000 ms for background scan period when it is disabled
60#define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000
61// channel Switch Timer in ticks
62#define LIM_CHANNEL_SWITCH_TIMER_TICKS 1
63// Lim Quite timer in ticks
64#define LIM_QUIET_TIMER_TICKS 100
Jeff Johnsonfeddb2d2012-12-10 14:41:22 -080065// Lim Quite BSS timer interval in ticks
Jeff Johnson295189b2012-06-20 16:38:30 -070066#define LIM_QUIET_BSS_TIMER_TICK 100
67// Lim KeepAlive timer default (3000)ms
68#define LIM_KEEPALIVE_TIMER_MS 3000
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -080069// Lim JoinProbeRequest Retry timer default (200)ms
70#define LIM_JOIN_PROBE_REQ_TIMER_MS 200
Jeff Johnson295189b2012-06-20 16:38:30 -070071
72//default beacon interval value used in HB timer interval calculation
73#define LIM_HB_TIMER_BEACON_INTERVAL 100
74/**
75 * limCreateTimers()
76 *
77 *FUNCTION:
78 * This function is called upon receiving
79 * 1. SME_START_REQ for STA in ESS role
80 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
81 *
82 *LOGIC:
83 *
84 *ASSUMPTIONS:
85 * NA
86 *
87 *NOTE:
88 * NA
89 *
90 * @param pMac - Pointer to Global MAC structure
91 *
92 * @return None
93 */
94
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070095v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070096limCreateTimers(tpAniSirGlobal pMac)
97{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070098 tANI_U32 cfgValue, i=0;
Jeff Johnson295189b2012-06-20 16:38:30 -070099
100 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d\n"), pMac->lim.gLimSystemRole);)
101
102 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
103 &cfgValue) != eSIR_SUCCESS)
104 {
105 /**
106 * Could not get MinChannelTimeout value
107 * from CFG. Log error.
108 */
109 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value\n"));
110 }
111 cfgValue = SYS_MS_TO_TICKS(cfgValue);
112
113 // Create MIN/MAX channel timers and activate them later
114 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
115 "MIN CHANNEL TIMEOUT",
116 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
117 cfgValue, 0,
118 TX_NO_ACTIVATE) != TX_SUCCESS)
119 {
120 /// Could not start min channel timer.
121 // Log error
122 limLog(pMac, LOGP, FL("could not create MIN channel timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700123 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700124 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700125 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer\n"));)
126
127 /* Periodic probe request timer value is half of the Min channel
128 * timer. Probe request sends periodically till min/max channel
129 * timer expires
130 */
131
132 cfgValue = cfgValue/2 ;
133 if( cfgValue >= 1)
134 {
135 // Create periodic probe request timer and activate them later
136 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
137 "Periodic Probe Request Timer",
138 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
139 cfgValue, 0,
140 TX_NO_ACTIVATE) != TX_SUCCESS)
141 {
142 /// Could not start Periodic Probe Req timer.
143 // Log error
144 limLog(pMac, LOGP, FL("could not create periodic probe timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700145 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700146 }
147 }
148
149
150 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
151 &cfgValue) != eSIR_SUCCESS)
152 {
153 /**
154 * Could not get MAXChannelTimeout value
155 * from CFG. Log error.
156 */
157 limLog(pMac, LOGP,
158 FL("could not retrieve MAXChannelTimeout value\n"));
159 }
160 cfgValue = SYS_MS_TO_TICKS(cfgValue);
161
162 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
163 "MAX CHANNEL TIMEOUT",
164 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
165 cfgValue, 0,
166 TX_NO_ACTIVATE) != TX_SUCCESS)
167 {
168 /// Could not start max channel timer.
169 // Log error
170 limLog(pMac, LOGP, FL("could not create MAX channel timer\n"));
171
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700172 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700173 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700174 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer\n"));)
175
176 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
177 {
178 // Create Channel Switch Timer
179 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
180 "CHANNEL SWITCH TIMER",
181 limChannelSwitchTimerHandler,
182 0, // expiration_input
183 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
184 0, // reschedule_ticks
185 TX_NO_ACTIVATE) != TX_SUCCESS)
186 {
187 limLog(pMac, LOGP, FL("failed to create Channel Switch timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700188 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700189 }
190
191 //
192 // Create Quiet Timer
193 // This is used on the STA to go and shut-off
194 // Tx/Rx "after" the specified quiteInterval
195 //
196 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
197 "QUIET TIMER",
198 limQuietTimerHandler,
199 SIR_LIM_QUIET_TIMEOUT, // expiration_input
200 LIM_QUIET_TIMER_TICKS, // initial_ticks
201 0, // reschedule_ticks
202 TX_NO_ACTIVATE) != TX_SUCCESS)
203 {
204 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700205 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700206 }
207
208 //
209 // Create Quiet BSS Timer
210 // After the specified quiteInterval, determined by
211 // gLimQuietTimer, this timer, gLimQuietBssTimer,
212 // trigger and put the STA to sleep for the specified
213 // gLimQuietDuration
214 //
215 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
216 "QUIET BSS TIMER",
217 limQuietBssTimerHandler,
218 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
219 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
220 0, // reschedule_ticks
221 TX_NO_ACTIVATE) != TX_SUCCESS)
222 {
223 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700224 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 }
226
227 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
228 &cfgValue) != eSIR_SUCCESS)
229 {
230 /**
231 * Could not get JoinFailureTimeout value
232 * from CFG. Log error.
233 */
234 limLog(pMac, LOGP,
235 FL("could not retrieve JoinFailureTimeout value\n"));
236 }
237 cfgValue = SYS_MS_TO_TICKS(cfgValue);
238
239 // Create Join failure timer and activate it later
240 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
241 "JOIN FAILURE TIMEOUT",
242 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
243 cfgValue, 0,
244 TX_NO_ACTIVATE) != TX_SUCCESS)
245 {
246 /// Could not create Join failure timer.
247 // Log error
248 limLog(pMac, LOGP, FL("could not create Join failure timer\n"));
249
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700250 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700251 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800252
253 //Send unicast probe req frame every 200 ms
254 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
255 "Periodic Join Probe Request Timer",
256 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
257 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
258 TX_NO_ACTIVATE)) != TX_SUCCESS)
259 {
260 /// Could not create Periodic Join Probe Request timer.
261 // Log error
262 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer\n"));
263 goto err_timer;
264 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700265
266 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
267 &cfgValue) != eSIR_SUCCESS)
268 {
269 /**
270 * Could not get AssocFailureTimeout value
271 * from CFG. Log error.
272 */
273 limLog(pMac, LOGP,
274 FL("could not retrieve AssocFailureTimeout value\n"));
275 }
276 cfgValue = SYS_MS_TO_TICKS(cfgValue);
277
278 // Create Association failure timer and activate it later
279 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
280 "ASSOC FAILURE TIMEOUT",
281 limAssocFailureTimerHandler, LIM_ASSOC,
282 cfgValue, 0,
283 TX_NO_ACTIVATE) != TX_SUCCESS)
284 {
285 /// Could not create Assoc failure timer.
286 // Log error
287 limLog(pMac, LOGP,
288 FL("could not create Association failure timer\n"));
289
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700290 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700291 }
292 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
293 &cfgValue) != eSIR_SUCCESS)
294 {
295 /**
296 * Could not get ReassocFailureTimeout value
297 * from CFG. Log error.
298 */
299 limLog(pMac, LOGP,
300 FL("could not retrieve ReassocFailureTimeout value\n"));
301 }
302 cfgValue = SYS_MS_TO_TICKS(cfgValue);
303
304 // Create Association failure timer and activate it later
305 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
306 "REASSOC FAILURE TIMEOUT",
307 limAssocFailureTimerHandler, LIM_REASSOC,
308 cfgValue, 0,
309 TX_NO_ACTIVATE) != TX_SUCCESS)
310 {
311 /// Could not create Reassoc failure timer.
312 // Log error
313 limLog(pMac, LOGP,
314 FL("could not create Reassociation failure timer\n"));
315
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700316 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700317 }
318
319 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
320 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT \n"));
321
322 cfgValue = SYS_MS_TO_TICKS(cfgValue);
323
324 // Create Addts response timer and activate it later
325 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
326 "ADDTS RSP TIMEOUT",
327 limAddtsResponseTimerHandler,
328 SIR_LIM_ADDTS_RSP_TIMEOUT,
329 cfgValue, 0,
330 TX_NO_ACTIVATE) != TX_SUCCESS)
331 {
332 /// Could not create Auth failure timer.
333 // Log error
334 limLog(pMac, LOGP, FL("could not create Addts response timer\n"));
335
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700336 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700337 }
338
339 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
340 &cfgValue) != eSIR_SUCCESS)
341 {
342 /**
343 * Could not get AuthFailureTimeout value
344 * from CFG. Log error.
345 */
346 limLog(pMac, LOGP,
347 FL("could not retrieve AuthFailureTimeout value\n"));
348 }
349 cfgValue = SYS_MS_TO_TICKS(cfgValue);
350
351 // Create Auth failure timer and activate it later
352 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
353 "AUTH FAILURE TIMEOUT",
354 limTimerHandler,
355 SIR_LIM_AUTH_FAIL_TIMEOUT,
356 cfgValue, 0,
357 TX_NO_ACTIVATE) != TX_SUCCESS)
358 {
359 /// Could not create Auth failure timer.
360 // Log error
361 limLog(pMac, LOGP, FL("could not create Auth failure timer\n"));
362
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700363 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700364 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800365
Jeff Johnson295189b2012-06-20 16:38:30 -0700366 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
367 &cfgValue) != eSIR_SUCCESS)
368 {
369 /**
370 * Could not get BEACON_INTERVAL value
371 * from CFG. Log error.
372 */
373 limLog(pMac, LOGP,
374 FL("could not retrieve BEACON_INTERVAL value\n"));
375 }
376 cfgValue = SYS_MS_TO_TICKS(cfgValue);
377
378 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
379 "Heartbeat TIMEOUT",
380 limTimerHandler,
381 SIR_LIM_HEART_BEAT_TIMEOUT,
382 cfgValue,
383 0,
384 TX_NO_ACTIVATE) != TX_SUCCESS)
385 {
386 /// Could not start Heartbeat timer.
387 // Log error
388 limLog(pMac, LOGP,
389 FL("call to create heartbeat timer failed\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700390 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700391 }
392
393 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
394 &cfgValue) != eSIR_SUCCESS)
395 {
396 /**
397 * Could not get PROBE_AFTER_HB_FAILURE
398 * value from CFG. Log error.
399 */
400 limLog(pMac, LOGP,
401 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value\n"));
402 }
403
404 // Change timer to reactivate it in future
405 cfgValue = SYS_MS_TO_TICKS(cfgValue);
406
407 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
408 "Probe after Heartbeat TIMEOUT",
409 limTimerHandler,
410 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
411 cfgValue,
412 0,
413 TX_NO_ACTIVATE) != TX_SUCCESS)
414 {
415 // Could not creat wt-probe-after-HeartBeat-failure timer.
416 // Log error
417 limLog(pMac, LOGP,
418 FL("unable to create ProbeAfterHBTimer\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700419 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700420 }
421
Jeff Johnson295189b2012-06-20 16:38:30 -0700422#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
423 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
424 &cfgValue) != eSIR_SUCCESS)
425 {
426 /**
427 * Could not get Background scan period value
428 * from CFG. Log error.
429 */
430 limLog(pMac, LOGP,
431 FL("could not retrieve Background scan period value\n"));
432 }
433
434 /*
435 * setting period to zero means disabling background scans when associated
436 * the way we do this is to set a flag indicating this and keeping
437 * the timer running, since it will be used for PDU leak workarounds
438 * as well as background scanning during SME idle states
439 */
440 if (cfgValue == 0)
441 {
442 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
443 pMac->lim.gLimBackgroundScanDisable = true;
444 }
445 else
446 pMac->lim.gLimBackgroundScanDisable = false;
447
448 cfgValue = SYS_MS_TO_TICKS(cfgValue);
449
450 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
451 "Background scan TIMEOUT",
452 limTimerHandler,
453 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
454 cfgValue,
455 cfgValue,
456 TX_NO_ACTIVATE) != TX_SUCCESS)
457 {
458 /// Could not start background scan timer.
459 // Log error
460 limLog(pMac, LOGP,
461 FL("call to create background scan timer failed\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700462 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700463 }
464#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800465#ifdef FEATURE_WLAN_TDLS_INTERNAL
466 /*
467 * create TDLS timers..
468 * a) TDLS discovery response timer.
469 */
470
471 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
472 &cfgValue) != eSIR_SUCCESS)
473 {
474 /*
475 * Could not get discovery response Timeout value
476 * from CFG. Log error.
477 */
478 limLog(pMac, LOGP,
479 FL("could not retrieve ReassocFailureTimeout value\n"));
480 }
481 cfgValue = SYS_MS_TO_TICKS(cfgValue);
482
483 /*
484 * create TDLS discovery response wait timer and activate it later
485 */
486 if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer,
487 "TDLS discovery response WAIT",
488 limTimerHandler,
489 SIR_LIM_TDLS_DISCOVERY_RSP_WAIT,
490 cfgValue, 0,
491 TX_NO_ACTIVATE) != TX_SUCCESS)
492 {
493 limLog(pMac, LOGP,
494 FL("could not create TDLS discovery response wait timer\n"));
495 goto err_timer;
496 }
497#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700498 }
499
500
501 cfgValue = SYS_MS_TO_TICKS(LIM_HASH_MISS_TIMER_MS);
502
503 if (tx_timer_create(
504 &pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer,
505 "Disassoc throttle TIMEOUT",
506 limSendDisassocFrameThresholdHandler,
507 SIR_LIM_HASH_MISS_THRES_TIMEOUT,
508 cfgValue,
509 cfgValue,
510 TX_AUTO_ACTIVATE) != TX_SUCCESS)
511 {
512 /// Could not start Send Disassociate Frame Threshold timer.
513 // Log error
514 limLog(pMac, LOGP,
515 FL("create Disassociate throttle timer failed\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700516 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700517 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700518 PELOG1(limLog(pMac, LOG1,
519 FL("Created Disassociate throttle timer \n"));)
520
521 /**
522 * Create keepalive timer and activate it right away for AP role
523 */
524
525 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
526 &cfgValue) != eSIR_SUCCESS)
527 {
528 /**
529 * Could not get keepalive timeout value
530 * from CFG. Log error.
531 */
532 limLog(pMac, LOGP,
533 FL("could not retrieve keepalive timeout value\n"));
534 }
535
536 // A value of zero implies keep alive should be disabled
537 if (cfgValue == 0)
538 {
539 cfgValue = LIM_KEEPALIVE_TIMER_MS;
540 pMac->sch.keepAlive = 0;
541 } else
542 pMac->sch.keepAlive = 1;
543
544
545 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
546
547 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
548 "KEEPALIVE_TIMEOUT",
549 limKeepaliveTmerHandler,
550 0,
551 cfgValue,
552 cfgValue,
553 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
554 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
555 != TX_SUCCESS)
556 {
557 // Cannot create keepalive timer. Log error.
558 limLog(pMac, LOGP, FL("Cannot create keepalive timer.\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700559 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700560 }
561
562 /**
563 * Create all CNF_WAIT Timers upfront
564 */
565
566 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
567 &cfgValue) != eSIR_SUCCESS)
568 {
569 /**
570 * Could not get CNF_WAIT timeout value
571 * from CFG. Log error.
572 */
573 limLog(pMac, LOGP,
574 FL("could not retrieve CNF timeout value\n"));
575 }
576 cfgValue = SYS_MS_TO_TICKS(cfgValue);
577
578 for (i=0; i<pMac->lim.maxStation; i++)
579 {
580 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
581 "CNF_MISS_TIMEOUT",
582 limCnfWaitTmerHandler,
583 (tANI_U32)i,
584 cfgValue,
585 0,
586 TX_NO_ACTIVATE) != TX_SUCCESS)
587 {
588 // Cannot create timer. Log error.
589 limLog(pMac, LOGP, FL("Cannot create CNF wait timer.\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700590 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700591 }
592 }
593
594 /*
595 ** Alloc and init table for the preAuth timer list
596 **
597 **/
598
599 // get max number of Preauthentication
600 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
601 &cfgValue) != eSIR_SUCCESS)
602 {
603 /*
604 ** Could not get max preauth value
605 ** from CFG. Log error.
606 **/
607 limLog(pMac, LOGP,
608 FL("could not retrieve mac preauth value\n"));
609 }
610#ifdef ANI_AP_SDK_OPT
611 if(cfgValue > SIR_SDK_OPT_MAX_NUM_PRE_AUTH)
612 cfgValue = SIR_SDK_OPT_MAX_NUM_PRE_AUTH;
613#endif // ANI_AP_SDK_OPT
614 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
615 if (palAllocateMemory(pMac->hHdd, (void **) &pMac->lim.gLimPreAuthTimerTable.pTable,
616 cfgValue*sizeof(tLimPreAuthNode)) != eHAL_STATUS_SUCCESS)
617 {
618 limLog(pMac, LOGP, FL("palAllocateMemory failed!\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700619 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700620 }
621
622 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
623 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers\n"));)
624
625
626#ifdef WLAN_SOFTAP_FEATURE
627 {
628 /**
629 * Create OLBC cache aging timer
630 */
631 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
632 &cfgValue) != eSIR_SUCCESS)
633 {
634 /**
635 * Could not get OLBC detect timeout value
636 * from CFG. Log error.
637 */
638 limLog(pMac, LOGP,
639 FL("could not retrieve OLBD detect timeout value\n"));
640 }
641
642 cfgValue = SYS_MS_TO_TICKS(cfgValue);
643
644 if (tx_timer_create(
645 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
646 "OLBC UPDATE CACHE TIMEOUT",
647 limUpdateOlbcCacheTimerHandler,
648 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
649 cfgValue,
650 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700651 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700652 {
653 // Cannot create update OLBC cache timer
654 // Log error
655 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer\n"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700656 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700657 }
658 }
659#endif
660#ifdef WLAN_FEATURE_VOWIFI_11R
661 // In future we need to use the auth timer, cause
662 // the pre auth session will be introduced before sending
663 // Auth frame.
664 // We need to go off channel and come back to home channel
665 cfgValue = 1000;
666 cfgValue = SYS_MS_TO_TICKS(cfgValue);
667
668 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
669 "FT PREAUTH RSP TIMEOUT",
670 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
671 cfgValue, 0,
672 TX_NO_ACTIVATE) != TX_SUCCESS)
673 {
674 // Could not create Join failure timer.
675 // Log error
676 limLog(pMac, LOGP, FL("could not create Join failure timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700677 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700678 }
679#endif
680
681#ifdef FEATURE_WLAN_CCX
682 cfgValue = 5000;
683 cfgValue = SYS_MS_TO_TICKS(cfgValue);
684
685 if (tx_timer_create(&pMac->lim.limTimers.gLimCcxTsmTimer,
686 "CCX TSM Stats TIMEOUT",
687 limTimerHandler, SIR_LIM_CCX_TSM_TIMEOUT,
688 cfgValue, 0,
689 TX_NO_ACTIVATE) != TX_SUCCESS)
690 {
691 // Could not create Join failure timer.
692 // Log error
693 limLog(pMac, LOGP, FL("could not create Join failure timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700694 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700695 }
696#endif
697
698#ifdef WLAN_FEATURE_P2P
699 cfgValue = 1000;
700 cfgValue = SYS_MS_TO_TICKS(cfgValue);
701 if (tx_timer_create(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
702 "FT PREAUTH RSP TIMEOUT",
703 limTimerHandler, SIR_LIM_REMAIN_CHN_TIMEOUT,
704 cfgValue, 0,
705 TX_NO_ACTIVATE) != TX_SUCCESS)
706 {
707 // Could not create Join failure timer.
708 // Log error
709 limLog(pMac, LOGP, FL("could not create Join failure timer\n"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700710 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700711 }
712
713#endif
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800714
715 cfgValue = 1000;
716 cfgValue = SYS_MS_TO_TICKS(cfgValue);
717 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
718 "DISASSOC ACK TIMEOUT",
719 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
720 cfgValue, 0,
721 TX_NO_ACTIVATE) != TX_SUCCESS)
722 {
723 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer\n"));
724 goto err_timer;
725 }
726
727 cfgValue = 1000;
728 cfgValue = SYS_MS_TO_TICKS(cfgValue);
729 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
730 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800731 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800732 cfgValue, 0,
733 TX_NO_ACTIVATE) != TX_SUCCESS)
734 {
735 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer\n"));
736 goto err_timer;
737 }
Viral Modid86bde22012-12-10 13:09:21 -0800738
739#ifdef WLAN_FEATURE_P2P
740 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)
741 cfgValue = SYS_MS_TO_TICKS(cfgValue);
742 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
743 "Single Shot NOA Insert timeout",
744 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
745 cfgValue, 0,
746 TX_NO_ACTIVATE) != TX_SUCCESS)
747 {
748 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer\n"));
749 goto err_timer;
750 }
751#endif
752
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700753 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700754
755 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800756 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800757 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
758#ifdef WLAN_FEATURE_P2P
759 tx_timer_delete(&pMac->lim.limTimers.gLimRemainOnChannelTimer);
760#endif
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700761 #ifdef FEATURE_WLAN_CCX
762 tx_timer_delete(&pMac->lim.limTimers.gLimCcxTsmTimer);
763 #endif
764 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
765 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
766 while(((tANI_S32)--i) >= 0)
767 {
768 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
769 }
770 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
771 tx_timer_delete(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer);
772 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
773 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
774 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
775 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
776 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
777 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
778 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
779 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800780 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700781 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
782 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
783 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
784 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
785 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
786 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800787#ifdef WLAN_FEATURE_P2P
788 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
789#endif
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700790
791 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
792 palFreeMemory(pMac->hHdd, pMac->lim.gLimPreAuthTimerTable.pTable);
793
794 return TX_TIMER_ERROR;
795
Jeff Johnson295189b2012-06-20 16:38:30 -0700796} /****** end limCreateTimers() ******/
797
798
799
800/**
801 * limTimerHandler()
802 *
803 *FUNCTION:
804 * This function is called upon
805 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
806 * 2. JOIN_FAILURE timer expiration while joining a BSS
807 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
808 * 4. Heartbeat timer expiration on STA
809 * 5. Background scan timer expiration on STA
810 * 6. AID release, Pre-auth cleanup and Link monitoring timer
811 * expiration on AP
812 *
813 *LOGIC:
814 *
815 *ASSUMPTIONS:
816 * NA
817 *
818 *NOTE:
819 * NA
820 *
821 * @param param - Message corresponding to the timer that expired
822 *
823 * @return None
824 */
825
826void
827limTimerHandler(void *pMacGlobal, tANI_U32 param)
828{
829 tANI_U32 statusCode;
830 tSirMsgQ msg;
831 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
832
833 // Prepare and post message to LIM Message Queue
834
835 msg.type = (tANI_U16) param;
836 msg.bodyptr = NULL;
837 msg.bodyval = 0;
838
839 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
840 limLog(pMac, LOGE,
841 FL("posting message %X to LIM failed, reason=%d\n"),
842 msg.type, statusCode);
843} /****** end limTimerHandler() ******/
844
845
846/**
847 * limAddtsResponseTimerHandler()
848 *
849 *FUNCTION:
850 * This function is called upon Addts response timer expiration on sta
851 *
852 *LOGIC:
853 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
854 * when this function is executed.
855 *
856 *ASSUMPTIONS:
857 * NA
858 *
859 *NOTE:
860 * NA
861 *
862 * @param param - pointer to pre-auth node
863 *
864 * @return None
865 */
866
867void
868limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
869{
870 tSirMsgQ msg;
871 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
872
873 // Prepare and post message to LIM Message Queue
874
875 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
876 msg.bodyval = param;
877 msg.bodyptr = NULL;
878
879 limPostMsgApi(pMac, &msg);
880} /****** end limAuthResponseTimerHandler() ******/
881
882
883/**
884 * limAuthResponseTimerHandler()
885 *
886 *FUNCTION:
887 * This function is called upon Auth response timer expiration on AP
888 *
889 *LOGIC:
890 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
891 * when this function is executed.
892 *
893 *ASSUMPTIONS:
894 * NA
895 *
896 *NOTE:
897 * NA
898 *
899 * @param param - pointer to pre-auth node
900 *
901 * @return None
902 */
903
904void
905limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
906{
907 tSirMsgQ msg;
908 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
909
910 // Prepare and post message to LIM Message Queue
911
912 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
913 msg.bodyptr = NULL;
914 msg.bodyval = (tANI_U32)param;
915
916 limPostMsgApi(pMac, &msg);
917} /****** end limAuthResponseTimerHandler() ******/
918
919
920
921/**
922 * limAssocFailureTimerHandler()
923 *
924 *FUNCTION:
925 * This function is called upon Re/Assoc failure timer expiration
926 * on STA
927 *
928 *LOGIC:
929 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
930 * when this function is executed.
931 *
932 *ASSUMPTIONS:
933 * NA
934 *
935 *NOTE:
936 * NA
937 *
938 * @param param - Indicates whether this is assoc or reassoc
939 * failure timeout
940 * @return None
941 */
942
943void
944limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
945{
946 tSirMsgQ msg;
947 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
948
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700949#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
950 if((LIM_REASSOC == param) &&
951 (NULL != pMac->lim.pSessionEntry))
952 {
953 limLog(pMac, LOGE, FL("Reassoc timeout happened\n"));
954 if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
955 {
956 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
957 pMac->lim.reAssocRetryAttempt++;
958 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times\n"), pMac->lim.reAssocRetryAttempt);
959 return;
960 }
961 else
962 {
963 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached\n"), LIM_MAX_REASSOC_RETRY_LIMIT);
964 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
965 {
966 palFreeMemory( pMac->hHdd, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
967 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
968 }
969 }
970 }
971#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700972 // Prepare and post message to LIM Message Queue
973
974 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
975 msg.bodyval = (tANI_U32)param;
976 msg.bodyptr = NULL;
977
978 limPostMsgApi(pMac, &msg);
979} /****** end limAssocFailureTimerHandler() ******/
980
981
982/**
983 * limUpdateOlbcCacheTimerHandler()
984 *
985 *FUNCTION:
986 * This function is called upon update olbc cache timer expiration
987 * on STA
988 *
989 *LOGIC:
990 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
991 * when this function is executed.
992 *
993 *ASSUMPTIONS:
994 * NA
995 *
996 *NOTE:
997 * NA
998 *
999 * @param
1000 *
1001 * @return None
1002 */
1003#ifdef WLAN_SOFTAP_FEATURE
1004void
1005limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
1006{
1007 tSirMsgQ msg;
1008 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
1009
1010 // Prepare and post message to LIM Message Queue
1011
1012 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
1013 msg.bodyval = 0;
1014 msg.bodyptr = NULL;
1015
1016 limPostMsgApi(pMac, &msg);
1017} /****** end limUpdateOlbcCacheTimerHandler() ******/
1018#endif
1019
1020/**
1021 * limDeactivateAndChangeTimer()
1022 *
1023 *FUNCTION:
1024 * This function is called to deactivate and change a timer
1025 * for future re-activation
1026 *
1027 *LOGIC:
1028 *
1029 *ASSUMPTIONS:
1030 * NA
1031 *
1032 *NOTE:
1033 * NA
1034 *
1035 * @param pMac - Pointer to Global MAC structure
1036 * @param timerId - enum of timer to be deactivated and changed
1037 * This enum is defined in limUtils.h file
1038 *
1039 * @return None
1040 */
1041
1042void
1043limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1044{
1045 tANI_U32 val=0, val1=0;
1046
Jeff Johnsone7245742012-09-05 17:12:55 -07001047 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001048
1049 switch (timerId)
1050 {
1051 case eLIM_ADDTS_RSP_TIMER:
1052 pMac->lim.gLimAddtsRspTimerCount++;
1053 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1054 {
1055 // Could not deactivate AddtsRsp Timer
1056 // Log error
1057 limLog(pMac, LOGP,
1058 FL("Unable to deactivate AddtsRsp timer\n"));
1059 }
1060 break;
1061
1062 case eLIM_MIN_CHANNEL_TIMER:
1063 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1064 != TX_SUCCESS)
1065 {
1066 // Could not deactivate min channel timer.
1067 // Log error
1068 limLog(pMac, LOGP,
1069 FL("Unable to deactivate min channel timer\n"));
1070 }
1071
Jeff Johnsone7245742012-09-05 17:12:55 -07001072#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001073 // If a background was triggered via Quiet BSS,
1074 // then we need to adjust the MIN and MAX channel
1075 // timer's accordingly to the Quiet duration that
1076 // was specified
1077 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1078 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1079 {
1080 // gLimQuietDuration is already cached in units of
1081 // system ticks. No conversion is reqd...
1082 val = pMac->lim.gLimSpecMgmt.quietDuration;
1083 }
1084 else
1085 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001086#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001087 if(pMac->lim.gpLimMlmScanReq)
1088 {
1089 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
1090 }
1091 else
1092 {
1093 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1094 //No need to change min timer. This is not a scan
1095 break;
1096 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001097#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001098 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001099#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001100
1101 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1102 val, 0) != TX_SUCCESS)
1103 {
1104 // Could not change min channel timer.
1105 // Log error
1106 limLog(pMac, LOGP, FL("Unable to change min channel timer\n"));
1107 }
1108
1109 break;
1110
1111 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1112 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1113 != TX_SUCCESS)
1114 {
1115 // Could not deactivate min channel timer.
1116 // Log error
1117 limLog(pMac, LOGP,
1118 FL("Unable to deactivate periodic timer\n"));
1119 }
1120
1121 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
1122 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1123 val, 0) != TX_SUCCESS)
1124 {
1125 // Could not change min channel timer.
1126 // Log error
1127 limLog(pMac, LOGP, FL("Unable to change periodic timer\n"));
1128 }
1129
1130 break;
1131
1132 case eLIM_MAX_CHANNEL_TIMER:
1133 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1134 != TX_SUCCESS)
1135 {
1136 // Could not deactivate max channel timer.
1137 // Log error
1138 limLog(pMac, LOGP,
1139 FL("Unable to deactivate max channel timer\n"));
1140 }
1141
1142#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
1143 // If a background was triggered via Quiet BSS,
1144 // then we need to adjust the MIN and MAX channel
1145 // timer's accordingly to the Quiet duration that
1146 // was specified
1147 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1148 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001149#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001150
1151 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1152 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1153 {
1154 // gLimQuietDuration is already cached in units of
1155 // system ticks. No conversion is reqd...
1156 val = pMac->lim.gLimSpecMgmt.quietDuration;
1157 }
1158 else
1159 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001160#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001161 if(pMac->lim.gpLimMlmScanReq)
1162 {
1163 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
1164 }
1165 else
1166 {
1167 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1168 //No need to change max timer. This is not a scan
1169 break;
1170 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001171#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001172 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001173#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001174 }
1175#endif
1176#if defined(ANI_PRODUCT_TYPE_AP)
1177 if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
1178 {
1179 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
1180 &val) != eSIR_SUCCESS)
1181 {
1182 /**
1183 * Could not get max channel value
1184 * from CFG. Log error.
1185 */
1186 limLog(pMac, LOGP,
1187 FL("could not retrieve max channel value\n"));
1188 }
1189 val = SYS_MS_TO_TICKS(val);
1190 }
1191#endif
1192
1193 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1194 val, 0) != TX_SUCCESS)
1195 {
1196 // Could not change max channel timer.
1197 // Log error
1198 limLog(pMac, LOGP,
1199 FL("Unable to change max channel timer\n"));
1200 }
1201
1202 break;
1203
1204 case eLIM_JOIN_FAIL_TIMER:
1205 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1206 != TX_SUCCESS)
1207 {
1208 /**
1209 * Could not deactivate Join Failure
1210 * timer. Log error.
1211 */
1212 limLog(pMac, LOGP,
1213 FL("Unable to deactivate Join Failure timer\n"));
1214 }
1215
1216 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1217 &val) != eSIR_SUCCESS)
1218 {
1219 /**
1220 * Could not get JoinFailureTimeout value
1221 * from CFG. Log error.
1222 */
1223 limLog(pMac, LOGP,
1224 FL("could not retrieve JoinFailureTimeout value\n"));
1225 }
1226 val = SYS_MS_TO_TICKS(val);
1227
1228 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1229 val, 0) != TX_SUCCESS)
1230 {
1231 /**
1232 * Could not change Join Failure
1233 * timer. Log error.
1234 */
1235 limLog(pMac, LOGP,
1236 FL("Unable to change Join Failure timer\n"));
1237 }
1238
1239 break;
1240
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001241 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1242 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1243 != TX_SUCCESS)
1244 {
1245 // Could not deactivate periodic join req Times.
1246 limLog(pMac, LOGP,
1247 FL("Unable to deactivate periodic join request timer\n"));
1248 }
1249
1250 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1251 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1252 val, 0) != TX_SUCCESS)
1253 {
1254 // Could not change periodic join req times.
1255 // Log error
1256 limLog(pMac, LOGP, FL("Unable to change periodic join request timer\n"));
1257 }
1258
1259 break;
1260
Jeff Johnson295189b2012-06-20 16:38:30 -07001261 case eLIM_AUTH_FAIL_TIMER:
1262 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1263 != TX_SUCCESS)
1264 {
1265 // Could not deactivate Auth failure timer.
1266 // Log error
1267 limLog(pMac, LOGP,
1268 FL("Unable to deactivate auth failure timer\n"));
1269 }
1270
1271 // Change timer to reactivate it in future
1272 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1273 &val) != eSIR_SUCCESS)
1274 {
1275 /**
1276 * Could not get AuthFailureTimeout value
1277 * from CFG. Log error.
1278 */
1279 limLog(pMac, LOGP,
1280 FL("could not retrieve AuthFailureTimeout value\n"));
1281 }
1282 val = SYS_MS_TO_TICKS(val);
1283
1284 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1285 val, 0) != TX_SUCCESS)
1286 {
1287 // Could not change Authentication failure timer.
1288 // Log error
1289 limLog(pMac, LOGP,
1290 FL("unable to change Auth failure timer\n"));
1291 }
1292
1293 break;
1294
1295 case eLIM_ASSOC_FAIL_TIMER:
1296 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1297 TX_SUCCESS)
1298 {
1299 // Could not deactivate Association failure timer.
1300 // Log error
1301 limLog(pMac, LOGP,
1302 FL("unable to deactivate Association failure timer\n"));
1303 }
1304
1305 // Change timer to reactivate it in future
1306 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1307 &val) != eSIR_SUCCESS)
1308 {
1309 /**
1310 * Could not get AssocFailureTimeout value
1311 * from CFG. Log error.
1312 */
1313 limLog(pMac, LOGP,
1314 FL("could not retrieve AssocFailureTimeout value\n"));
1315 }
1316 val = SYS_MS_TO_TICKS(val);
1317
1318 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1319 val, 0) != TX_SUCCESS)
1320 {
1321 // Could not change Association failure timer.
1322 // Log error
1323 limLog(pMac, LOGP,
1324 FL("unable to change Assoc failure timer\n"));
1325 }
1326
1327 break;
1328
1329 case eLIM_REASSOC_FAIL_TIMER:
1330 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1331 TX_SUCCESS)
1332 {
1333 // Could not deactivate Reassociation failure timer.
1334 // Log error
1335 limLog(pMac, LOGP,
1336 FL("unable to deactivate Reassoc failure timer\n"));
1337 }
1338
1339 // Change timer to reactivate it in future
1340 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1341 &val) != eSIR_SUCCESS)
1342 {
1343 /**
1344 * Could not get ReassocFailureTimeout value
1345 * from CFG. Log error.
1346 */
1347 limLog(pMac, LOGP,
1348 FL("could not retrieve ReassocFailureTimeout value\n"));
1349 }
1350 val = SYS_MS_TO_TICKS(val);
1351
1352 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1353 val, 0) != TX_SUCCESS)
1354 {
1355 // Could not change Reassociation failure timer.
1356 // Log error
1357 limLog(pMac, LOGP,
1358 FL("unable to change Reassociation failure timer\n"));
1359 }
1360
1361 break;
1362
1363 case eLIM_HEART_BEAT_TIMER:
1364 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1365 TX_SUCCESS)
1366 {
1367 // Could not deactivate Heartbeat timer.
1368 // Log error
1369 limLog(pMac, LOGP,
1370 FL("unable to deactivate Heartbeat timer\n"));
1371 }
1372
1373 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1374 &val) != eSIR_SUCCESS)
1375 {
1376 /**
1377 * Could not get BEACON_INTERVAL value
1378 * from CFG. Log error.
1379 */
1380 limLog(pMac, LOGP,
1381 FL("could not retrieve BEACON_INTERVAL value\n"));
1382 }
1383
1384 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1385 eSIR_SUCCESS)
1386 limLog(pMac, LOGP,
1387 FL("could not retrieve heartbeat failure value\n"));
1388
1389 // Change timer to reactivate it in future
1390 val = SYS_MS_TO_TICKS(val * val1);
1391
1392 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1393 val, 0) != TX_SUCCESS)
1394 {
1395 // Could not change HeartBeat timer.
1396 // Log error
1397 limLog(pMac, LOGP,
1398 FL("unable to change HeartBeat timer\n"));
1399 }
1400
1401 break;
1402
1403 case eLIM_PROBE_AFTER_HB_TIMER:
1404 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1405 TX_SUCCESS)
1406 {
1407 // Could not deactivate Heartbeat timer.
1408 // Log error
1409 limLog(pMac, LOGP,
1410 FL("unable to deactivate probeAfterHBTimer\n"));
1411 }
1412
1413 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1414 &val) != eSIR_SUCCESS)
1415 {
1416 /**
1417 * Could not get PROBE_AFTER_HB_FAILURE
1418 * value from CFG. Log error.
1419 */
1420 limLog(pMac, LOGP,
1421 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value\n"));
1422 }
1423
1424 // Change timer to reactivate it in future
1425 val = SYS_MS_TO_TICKS(val);
1426
1427 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1428 val, 0) != TX_SUCCESS)
1429 {
1430 // Could not change HeartBeat timer.
1431 // Log error
1432 limLog(pMac, LOGP,
1433 FL("unable to change ProbeAfterHBTimer\n"));
1434 }
1435
1436 break;
1437
1438 case eLIM_KEEPALIVE_TIMER:
1439 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1440 != TX_SUCCESS)
1441 {
1442 // Could not deactivate Keepalive timer.
1443 // Log error
1444 limLog(pMac, LOGP,
1445 FL("unable to deactivate KeepaliveTimer timer\n"));
1446 }
1447
1448 // Change timer to reactivate it in future
1449
1450 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1451 &val) != eSIR_SUCCESS)
1452 {
1453 /**
1454 * Could not get keepalive timeout value
1455 * from CFG. Log error.
1456 */
1457 limLog(pMac, LOGP,
1458 FL("could not retrieve keepalive timeout value\n"));
1459 }
1460 if (val == 0)
1461 {
1462 val = 3000;
1463 pMac->sch.keepAlive = 0;
1464 } else
1465 pMac->sch.keepAlive = 1;
1466
1467
1468
1469 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1470
1471 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1472 val, val) != TX_SUCCESS)
1473 {
1474 // Could not change KeepaliveTimer timer.
1475 // Log error
1476 limLog(pMac, LOGP,
1477 FL("unable to change KeepaliveTimer timer\n"));
1478 }
1479
1480 break;
1481
1482#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
1483 case eLIM_BACKGROUND_SCAN_TIMER:
1484 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1485 != TX_SUCCESS)
1486 {
1487 // Could not deactivate BackgroundScanTimer timer.
1488 // Log error
1489 limLog(pMac, LOGP,
1490 FL("unable to deactivate BackgroundScanTimer timer\n"));
1491 }
1492
1493 // Change timer to reactivate it in future
1494 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1495 &val) != eSIR_SUCCESS)
1496 {
1497 /**
1498 * Could not get Background scan period value
1499 * from CFG. Log error.
1500 */
1501 limLog(pMac, LOGP,
1502 FL("could not retrieve Background scan period value\n"));
1503 }
1504 if (val == 0)
1505 {
1506 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1507 pMac->lim.gLimBackgroundScanDisable = true;
1508 }
1509 else
1510 pMac->lim.gLimBackgroundScanDisable = false;
1511
1512 val = SYS_MS_TO_TICKS(val);
1513
1514 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1515 val, val) != TX_SUCCESS)
1516 {
1517 // Could not change BackgroundScanTimer timer.
1518 // Log error
1519 limLog(pMac, LOGP,
1520 FL("unable to change BackgroundScanTimer timer\n"));
1521 }
1522
1523 break;
1524#endif
1525
1526#ifdef ANI_PRODUCT_TYPE_AP
1527 case eLIM_PRE_AUTH_CLEANUP_TIMER:
1528 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPreAuthClnupTimer) !=
1529 TX_SUCCESS)
1530 {
1531 // Could not deactivate Pre-auth cleanup timer.
1532 // Log error
1533 limLog(pMac, LOGP,
1534 FL("unable to deactivate Pre-auth cleanup timer\n"));
1535 }
1536
1537 // Change timer to reactivate it in future
1538 if (wlan_cfgGetInt(pMac, WNI_CFG_PREAUTH_CLNUP_TIMEOUT,
1539 &val) != eSIR_SUCCESS)
1540 {
1541 /**
1542 * Could not get pre-auth cleanup value
1543 * from CFG. Log error.
1544 */
1545 limLog(pMac, LOGP,
1546 FL("could not retrieve pre-auth cleanup value\n"));
1547 }
1548 val = SYS_MS_TO_TICKS(val);
1549
1550 if (tx_timer_change(&pMac->lim.limTimers.gLimPreAuthClnupTimer,
1551 val, val) != TX_SUCCESS)
1552 {
1553 // Could not change pre-auth cleanup timer.
1554 // Log error
1555 limLog(pMac, LOGP,
1556 FL("unable to change pre-auth cleanup timer\n"));
1557 }
1558
1559 break;
1560
1561 case eLIM_LEARN_INTERVAL_TIMER:
1562 {
1563 // Restart Learn Interval timer
1564 tANI_U32 learnInterval =
1565 pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod /
1566 pMac->lim.gpLimMeasReq->channelList.numChannels;
1567
1568 if (tx_timer_deactivate(
1569 &pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS)
1570 {
1571 // Could not deactivate Learn Interval timer.
1572 // Log error
1573 limLog(pMac, LOGP,
1574 FL("Unable to deactivate Learn Interval timer\n"));
1575 }
1576
1577 if (tx_timer_change(
1578 &pMac->lim.gLimMeasParams.learnIntervalTimer,
1579 SYS_MS_TO_TICKS(learnInterval), 0) != TX_SUCCESS)
1580 {
1581 // Could not change Learn Interval timer.
1582 // Log error
1583 limLog(pMac, LOGP, FL("Unable to change Learn Interval timer\n"));
1584
1585 return;
1586 }
1587
1588 limLog( pMac, LOG3,
1589 FL("Setting the Learn Interval TIMER to %d ticks\n"),
1590 SYS_MS_TO_TICKS(learnInterval));
1591 }
1592 break;
1593
1594#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07001595#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001596 case eLIM_CHANNEL_SWITCH_TIMER:
1597 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1598 {
1599 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!\n"));
1600 return;
1601 }
1602
1603 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1604 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1605 0) != TX_SUCCESS)
1606 {
1607 limLog(pMac, LOGP, FL("tx_timer_change failed \n"));
1608 return;
1609 }
1610 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001611#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001612
1613 case eLIM_LEARN_DURATION_TIMER:
1614#ifdef ANI_PRODUCT_TYPE_AP
1615 if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.learnDurationTimer) != TX_SUCCESS)
1616 {
1617 limLog(pMac, LOGP, FL("Could not deactivate learn duration timer\n"));
1618 return;
1619 }
1620
1621 if (pMac->lim.gpLimMeasReq->measControl.longChannelScanPeriodicity &&
1622 (pMac->lim.gLimMeasParams.shortDurationCount ==
1623 pMac->lim.gpLimMeasReq->measControl.longChannelScanPeriodicity))
1624 {
1625#ifdef ANI_AP_SDK
1626 val = pMac->lim.gLimScanDurationConvert.longChannelScanDuration_tick;
1627#else
1628 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.longChannelScanDuration
1629 + SYS_TICK_DUR_MS - 1);
1630 if(val > 1)
1631 val--;
1632#endif /* ANI_AP_SDK */
1633 // Time to perform measurements for longer term
1634 if (tx_timer_change(&pMac->lim.gLimMeasParams.learnDurationTimer,
1635 val, 0) != TX_SUCCESS)
1636 {
1637 // Could not change Learn duration timer.
1638 // Log error
1639 limLog(pMac, LOGP, FL("Unable to change Learn duration timer\n"));
1640 return;
1641 }
1642 pMac->lim.gLimMeasParams.shortDurationCount = 0;
1643 }
1644 else
1645 {
1646#ifdef ANI_AP_SDK
1647 val = pMac->lim.gLimScanDurationConvert.shortChannelScanDuration_tick;
1648#else
1649 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration
1650 + SYS_TICK_DUR_MS - 1);
1651 if(val > 1)
1652 val--;
1653#endif /* ANI_AP_SDK */
1654 if (tx_timer_change(&pMac->lim.gLimMeasParams.learnDurationTimer,
1655 val, 0) != TX_SUCCESS)
1656 {
1657 // Could not change Learn duration timer.
1658 // Log error
1659 limLog(pMac, LOGP, FL("Unable to change Learn duration timer\n"));
1660 }
1661 }
1662 pMac->lim.gpLimMeasData->duration = val * SYS_TICK_DUR_MS;
1663#endif
1664 break;
1665
Jeff Johnsone7245742012-09-05 17:12:55 -07001666#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001667 case eLIM_QUIET_BSS_TIMER:
1668 if (TX_SUCCESS !=
1669 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1670 {
1671 limLog( pMac, LOGE,
1672 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway...\n"));
1673 }
1674
1675 // gLimQuietDuration appears to be in units of ticks
1676 // Use it as is
1677 if (TX_SUCCESS !=
1678 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1679 pMac->lim.gLimSpecMgmt.quietDuration,
1680 0))
1681 {
1682 limLog( pMac, LOGE,
1683 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway...\n"));
1684 }
1685 break;
1686
1687 case eLIM_QUIET_TIMER:
1688 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1689 {
1690 limLog( pMac, LOGE,
1691 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway...\n" ));
1692 }
1693
1694 // Set the NEW timeout value, in ticks
1695 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1696 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1697 {
1698 limLog( pMac, LOGE,
1699 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway...\n" ));
1700 }
1701 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001702#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001703
1704#ifdef WLAN_SOFTAP_FEATURE
1705#if 0
1706 case eLIM_WPS_OVERLAP_TIMER:
1707 {
1708 // Restart Learn Interval timer
1709
1710 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1711
1712 if (tx_timer_deactivate(
1713 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1714 {
1715 // Could not deactivate Learn Interval timer.
1716 // Log error
1717 limLog(pMac, LOGP,
1718 FL("Unable to deactivate WPS overlap timer\n"));
1719 }
1720
1721 if (tx_timer_change(
1722 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1723 WPSOverlapTimer, 0) != TX_SUCCESS)
1724 {
1725 // Could not change Learn Interval timer.
1726 // Log error
1727 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer\n"));
1728
1729 return;
1730 }
1731
1732 limLog( pMac, LOGE,
1733 FL("Setting WPS overlap TIMER to %d ticks\n"),
1734 WPSOverlapTimer);
1735 }
1736 break;
1737#endif
1738#endif
1739
1740#ifdef WLAN_FEATURE_VOWIFI_11R
1741 case eLIM_FT_PREAUTH_RSP_TIMER:
1742 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1743 {
1744 /**
1745 ** Could not deactivate Join Failure
1746 ** timer. Log error.
1747 **/
1748 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001749 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001750 }
1751 val = 1000;
1752 val = SYS_MS_TO_TICKS(val);
1753 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1754 val, 0) != TX_SUCCESS)
1755 {
1756 /**
1757 * Could not change Join Failure
1758 * timer. Log error.
1759 */
1760 limLog(pMac, LOGP, FL("Unable to change Join Failure timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001761 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001762 }
1763 break;
1764#endif
1765#ifdef FEATURE_WLAN_CCX
1766 case eLIM_TSM_TIMER:
1767 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer)
1768 != TX_SUCCESS)
1769 {
1770 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer\n"));
1771 }
1772 break;
1773#endif
1774#ifdef WLAN_FEATURE_P2P
1775 case eLIM_REMAIN_CHN_TIMER:
1776 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS)
1777 {
1778 /**
1779 ** Could not deactivate Join Failure
1780 ** timer. Log error.
1781 **/
1782 limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001783 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001784 }
1785 val = 1000;
1786 val = SYS_MS_TO_TICKS(val);
1787 if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
1788 val, 0) != TX_SUCCESS)
1789 {
1790 /**
1791 * Could not change Join Failure
1792 * timer. Log error.
1793 */
1794 limLog(pMac, LOGP, FL("Unable to change timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001795 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001796 }
1797 break;
1798#endif
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001799 case eLIM_DISASSOC_ACK_TIMER:
1800 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1801 {
1802 /**
1803 ** Could not deactivate Join Failure
1804 ** timer. Log error.
1805 **/
1806 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001807 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001808 }
1809 val = 1000;
1810 val = SYS_MS_TO_TICKS(val);
1811 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1812 val, 0) != TX_SUCCESS)
1813 {
1814 /**
1815 * Could not change Join Failure
1816 * timer. Log error.
1817 */
1818 limLog(pMac, LOGP, FL("Unable to change timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001819 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001820 }
1821 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001822
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001823 case eLIM_DEAUTH_ACK_TIMER:
1824 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1825 {
1826 /**
1827 ** Could not deactivate Join Failure
1828 ** timer. Log error.
1829 **/
1830 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001831 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001832 }
1833 val = 1000;
1834 val = SYS_MS_TO_TICKS(val);
1835 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1836 val, 0) != TX_SUCCESS)
1837 {
1838 /**
1839 * Could not change Join Failure
1840 * timer. Log error.
1841 */
1842 limLog(pMac, LOGP, FL("Unable to change timer\n"));
Viral Modid86bde22012-12-10 13:09:21 -08001843 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001844 }
1845 break;
Viral Modid86bde22012-12-10 13:09:21 -08001846
1847#ifdef WLAN_FEATURE_P2P
1848 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1849 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1850 {
1851 /**
1852 ** Could not deactivate SingleShot NOA Insert
1853 ** timer. Log error.
1854 **/
1855 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer\n"));
1856 return;
1857 }
1858 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1859 val = SYS_MS_TO_TICKS(val);
1860 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1861 val, 0) != TX_SUCCESS)
1862 {
1863 /**
1864 * Could not change Single Shot NOA Insert
1865 * timer. Log error.
1866 */
1867 limLog(pMac, LOGP, FL("Unable to change timer\n"));
1868 return;
1869 }
1870 break;
1871#endif
1872
Jeff Johnson295189b2012-06-20 16:38:30 -07001873 default:
1874 // Invalid timerId. Log error
1875 break;
1876 }
1877} /****** end limDeactivateAndChangeTimer() ******/
1878
1879
1880
1881/**---------------------------------------------------------------
1882\fn limHeartBeatDeactivateAndChangeTimer
1883\brief This function deactivates and changes the heart beat
1884\ timer, eLIM_HEART_BEAT_TIMER.
1885\
1886\param pMac
1887\param psessionEntry
1888\return None
1889------------------------------------------------------------------*/
1890void
1891limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1892{
1893 tANI_U32 val, val1;
1894
Jeff Johnsone7245742012-09-05 17:12:55 -07001895 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001896#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1897 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1898 return;
1899#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001900
1901 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1902 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer \n"));
1903
1904 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1905 changing. to avoid this problem, HeartBeat interval is made constant, by
1906 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
1907
1908 //val = psessionEntry->beaconParams.beaconInterval;
1909 val = LIM_HB_TIMER_BEACON_INTERVAL;
1910
1911 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1912 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD \n"));
1913
1914 PELOGW(limLog(pMac,LOGW,
1915 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d \n"),
1916 val1, psessionEntry->beaconParams.beaconInterval,
1917 psessionEntry->peSessionId);)
1918
1919 // Change timer to reactivate it in future
1920 val = SYS_MS_TO_TICKS(val * val1);
1921
1922 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1923 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer\n"));
1924
1925} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1926
1927
1928/**---------------------------------------------------------------
1929\fn limReactivateHeartBeatTimer
1930\brief This function s called to deactivate, change and
1931\ activate a timer.
1932\
1933\param pMac - Pointer to Global MAC structure
1934\param psessionEntry
1935\return None
1936------------------------------------------------------------------*/
1937void
1938limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1939{
1940 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d\n"), psessionEntry->LimRxedBeaconCntDuringHB);)
1941
Yathish9f22e662012-12-10 14:21:35 -08001942#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1943 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1944 return;
1945#endif
1946
Jeff Johnson295189b2012-06-20 16:38:30 -07001947 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001948 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001949
1950 //only start the hearbeat-timer if the timeout value is non-zero
1951 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0) {
1952 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1953 {
1954 limLog(pMac, LOGP,FL("could not activate Heartbeat timer\n"));
1955 }
1956 limResetHBPktCount(psessionEntry);
1957 }
1958
1959} /****** end limReactivateHeartBeatTimer() ******/
1960
1961#if 0
1962/******
1963 * Note: Use this code once you have converted all
1964 * limReactivateHeartBeatTimer() calls to
1965 * limReactivateTimer() calls.
1966 *
1967 ******/
1968
1969Now, in dev/btamp2,
1970here are all the references to limReactivateHeartBeatTimer().
1971
1972C symbol: limReactivateHeartBeatTimer
1973
1974 File Function Line
19750 limTimerUtils.h <global> 55 void limReactivateHeartBeatTimer(tpAniSirGlobal , tpPESession);
19761 limIbssPeerMgmt.c limIbssHeartBeatHandle 1282 limReactivateHeartBeatTimer(pMac, psessionEntry);
19772 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 395 limReactivateHeartBeatTimer(pMac, psessionEntry);
19783 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 410 limReactivateHeartBeatTimer(pMac, psessionEntry);
19794 limProcessMlmRspMessages. limProcessStaMlmAddStaRsp 2111 limReactivateHeartBeatTimer(pMac, psessionEntry);
19805 limProcessMlmRspMessages_ limProcessStaMlmAddStaRsp 2350 limReactivateHeartBeatTimer(pMac, psessionEntry);
19816 limProcessMlmRspMessages_ limProcessStaMlmAddStaRsp 2111 limReactivateHeartBeatTimer(pMac, psessionEntry);
19827 limTimerUtils.c limReactivateHeartBeatTim 1473 limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
19838 limUtils.c limHandleHeartBeatFailure 6743 limReactivateHeartBeatTimer(pMac, psessionEntry);
19849 limUtils.c limHandleHeartBeatFailure 6751 limReactivateHeartBeatTimer(pMac, psessionEntry);
1985
1986Now, in main/latest, on the other hand,
1987here are all the references to limReactivateTimer().
1988
1989C symbol: limReactivateTimer
1990
1991 File Function Line
19920 limTimerUtils.h <global> 54 void limReactivateTimer(tpAniSirGlobal, tANI_U32);
19931 limIbssPeerMgmt.c limIbssHeartBeatHandle 1183 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
19942 limIbssPeerMgmt.c limIbssHeartBeatHandle 1246 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
19953 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 283 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
19964 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 320 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
19975 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 335 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
19986 limProcessMessageQueue.c limProcessMessages 1210 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
19997 limProcessMessageQueue.c limProcessMessages 1218 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
20008 limProcessMlmRspMessages. limProcessStaMlmAddStaRsp 1726 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER);
20019 limTimerUtils.c limReactivateTimer 1451 limReactivateTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
2002
2003
2004/**
2005 * limReactivateTimer()
2006 *
2007 *FUNCTION:
2008 * This function is called to deactivate, change and
2009 * activate a timer
2010 *
2011 *LOGIC:
2012 *
2013 *ASSUMPTIONS:
2014 * NA
2015 *
2016 *NOTE:
2017 * NA
2018 *
2019 * @param pMac - Pointer to Global MAC structure
2020 * @param timerId - enum of timer to be deactivated and changed
2021 * This enum is defined in limUtils.h file
2022 *
2023 * @return None
2024 */
2025
2026void
2027limReactivateTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
2028{
2029 if (timerId == eLIM_HEART_BEAT_TIMER)
2030 {
2031 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d\n"),
2032 pMac->lim.gLimRxedBeaconCntDuringHB);)
2033 limDeactivateAndChangeTimer(pMac, eLIM_HEART_BEAT_TIMER);
2034 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, eLIM_HEART_BEAT_TIMER));
2035 if (limActivateHearBeatTimer(pMac) != TX_SUCCESS)
2036 {
2037 /// Could not activate Heartbeat timer.
2038 // Log error
2039 limLog(pMac, LOGP,
2040 FL("could not activate Heartbeat timer\n"));
2041 }
2042 limResetHBPktCount(pMac);
2043 }
2044} /****** end limReactivateTimer() ******/
2045#endif
2046
2047
2048/**
2049 * limActivateHearBeatTimer()
2050 *
2051 *
2052 * @brief: This function is called to activate heartbeat timer
2053 *
2054 *LOGIC:
2055 *
2056 *ASSUMPTIONS:
2057 * NA
2058 *
2059 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2060 *
2061 * @param pMac - Pointer to Global MAC structure
2062 *
2063 * @return TX_SUCCESS - timer is activated
2064 * errors - fail to start the timer
2065 */
2066v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac)
2067{
2068 v_UINT_t status = TX_TIMER_ERROR;
2069
Yathish9f22e662012-12-10 14:21:35 -08002070#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2071 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
2072 return (status);
2073#endif
2074
Jeff Johnson295189b2012-06-20 16:38:30 -07002075 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
2076 {
2077 //consider 0 interval a ok case
2078 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
2079 {
2080 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2081 if( TX_SUCCESS != status )
2082 {
2083 PELOGE(limLog(pMac, LOGE,
2084 FL("could not activate Heartbeat timer status(%d)\n"), status);)
2085 }
2086 }
2087 else
2088 {
2089 status = TX_SUCCESS;
2090 }
2091 }
2092
2093 return (status);
2094}
2095
2096
2097
2098/**
2099 * limDeactivateAndChangePerStaIdTimer()
2100 *
2101 *
2102 * @brief: This function is called to deactivate and change a per STA timer
2103 * for future re-activation
2104 *
2105 *LOGIC:
2106 *
2107 *ASSUMPTIONS:
2108 * NA
2109 *
2110 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2111 *
2112 * @param pMac - Pointer to Global MAC structure
2113 * @param timerId - enum of timer to be deactivated and changed
2114 * This enum is defined in limUtils.h file
2115 * @param staId - staId
2116 *
2117 * @return None
2118 */
2119
2120void
2121limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2122{
2123 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07002124 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07002125
2126 switch (timerId)
2127 {
2128 case eLIM_CNF_WAIT_TIMER:
2129
2130 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2131 != TX_SUCCESS)
2132 {
2133 limLog(pMac, LOGP,
2134 FL("unable to deactivate CNF wait timer\n"));
2135
2136 }
2137
2138 // Change timer to reactivate it in future
2139
2140 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2141 &val) != eSIR_SUCCESS)
2142 {
2143 /**
2144 * Could not get cnf timeout value
2145 * from CFG. Log error.
2146 */
2147 limLog(pMac, LOGP,
2148 FL("could not retrieve cnf timeout value\n"));
2149 }
2150 val = SYS_MS_TO_TICKS(val);
2151
2152 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2153 val, val) != TX_SUCCESS)
2154 {
2155 // Could not change cnf timer.
2156 // Log error
2157 limLog(pMac, LOGP, FL("unable to change cnf wait timer\n"));
2158 }
2159
2160 break;
2161
2162 case eLIM_AUTH_RSP_TIMER:
2163 {
2164 tLimPreAuthNode *pAuthNode;
2165
2166 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2167
2168 if (pAuthNode == NULL)
2169 {
2170 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d\n"), staId);
2171 break;
2172 }
2173
2174 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2175 {
2176 // Could not deactivate auth response timer.
2177 // Log error
2178 limLog(pMac, LOGP, FL("unable to deactivate auth response timer\n"));
2179 }
2180
2181 // Change timer to reactivate it in future
2182
2183 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2184 {
2185 /**
2186 * Could not get auth rsp timeout value
2187 * from CFG. Log error.
2188 */
2189 limLog(pMac, LOGP,
2190 FL("could not retrieve auth response timeout value\n"));
2191 }
2192
2193 val = SYS_MS_TO_TICKS(val);
2194
2195 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2196 {
2197 // Could not change auth rsp timer.
2198 // Log error
2199 limLog(pMac, LOGP, FL("unable to change auth rsp timer\n"));
2200 }
2201 }
2202 break;
2203
2204#if (defined(ANI_PRODUCT_TYPE_AP) ||defined(ANI_PRODUCT_TYPE_AP_SDK))
2205 case eLIM_LEARN_INTERVAL_TIMER:
2206 {
2207 // Restart Learn Interval timer
2208 tANI_U32 learnInterval =
2209 pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod /
2210 pMac->lim.gpLimMeasReq->channelList.numChannels;
2211
2212 if (tx_timer_deactivate(
2213 &pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS)
2214 {
2215 // Could not deactivate Learn Interval timer.
2216 // Log error
2217 limLog(pMac, LOGP,
2218 FL("Unable to deactivate Learn Interval timer\n"));
2219 }
2220
2221 if (tx_timer_change(
2222 &pMac->lim.gLimMeasParams.learnIntervalTimer,
2223 SYS_MS_TO_TICKS(learnInterval), 0) != TX_SUCCESS)
2224 {
2225 // Could not change Learn Interval timer.
2226 // Log error
2227 limLog(pMac, LOGP, FL("Unable to change Learn Interval timer\n"));
2228
2229 return;
2230 }
2231
2232 limLog( pMac, LOG3,
2233 FL("Setting the Learn Interval TIMER to %d ticks\n"),
2234 SYS_MS_TO_TICKS(learnInterval) );
2235 }
2236 break;
2237#endif //#if (defined(ANI_PRODUCT_TYPE_AP) ||defined(ANI_PRODUCT_TYPE_AP_SDK))
2238
2239 default:
2240 // Invalid timerId. Log error
2241 break;
2242
2243 }
2244}
2245
2246
2247/**
2248 * limActivateCnfTimer()
2249 *
2250 *FUNCTION:
2251 * This function is called to activate a per STA timer
2252 *
2253 *LOGIC:
2254 *
2255 *ASSUMPTIONS:
2256 * NA
2257 *
2258 *NOTE:
2259 * NA
2260 *
2261 * @param pMac - Pointer to Global MAC structure
2262 * @param StaId - staId
2263 *
2264 * @return None
2265 */
2266
2267void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2268{
Jeff Johnsone7245742012-09-05 17:12:55 -07002269 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002270 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2271 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2272 != TX_SUCCESS)
2273 {
2274 limLog(pMac, LOGP,
2275 FL("could not activate cnf wait timer\n"));
2276 }
2277}
2278
2279/**
2280 * limActivateAuthRspTimer()
2281 *
2282 *FUNCTION:
2283 * This function is called to activate a per STA timer
2284 *
2285 *LOGIC:
2286 *
2287 *ASSUMPTIONS:
2288 * NA
2289 *
2290 *NOTE:
2291 * NA
2292 *
2293 * @param pMac - Pointer to Global MAC structure
2294 * @param id - id
2295 *
2296 * @return None
2297 */
2298
2299void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2300{
Jeff Johnsone7245742012-09-05 17:12:55 -07002301 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002302 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2303 {
2304 /// Could not activate auth rsp timer.
2305 // Log error
2306 limLog(pMac, LOGP,
2307 FL("could not activate auth rsp timer\n"));
2308 }
2309}
2310
2311
2312/**
2313 * limSendDisassocFrameThresholdHandler()
2314 *
2315 *FUNCTION:
2316 * This function reloads the credit to the send disassociate frame bucket
2317 *
2318 *LOGIC:
2319 *
2320 *ASSUMPTIONS:
2321 *
2322 *NOTE:
2323 * NA
2324 *
2325 * @param
2326 *
2327 * @return None
2328 */
2329
2330void
2331limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param)
2332{
2333 tSirMsgQ msg;
2334 tANI_U32 statusCode;
2335 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2336
2337 msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT;
2338 msg.bodyval = 0;
2339 msg.bodyptr = NULL;
2340
2341 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2342 limLog(pMac, LOGE,
2343 FL("posting to LIM failed, reason=%d\n"), statusCode);
2344
2345}
2346
2347/**
2348 * limAssocCnfWaitTmerHandler()
2349 *
2350 *FUNCTION:
2351 * This function post a message to send a disassociate frame out.
2352 *
2353 *LOGIC:
2354 *
2355 *ASSUMPTIONS:
2356 *
2357 *NOTE:
2358 * NA
2359 *
2360 * @param
2361 *
2362 * @return None
2363 */
2364
2365void
2366limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2367{
2368 tSirMsgQ msg;
2369 tANI_U32 statusCode;
2370 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2371
2372 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2373 msg.bodyval = (tANI_U32)param;
2374 msg.bodyptr = NULL;
2375
2376 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2377 limLog(pMac, LOGE,
2378 FL("posting to LIM failed, reason=%d\n"), statusCode);
2379
2380}
2381
2382/**
2383 * limKeepaliveTmerHandler()
2384 *
2385 *FUNCTION:
2386 * This function post a message to send a NULL data frame.
2387 *
2388 *LOGIC:
2389 *
2390 *ASSUMPTIONS:
2391 *
2392 *NOTE:
2393 * NA
2394 *
2395 * @param
2396 *
2397 * @return None
2398 */
2399
2400void
2401limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2402{
2403 tSirMsgQ msg;
2404 tANI_U32 statusCode;
2405 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2406
2407 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2408 msg.bodyval = (tANI_U32)param;
2409 msg.bodyptr = NULL;
2410
2411 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2412 limLog(pMac, LOGE,
2413 FL("posting to LIM failed, reason=%d\n"), statusCode);
2414
2415}
2416
2417void
2418limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2419{
2420 tSirMsgQ msg;
2421 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2422
2423 PELOG1(limLog(pMac, LOG1,
2424 FL("ChannelSwitch Timer expired. Posting msg to LIM \n"));)
2425
2426 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2427 msg.bodyval = (tANI_U32)param;
2428 msg.bodyptr = NULL;
2429
2430 limPostMsgApi(pMac, &msg);
2431}
2432
2433void
2434limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2435{
2436 tSirMsgQ msg;
2437 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2438
2439 msg.type = SIR_LIM_QUIET_TIMEOUT;
2440 msg.bodyval = (tANI_U32)param;
2441 msg.bodyptr = NULL;
2442
2443 PELOG1(limLog(pMac, LOG1,
2444 FL("Post SIR_LIM_QUIET_TIMEOUT msg. \n"));)
2445 limPostMsgApi(pMac, &msg);
2446}
2447
2448void
2449limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2450{
2451 tSirMsgQ msg;
2452 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2453
2454 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2455 msg.bodyval = (tANI_U32)param;
2456 msg.bodyptr = NULL;
2457 PELOG1(limLog(pMac, LOG1,
2458 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. \n"));)
2459 limPostMsgApi(pMac, &msg);
2460}
2461#ifdef WLAN_SOFTAP_FEATURE
2462#if 0
2463void
2464limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2465{
2466 tSirMsgQ msg;
2467 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2468
2469 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2470 msg.bodyval = (tANI_U32)param;
2471 msg.bodyptr = NULL;
2472 PELOG1(limLog(pMac, LOG1,
2473 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. \n"));)
2474 limPostMsgApi(pMac, &msg);
2475}
2476#endif
2477#endif
Yathish9f22e662012-12-10 14:21:35 -08002478
2479#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2480/* ACTIVE_MODE_HB_OFFLOAD */
2481/**
2482 * limMissedBeaconInActiveMode()
2483 *
2484 *FUNCTION:
2485 * This function handle beacon miss indication from FW
2486 * in Active mode.
2487 *
2488 *LOGIC:
2489 *
2490 *ASSUMPTIONS:
2491 * NA
2492 *
2493 *NOTE:
2494 * NA
2495 *
2496 * @param param - Msg Type
2497 *
2498 * @return None
2499 */
2500void
2501limMissedBeaconInActiveMode(void *pMacGlobal)
2502{
2503 tANI_U32 statusCode;
2504 tSirMsgQ msg;
2505 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2506
2507 // Prepare and post message to LIM Message Queue
2508 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
2509 {
2510 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
2511 msg.bodyptr = NULL;
2512 msg.bodyval = 0;
2513 limLog(pMac, LOGE,
2514 FL("Heartbeat failure from Riva\n"));
2515 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2516 limLog(pMac, LOGE,
2517 FL("posting message %X to LIM failed, reason=%d\n"),
2518 msg.type, statusCode);
2519 }
2520}
2521#endif