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