blob: e3df2cb3c47d8ae0a8c8932246178c404062fa5f [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
Gopichand Nakkalad492d202013-05-10 02:50:47 +053074
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053075/* This timer is a periodic timer which expires at every 1 sec to
Gopichand Nakkalad492d202013-05-10 02:50:47 +053076 convert ACTIVE DFS channel to DFS channels */
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053077#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
Gopichand Nakkalad492d202013-05-10 02:50:47 +053078
Jeff Johnson295189b2012-06-20 16:38:30 -070079/**
80 * limCreateTimers()
81 *
82 *FUNCTION:
83 * This function is called upon receiving
84 * 1. SME_START_REQ for STA in ESS role
85 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
86 *
87 *LOGIC:
88 *
89 *ASSUMPTIONS:
90 * NA
91 *
92 *NOTE:
93 * NA
94 *
95 * @param pMac - Pointer to Global MAC structure
96 *
97 * @return None
98 */
99
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700100v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -0700101limCreateTimers(tpAniSirGlobal pMac)
102{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700103 tANI_U32 cfgValue, i=0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700104
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700105 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700106
107 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
108 &cfgValue) != eSIR_SUCCESS)
109 {
110 /**
111 * Could not get MinChannelTimeout value
112 * from CFG. Log error.
113 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700114 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700115 }
116 cfgValue = SYS_MS_TO_TICKS(cfgValue);
117
118 // Create MIN/MAX channel timers and activate them later
119 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
120 "MIN CHANNEL TIMEOUT",
121 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
122 cfgValue, 0,
123 TX_NO_ACTIVATE) != TX_SUCCESS)
124 {
125 /// Could not start min channel timer.
126 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700127 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700128 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700129 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700130 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700131
132 /* Periodic probe request timer value is half of the Min channel
133 * timer. Probe request sends periodically till min/max channel
134 * timer expires
135 */
136
137 cfgValue = cfgValue/2 ;
138 if( cfgValue >= 1)
139 {
140 // Create periodic probe request timer and activate them later
141 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
142 "Periodic Probe Request Timer",
143 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
144 cfgValue, 0,
145 TX_NO_ACTIVATE) != TX_SUCCESS)
146 {
147 /// Could not start Periodic Probe Req timer.
148 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700149 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700150 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700151 }
152 }
153
154
155 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
156 &cfgValue) != eSIR_SUCCESS)
157 {
158 /**
159 * Could not get MAXChannelTimeout value
160 * from CFG. Log error.
161 */
162 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700163 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700164 }
165 cfgValue = SYS_MS_TO_TICKS(cfgValue);
166
167 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
168 "MAX CHANNEL TIMEOUT",
169 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
170 cfgValue, 0,
171 TX_NO_ACTIVATE) != TX_SUCCESS)
172 {
173 /// Could not start max channel timer.
174 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700175 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700176
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700177 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700178 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700179 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700180
181 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
182 {
183 // Create Channel Switch Timer
184 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
185 "CHANNEL SWITCH TIMER",
186 limChannelSwitchTimerHandler,
187 0, // expiration_input
188 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
189 0, // reschedule_ticks
190 TX_NO_ACTIVATE) != TX_SUCCESS)
191 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700192 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700193 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700194 }
195
196 //
197 // Create Quiet Timer
198 // This is used on the STA to go and shut-off
199 // Tx/Rx "after" the specified quiteInterval
200 //
201 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
202 "QUIET TIMER",
203 limQuietTimerHandler,
204 SIR_LIM_QUIET_TIMEOUT, // expiration_input
205 LIM_QUIET_TIMER_TICKS, // initial_ticks
206 0, // reschedule_ticks
207 TX_NO_ACTIVATE) != TX_SUCCESS)
208 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700209 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700210 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700211 }
212
213 //
214 // Create Quiet BSS Timer
215 // After the specified quiteInterval, determined by
216 // gLimQuietTimer, this timer, gLimQuietBssTimer,
217 // trigger and put the STA to sleep for the specified
218 // gLimQuietDuration
219 //
220 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
221 "QUIET BSS TIMER",
222 limQuietBssTimerHandler,
223 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
224 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
225 0, // reschedule_ticks
226 TX_NO_ACTIVATE) != TX_SUCCESS)
227 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700228 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700229 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700230 }
231
232 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
233 &cfgValue) != eSIR_SUCCESS)
234 {
235 /**
236 * Could not get JoinFailureTimeout value
237 * from CFG. Log error.
238 */
239 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700240 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700241 }
242 cfgValue = SYS_MS_TO_TICKS(cfgValue);
243
244 // Create Join failure timer and activate it later
245 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
246 "JOIN FAILURE TIMEOUT",
247 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
248 cfgValue, 0,
249 TX_NO_ACTIVATE) != TX_SUCCESS)
250 {
251 /// Could not create Join failure timer.
252 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700253 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700254
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700255 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700256 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800257
Jeff Johnson62c27982013-02-27 17:53:55 -0800258 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800259 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
260 "Periodic Join Probe Request Timer",
261 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
262 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
263 TX_NO_ACTIVATE)) != TX_SUCCESS)
264 {
265 /// Could not create Periodic Join Probe Request timer.
266 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700267 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800268 goto err_timer;
269 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700270
271 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
272 &cfgValue) != eSIR_SUCCESS)
273 {
274 /**
275 * Could not get AssocFailureTimeout value
276 * from CFG. Log error.
277 */
278 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700279 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700280 }
281 cfgValue = SYS_MS_TO_TICKS(cfgValue);
282
283 // Create Association failure timer and activate it later
284 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
285 "ASSOC FAILURE TIMEOUT",
286 limAssocFailureTimerHandler, LIM_ASSOC,
287 cfgValue, 0,
288 TX_NO_ACTIVATE) != TX_SUCCESS)
289 {
290 /// Could not create Assoc failure timer.
291 // Log error
292 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700293 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700294
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700295 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700296 }
297 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
298 &cfgValue) != eSIR_SUCCESS)
299 {
300 /**
301 * Could not get ReassocFailureTimeout value
302 * from CFG. Log error.
303 */
304 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700305 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700306 }
307 cfgValue = SYS_MS_TO_TICKS(cfgValue);
308
309 // Create Association failure timer and activate it later
310 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
311 "REASSOC FAILURE TIMEOUT",
312 limAssocFailureTimerHandler, LIM_REASSOC,
313 cfgValue, 0,
314 TX_NO_ACTIVATE) != TX_SUCCESS)
315 {
316 /// Could not create Reassoc failure timer.
317 // Log error
318 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700319 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700320
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700321 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700322 }
323
324 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700325 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700326
327 cfgValue = SYS_MS_TO_TICKS(cfgValue);
328
329 // Create Addts response timer and activate it later
330 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
331 "ADDTS RSP TIMEOUT",
332 limAddtsResponseTimerHandler,
333 SIR_LIM_ADDTS_RSP_TIMEOUT,
334 cfgValue, 0,
335 TX_NO_ACTIVATE) != TX_SUCCESS)
336 {
337 /// Could not create Auth failure timer.
338 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700339 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700340
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700341 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700342 }
343
344 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
345 &cfgValue) != eSIR_SUCCESS)
346 {
347 /**
348 * Could not get AuthFailureTimeout value
349 * from CFG. Log error.
350 */
351 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700352 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700353 }
354 cfgValue = SYS_MS_TO_TICKS(cfgValue);
355
356 // Create Auth failure timer and activate it later
357 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
358 "AUTH FAILURE TIMEOUT",
359 limTimerHandler,
360 SIR_LIM_AUTH_FAIL_TIMEOUT,
361 cfgValue, 0,
362 TX_NO_ACTIVATE) != TX_SUCCESS)
363 {
364 /// Could not create Auth failure timer.
365 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700366 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700367
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700368 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700369 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800370
Jeff Johnson295189b2012-06-20 16:38:30 -0700371 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
372 &cfgValue) != eSIR_SUCCESS)
373 {
374 /**
375 * Could not get BEACON_INTERVAL value
376 * from CFG. Log error.
377 */
378 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700379 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700380 }
381 cfgValue = SYS_MS_TO_TICKS(cfgValue);
382
383 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
384 "Heartbeat TIMEOUT",
385 limTimerHandler,
386 SIR_LIM_HEART_BEAT_TIMEOUT,
387 cfgValue,
388 0,
389 TX_NO_ACTIVATE) != TX_SUCCESS)
390 {
391 /// Could not start Heartbeat timer.
392 // Log error
393 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700394 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700395 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700396 }
397
398 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
399 &cfgValue) != eSIR_SUCCESS)
400 {
401 /**
402 * Could not get PROBE_AFTER_HB_FAILURE
403 * value from CFG. Log error.
404 */
405 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700406 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700407 }
408
409 // Change timer to reactivate it in future
410 cfgValue = SYS_MS_TO_TICKS(cfgValue);
411
412 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
413 "Probe after Heartbeat TIMEOUT",
414 limTimerHandler,
415 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
416 cfgValue,
417 0,
418 TX_NO_ACTIVATE) != TX_SUCCESS)
419 {
420 // Could not creat wt-probe-after-HeartBeat-failure timer.
421 // Log error
422 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700423 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700424 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700425 }
426
Jeff Johnson295189b2012-06-20 16:38:30 -0700427 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,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700435 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700436 }
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,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700465 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700466 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700467 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800468#ifdef FEATURE_WLAN_TDLS_INTERNAL
Jeff Johnson62c27982013-02-27 17:53:55 -0800469 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800470 * create TDLS timers..
471 * a) TDLS discovery response timer.
Jeff Johnson62c27982013-02-27 17:53:55 -0800472 */
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800473
474 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
475 &cfgValue) != eSIR_SUCCESS)
476 {
477 /*
478 * Could not get discovery response Timeout value
479 * from CFG. Log error.
480 */
481 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700482 FL("could not retrieve ReassocFailureTimeout value"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800483 }
484 cfgValue = SYS_MS_TO_TICKS(cfgValue);
485
Jeff Johnson62c27982013-02-27 17:53:55 -0800486 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800487 * create TDLS discovery response wait timer and activate it later
488 */
489 if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer,
490 "TDLS discovery response WAIT",
491 limTimerHandler,
492 SIR_LIM_TDLS_DISCOVERY_RSP_WAIT,
493 cfgValue, 0,
494 TX_NO_ACTIVATE) != TX_SUCCESS)
495 {
496 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700497 FL("could not create TDLS discovery response wait timer"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800498 goto err_timer;
499 }
500#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700501 }
502
503
504 cfgValue = SYS_MS_TO_TICKS(LIM_HASH_MISS_TIMER_MS);
505
506 if (tx_timer_create(
507 &pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer,
508 "Disassoc throttle TIMEOUT",
509 limSendDisassocFrameThresholdHandler,
510 SIR_LIM_HASH_MISS_THRES_TIMEOUT,
511 cfgValue,
512 cfgValue,
513 TX_AUTO_ACTIVATE) != TX_SUCCESS)
514 {
515 /// Could not start Send Disassociate Frame Threshold timer.
516 // Log error
517 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700518 FL("create Disassociate throttle timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700519 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700520 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700521 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700522 FL("Created Disassociate throttle timer "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700523
524 /**
525 * Create keepalive timer and activate it right away for AP role
526 */
527
528 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
529 &cfgValue) != eSIR_SUCCESS)
530 {
531 /**
532 * Could not get keepalive timeout value
533 * from CFG. Log error.
534 */
535 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700536 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700537 }
538
539 // A value of zero implies keep alive should be disabled
540 if (cfgValue == 0)
541 {
542 cfgValue = LIM_KEEPALIVE_TIMER_MS;
543 pMac->sch.keepAlive = 0;
544 } else
545 pMac->sch.keepAlive = 1;
546
547
548 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
549
550 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
551 "KEEPALIVE_TIMEOUT",
552 limKeepaliveTmerHandler,
553 0,
554 cfgValue,
555 cfgValue,
556 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
557 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
558 != TX_SUCCESS)
559 {
560 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700561 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700562 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700563 }
564
565 /**
566 * Create all CNF_WAIT Timers upfront
567 */
568
569 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
570 &cfgValue) != eSIR_SUCCESS)
571 {
572 /**
573 * Could not get CNF_WAIT timeout value
574 * from CFG. Log error.
575 */
576 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700577 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700578 }
579 cfgValue = SYS_MS_TO_TICKS(cfgValue);
580
581 for (i=0; i<pMac->lim.maxStation; i++)
582 {
583 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
584 "CNF_MISS_TIMEOUT",
585 limCnfWaitTmerHandler,
586 (tANI_U32)i,
587 cfgValue,
588 0,
589 TX_NO_ACTIVATE) != TX_SUCCESS)
590 {
591 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700592 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700593 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700594 }
595 }
596
597 /*
598 ** Alloc and init table for the preAuth timer list
599 **
600 **/
601
602 // get max number of Preauthentication
603 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
604 &cfgValue) != eSIR_SUCCESS)
605 {
606 /*
607 ** Could not get max preauth value
608 ** from CFG. Log error.
609 **/
610 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700611 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700612 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700613 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530614 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_malloc(cfgValue*sizeof(tLimPreAuthNode));
615 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700616 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530617 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700618 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700619 }
620
621 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700622 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700623
624
Jeff Johnson295189b2012-06-20 16:38:30 -0700625 {
626 /**
627 * Create OLBC cache aging timer
628 */
629 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
630 &cfgValue) != eSIR_SUCCESS)
631 {
632 /**
633 * Could not get OLBC detect timeout value
634 * from CFG. Log error.
635 */
636 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700637 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700638 }
639
640 cfgValue = SYS_MS_TO_TICKS(cfgValue);
641
642 if (tx_timer_create(
643 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
644 "OLBC UPDATE CACHE TIMEOUT",
645 limUpdateOlbcCacheTimerHandler,
646 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
647 cfgValue,
648 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700649 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700650 {
651 // Cannot create update OLBC cache timer
652 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700653 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700654 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700655 }
656 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700657#ifdef WLAN_FEATURE_VOWIFI_11R
658 // In future we need to use the auth timer, cause
659 // the pre auth session will be introduced before sending
660 // Auth frame.
661 // We need to go off channel and come back to home channel
662 cfgValue = 1000;
663 cfgValue = SYS_MS_TO_TICKS(cfgValue);
664
665 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
666 "FT PREAUTH RSP TIMEOUT",
667 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
668 cfgValue, 0,
669 TX_NO_ACTIVATE) != TX_SUCCESS)
670 {
671 // Could not create Join failure timer.
672 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700673 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700674 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700675 }
676#endif
677
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700678#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700679 cfgValue = 5000;
680 cfgValue = SYS_MS_TO_TICKS(cfgValue);
681
682 if (tx_timer_create(&pMac->lim.limTimers.gLimCcxTsmTimer,
683 "CCX TSM Stats TIMEOUT",
684 limTimerHandler, SIR_LIM_CCX_TSM_TIMEOUT,
685 cfgValue, 0,
686 TX_NO_ACTIVATE) != TX_SUCCESS)
687 {
688 // Could not create Join failure timer.
689 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700690 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700691 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700692 }
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700693#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700694
Jeff Johnson295189b2012-06-20 16:38:30 -0700695 cfgValue = 1000;
696 cfgValue = SYS_MS_TO_TICKS(cfgValue);
697 if (tx_timer_create(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
698 "FT PREAUTH RSP TIMEOUT",
699 limTimerHandler, SIR_LIM_REMAIN_CHN_TIMEOUT,
700 cfgValue, 0,
701 TX_NO_ACTIVATE) != TX_SUCCESS)
702 {
703 // Could not create Join failure timer.
704 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700705 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700706 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700707 }
708
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800709
710 cfgValue = 1000;
711 cfgValue = SYS_MS_TO_TICKS(cfgValue);
712 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
713 "DISASSOC ACK TIMEOUT",
714 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
715 cfgValue, 0,
716 TX_NO_ACTIVATE) != TX_SUCCESS)
717 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700718 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800719 goto err_timer;
720 }
721
722 cfgValue = 1000;
723 cfgValue = SYS_MS_TO_TICKS(cfgValue);
724 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
725 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800726 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800727 cfgValue, 0,
728 TX_NO_ACTIVATE) != TX_SUCCESS)
729 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700730 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800731 goto err_timer;
732 }
Viral Modid86bde22012-12-10 13:09:21 -0800733
Viral Modid86bde22012-12-10 13:09:21 -0800734 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)
735 cfgValue = SYS_MS_TO_TICKS(cfgValue);
736 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
737 "Single Shot NOA Insert timeout",
738 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
739 cfgValue, 0,
740 TX_NO_ACTIVATE) != TX_SUCCESS)
741 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700742 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800743 goto err_timer;
744 }
Viral Modid86bde22012-12-10 13:09:21 -0800745
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530746 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
747 cfgValue = SYS_MS_TO_TICKS(cfgValue);
748 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
749 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
750 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
751 TX_NO_ACTIVATE) != TX_SUCCESS)
752 {
753 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
754 goto err_timer;
755 }
756
757
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700758 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700759
760 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800761 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800762 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800763 tx_timer_delete(&pMac->lim.limTimers.gLimRemainOnChannelTimer);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700764#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700765 tx_timer_delete(&pMac->lim.limTimers.gLimCcxTsmTimer);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700766#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700767 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
768 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
769 while(((tANI_S32)--i) >= 0)
770 {
771 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
772 }
773 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
774 tx_timer_delete(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer);
775 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
776 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
777 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
778 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
779 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
780 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
781 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800782 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800783 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700784 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
785 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
786 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
787 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
788 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
789 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800790 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530791 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700792
793 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530794 vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700795
796 return TX_TIMER_ERROR;
797
Jeff Johnson295189b2012-06-20 16:38:30 -0700798} /****** end limCreateTimers() ******/
799
800
801
802/**
803 * limTimerHandler()
804 *
805 *FUNCTION:
806 * This function is called upon
807 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
808 * 2. JOIN_FAILURE timer expiration while joining a BSS
809 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
810 * 4. Heartbeat timer expiration on STA
811 * 5. Background scan timer expiration on STA
812 * 6. AID release, Pre-auth cleanup and Link monitoring timer
813 * expiration on AP
814 *
815 *LOGIC:
816 *
817 *ASSUMPTIONS:
818 * NA
819 *
820 *NOTE:
821 * NA
822 *
823 * @param param - Message corresponding to the timer that expired
824 *
825 * @return None
826 */
827
828void
829limTimerHandler(void *pMacGlobal, tANI_U32 param)
830{
831 tANI_U32 statusCode;
832 tSirMsgQ msg;
833 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
834
835 // Prepare and post message to LIM Message Queue
836
837 msg.type = (tANI_U16) param;
838 msg.bodyptr = NULL;
839 msg.bodyval = 0;
840
841 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
842 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700843 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700844 msg.type, statusCode);
845} /****** end limTimerHandler() ******/
846
847
848/**
849 * limAddtsResponseTimerHandler()
850 *
851 *FUNCTION:
852 * This function is called upon Addts response timer expiration on sta
853 *
854 *LOGIC:
855 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
856 * when this function is executed.
857 *
858 *ASSUMPTIONS:
859 * NA
860 *
861 *NOTE:
862 * NA
863 *
864 * @param param - pointer to pre-auth node
865 *
866 * @return None
867 */
868
869void
870limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
871{
872 tSirMsgQ msg;
873 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
874
875 // Prepare and post message to LIM Message Queue
876
877 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
878 msg.bodyval = param;
879 msg.bodyptr = NULL;
880
881 limPostMsgApi(pMac, &msg);
882} /****** end limAuthResponseTimerHandler() ******/
883
884
885/**
886 * limAuthResponseTimerHandler()
887 *
888 *FUNCTION:
889 * This function is called upon Auth response timer expiration on AP
890 *
891 *LOGIC:
892 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
893 * when this function is executed.
894 *
895 *ASSUMPTIONS:
896 * NA
897 *
898 *NOTE:
899 * NA
900 *
901 * @param param - pointer to pre-auth node
902 *
903 * @return None
904 */
905
906void
907limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
908{
909 tSirMsgQ msg;
910 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
911
912 // Prepare and post message to LIM Message Queue
913
914 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
915 msg.bodyptr = NULL;
916 msg.bodyval = (tANI_U32)param;
917
918 limPostMsgApi(pMac, &msg);
919} /****** end limAuthResponseTimerHandler() ******/
920
921
922
923/**
924 * limAssocFailureTimerHandler()
925 *
926 *FUNCTION:
927 * This function is called upon Re/Assoc failure timer expiration
928 * on STA
929 *
930 *LOGIC:
931 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
932 * when this function is executed.
933 *
934 *ASSUMPTIONS:
935 * NA
936 *
937 *NOTE:
938 * NA
939 *
940 * @param param - Indicates whether this is assoc or reassoc
941 * failure timeout
942 * @return None
943 */
944
945void
946limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
947{
948 tSirMsgQ msg;
949 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
950
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700951#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
952 if((LIM_REASSOC == param) &&
953 (NULL != pMac->lim.pSessionEntry))
954 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700955 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700956 if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
957 {
958 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
959 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700960 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700961 return;
962 }
963 else
964 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700965 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700966 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
967 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530968 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700969 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
970 }
971 }
972 }
973#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700974 // Prepare and post message to LIM Message Queue
975
976 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
977 msg.bodyval = (tANI_U32)param;
978 msg.bodyptr = NULL;
979
980 limPostMsgApi(pMac, &msg);
981} /****** end limAssocFailureTimerHandler() ******/
982
983
984/**
985 * limUpdateOlbcCacheTimerHandler()
986 *
987 *FUNCTION:
988 * This function is called upon update olbc cache timer expiration
989 * on STA
990 *
991 *LOGIC:
992 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
993 * when this function is executed.
994 *
995 *ASSUMPTIONS:
996 * NA
997 *
998 *NOTE:
999 * NA
1000 *
1001 * @param
1002 *
1003 * @return None
1004 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001005void
1006limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
1007{
1008 tSirMsgQ msg;
1009 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
1010
1011 // Prepare and post message to LIM Message Queue
1012
1013 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
1014 msg.bodyval = 0;
1015 msg.bodyptr = NULL;
1016
1017 limPostMsgApi(pMac, &msg);
1018} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -07001019
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,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001058 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001059 }
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,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001069 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001070 }
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);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001090 if (pMac->btc.btcScanCompromise)
1091 {
1092 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1093 {
1094 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1095 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1096 }
1097 else
1098 {
1099 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1100 }
1101 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001102 }
1103 else
1104 {
1105 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1106 //No need to change min timer. This is not a scan
1107 break;
1108 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001109#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001110 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001111#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001112
1113 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1114 val, 0) != TX_SUCCESS)
1115 {
1116 // Could not change min channel timer.
1117 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001118 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001119 }
1120
1121 break;
1122
1123 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1124 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1125 != TX_SUCCESS)
1126 {
1127 // Could not deactivate min channel timer.
1128 // Log error
1129 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001130 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001131 }
1132
1133 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001134 if (pMac->btc.btcScanCompromise)
1135 {
1136 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1137 {
1138 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1139 }
1140 else
1141 {
1142 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1143 }
1144 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001145 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1146 val, 0) != TX_SUCCESS)
1147 {
1148 // Could not change min channel timer.
1149 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001150 limLog(pMac, LOGP, FL("Unable to change periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001151 }
1152
1153 break;
1154
1155 case eLIM_MAX_CHANNEL_TIMER:
1156 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1157 != TX_SUCCESS)
1158 {
1159 // Could not deactivate max channel timer.
1160 // Log error
1161 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001162 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001163 }
1164
Jeff Johnson295189b2012-06-20 16:38:30 -07001165 // If a background was triggered via Quiet BSS,
1166 // then we need to adjust the MIN and MAX channel
1167 // timer's accordingly to the Quiet duration that
1168 // was specified
1169 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1170 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001171#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001172
1173 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1174 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1175 {
1176 // gLimQuietDuration is already cached in units of
1177 // system ticks. No conversion is reqd...
1178 val = pMac->lim.gLimSpecMgmt.quietDuration;
1179 }
1180 else
1181 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001182#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001183 if(pMac->lim.gpLimMlmScanReq)
1184 {
1185 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001186 if (pMac->btc.btcScanCompromise)
1187 {
1188 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1189 {
1190 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1191 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1192 }
1193 else
1194 {
1195 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1196 }
1197 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001198 }
1199 else
1200 {
1201 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1202 //No need to change max timer. This is not a scan
1203 break;
1204 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001205#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001206 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001207#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001208 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001209
1210 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1211 val, 0) != TX_SUCCESS)
1212 {
1213 // Could not change max channel timer.
1214 // Log error
1215 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001216 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001217 }
1218
1219 break;
1220
1221 case eLIM_JOIN_FAIL_TIMER:
1222 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1223 != TX_SUCCESS)
1224 {
1225 /**
1226 * Could not deactivate Join Failure
1227 * timer. Log error.
1228 */
1229 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001230 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 }
1232
1233 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1234 &val) != eSIR_SUCCESS)
1235 {
1236 /**
1237 * Could not get JoinFailureTimeout value
1238 * from CFG. Log error.
1239 */
1240 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001241 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001242 }
1243 val = SYS_MS_TO_TICKS(val);
1244
1245 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1246 val, 0) != TX_SUCCESS)
1247 {
1248 /**
1249 * Could not change Join Failure
1250 * timer. Log error.
1251 */
1252 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001253 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 }
1255
1256 break;
1257
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001258 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1259 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1260 != TX_SUCCESS)
1261 {
1262 // Could not deactivate periodic join req Times.
1263 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001264 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001265 }
1266
1267 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1268 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1269 val, 0) != TX_SUCCESS)
1270 {
1271 // Could not change periodic join req times.
1272 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001273 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001274 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001275
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001276 break;
1277
Jeff Johnson295189b2012-06-20 16:38:30 -07001278 case eLIM_AUTH_FAIL_TIMER:
1279 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1280 != TX_SUCCESS)
1281 {
1282 // Could not deactivate Auth failure timer.
1283 // Log error
1284 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001285 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001286 }
1287
1288 // Change timer to reactivate it in future
1289 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1290 &val) != eSIR_SUCCESS)
1291 {
1292 /**
1293 * Could not get AuthFailureTimeout value
1294 * from CFG. Log error.
1295 */
1296 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001297 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001298 }
1299 val = SYS_MS_TO_TICKS(val);
1300
1301 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1302 val, 0) != TX_SUCCESS)
1303 {
1304 // Could not change Authentication failure timer.
1305 // Log error
1306 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001307 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001308 }
1309
1310 break;
1311
1312 case eLIM_ASSOC_FAIL_TIMER:
1313 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1314 TX_SUCCESS)
1315 {
1316 // Could not deactivate Association failure timer.
1317 // Log error
1318 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001319 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001320 }
1321
1322 // Change timer to reactivate it in future
1323 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1324 &val) != eSIR_SUCCESS)
1325 {
1326 /**
1327 * Could not get AssocFailureTimeout value
1328 * from CFG. Log error.
1329 */
1330 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001331 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001332 }
1333 val = SYS_MS_TO_TICKS(val);
1334
1335 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1336 val, 0) != TX_SUCCESS)
1337 {
1338 // Could not change Association failure timer.
1339 // Log error
1340 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001341 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001342 }
1343
1344 break;
1345
1346 case eLIM_REASSOC_FAIL_TIMER:
1347 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1348 TX_SUCCESS)
1349 {
1350 // Could not deactivate Reassociation failure timer.
1351 // Log error
1352 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001353 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001354 }
1355
1356 // Change timer to reactivate it in future
1357 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1358 &val) != eSIR_SUCCESS)
1359 {
1360 /**
1361 * Could not get ReassocFailureTimeout value
1362 * from CFG. Log error.
1363 */
1364 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001365 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001366 }
1367 val = SYS_MS_TO_TICKS(val);
1368
1369 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1370 val, 0) != TX_SUCCESS)
1371 {
1372 // Could not change Reassociation failure timer.
1373 // Log error
1374 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001375 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 }
1377
1378 break;
1379
1380 case eLIM_HEART_BEAT_TIMER:
1381 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1382 TX_SUCCESS)
1383 {
1384 // Could not deactivate Heartbeat timer.
1385 // Log error
1386 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001387 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001388 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001389 else
1390 {
1391 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1392 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001393
1394 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1395 &val) != eSIR_SUCCESS)
1396 {
1397 /**
1398 * Could not get BEACON_INTERVAL value
1399 * from CFG. Log error.
1400 */
1401 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001402 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001403 }
1404
1405 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1406 eSIR_SUCCESS)
1407 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001408 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001409
1410 // Change timer to reactivate it in future
1411 val = SYS_MS_TO_TICKS(val * val1);
1412
1413 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1414 val, 0) != TX_SUCCESS)
1415 {
1416 // Could not change HeartBeat timer.
1417 // Log error
1418 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001419 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001420 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001421 else
1422 {
1423 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %lu"), val);
1424 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001425 break;
1426
1427 case eLIM_PROBE_AFTER_HB_TIMER:
1428 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1429 TX_SUCCESS)
1430 {
1431 // Could not deactivate Heartbeat timer.
1432 // Log error
1433 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001434 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001435 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001436 else
1437 {
1438 limLog(pMac, LOGE, FL("Deactivated probe after hb timer"));
1439 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001440
1441 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1442 &val) != eSIR_SUCCESS)
1443 {
1444 /**
1445 * Could not get PROBE_AFTER_HB_FAILURE
1446 * value from CFG. Log error.
1447 */
1448 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001449 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001450 }
1451
1452 // Change timer to reactivate it in future
1453 val = SYS_MS_TO_TICKS(val);
1454
1455 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1456 val, 0) != TX_SUCCESS)
1457 {
1458 // Could not change HeartBeat timer.
1459 // Log error
1460 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001461 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001462 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001463 else
1464 {
1465 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %lu"), val);
1466 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001467
1468 break;
1469
1470 case eLIM_KEEPALIVE_TIMER:
1471 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1472 != TX_SUCCESS)
1473 {
1474 // Could not deactivate Keepalive timer.
1475 // Log error
1476 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001477 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001478 }
1479
1480 // Change timer to reactivate it in future
1481
1482 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1483 &val) != eSIR_SUCCESS)
1484 {
1485 /**
1486 * Could not get keepalive timeout value
1487 * from CFG. Log error.
1488 */
1489 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001490 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001491 }
1492 if (val == 0)
1493 {
1494 val = 3000;
1495 pMac->sch.keepAlive = 0;
1496 } else
1497 pMac->sch.keepAlive = 1;
1498
1499
1500
1501 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1502
1503 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1504 val, val) != TX_SUCCESS)
1505 {
1506 // Could not change KeepaliveTimer timer.
1507 // Log error
1508 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001509 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001510 }
1511
1512 break;
1513
Jeff Johnson295189b2012-06-20 16:38:30 -07001514 case eLIM_BACKGROUND_SCAN_TIMER:
1515 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1516 != TX_SUCCESS)
1517 {
1518 // Could not deactivate BackgroundScanTimer timer.
1519 // Log error
1520 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001521 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001522 }
1523
1524 // Change timer to reactivate it in future
1525 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1526 &val) != eSIR_SUCCESS)
1527 {
1528 /**
1529 * Could not get Background scan period value
1530 * from CFG. Log error.
1531 */
1532 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001533 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001534 }
1535 if (val == 0)
1536 {
1537 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1538 pMac->lim.gLimBackgroundScanDisable = true;
1539 }
1540 else
1541 pMac->lim.gLimBackgroundScanDisable = false;
1542
1543 val = SYS_MS_TO_TICKS(val);
1544
1545 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1546 val, val) != TX_SUCCESS)
1547 {
1548 // Could not change BackgroundScanTimer timer.
1549 // Log error
1550 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001551 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001552 }
1553
1554 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001555
Jeff Johnsone7245742012-09-05 17:12:55 -07001556#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001557 case eLIM_CHANNEL_SWITCH_TIMER:
1558 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1559 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001560 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001561 return;
1562 }
1563
1564 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1565 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1566 0) != TX_SUCCESS)
1567 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001568 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001569 return;
1570 }
1571 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001572#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001573
1574 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001575 break;
1576
Jeff Johnsone7245742012-09-05 17:12:55 -07001577#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001578 case eLIM_QUIET_BSS_TIMER:
1579 if (TX_SUCCESS !=
1580 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1581 {
1582 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001583 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001584 }
1585
1586 // gLimQuietDuration appears to be in units of ticks
1587 // Use it as is
1588 if (TX_SUCCESS !=
1589 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1590 pMac->lim.gLimSpecMgmt.quietDuration,
1591 0))
1592 {
1593 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001594 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001595 }
1596 break;
1597
1598 case eLIM_QUIET_TIMER:
1599 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1600 {
1601 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001602 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001603 }
1604
1605 // Set the NEW timeout value, in ticks
1606 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1607 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1608 {
1609 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001610 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001611 }
1612 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001613#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001614
Jeff Johnson295189b2012-06-20 16:38:30 -07001615#if 0
1616 case eLIM_WPS_OVERLAP_TIMER:
1617 {
1618 // Restart Learn Interval timer
1619
1620 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1621
1622 if (tx_timer_deactivate(
1623 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1624 {
1625 // Could not deactivate Learn Interval timer.
1626 // Log error
1627 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001628 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001629 }
1630
1631 if (tx_timer_change(
1632 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1633 WPSOverlapTimer, 0) != TX_SUCCESS)
1634 {
1635 // Could not change Learn Interval timer.
1636 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001637 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001638
1639 return;
1640 }
1641
1642 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001643 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001644 WPSOverlapTimer);
1645 }
1646 break;
1647#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001648
1649#ifdef WLAN_FEATURE_VOWIFI_11R
1650 case eLIM_FT_PREAUTH_RSP_TIMER:
1651 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1652 {
1653 /**
1654 ** Could not deactivate Join Failure
1655 ** timer. Log error.
1656 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001657 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001658 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001659 }
1660 val = 1000;
1661 val = SYS_MS_TO_TICKS(val);
1662 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1663 val, 0) != TX_SUCCESS)
1664 {
1665 /**
1666 * Could not change Join Failure
1667 * timer. Log error.
1668 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001669 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001670 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001671 }
1672 break;
1673#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001674#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001675 case eLIM_TSM_TIMER:
1676 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer)
1677 != TX_SUCCESS)
1678 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001679 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001680 }
1681 break;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001682#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001683 case eLIM_REMAIN_CHN_TIMER:
1684 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS)
1685 {
1686 /**
1687 ** Could not deactivate Join Failure
1688 ** timer. Log error.
1689 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001690 limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001691 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001692 }
1693 val = 1000;
1694 val = SYS_MS_TO_TICKS(val);
1695 if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
1696 val, 0) != TX_SUCCESS)
1697 {
1698 /**
1699 * Could not change Join Failure
1700 * timer. Log error.
1701 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001702 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001703 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001704 }
1705 break;
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301706
1707 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1708 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1709 {
1710 /**
1711 ** Could not deactivate Active to passive channel timer.
1712 ** Log error.
1713 **/
1714 limLog(pMac, LOGP, FL("Unable to Deactivate "
1715 "Active to passive channel timer"));
1716 return;
1717 }
1718 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1719 val = SYS_MS_TO_TICKS(val);
1720 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1721 val, 0) != TX_SUCCESS)
1722 {
1723 /**
1724 * Could not change timer to check scan type for passive channel.
1725 * timer. Log error.
1726 */
1727 limLog(pMac, LOGP, FL("Unable to change timer"));
1728 return;
1729 }
1730 break;
1731
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001732 case eLIM_DISASSOC_ACK_TIMER:
1733 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1734 {
1735 /**
1736 ** Could not deactivate Join Failure
1737 ** timer. Log error.
1738 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001739 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001740 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001741 }
1742 val = 1000;
1743 val = SYS_MS_TO_TICKS(val);
1744 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1745 val, 0) != TX_SUCCESS)
1746 {
1747 /**
1748 * Could not change Join Failure
1749 * timer. Log error.
1750 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001751 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001752 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001753 }
1754 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001755
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001756 case eLIM_DEAUTH_ACK_TIMER:
1757 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1758 {
1759 /**
1760 ** Could not deactivate Join Failure
1761 ** timer. Log error.
1762 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001763 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001764 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001765 }
1766 val = 1000;
1767 val = SYS_MS_TO_TICKS(val);
1768 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1769 val, 0) != TX_SUCCESS)
1770 {
1771 /**
1772 * Could not change Join Failure
1773 * timer. Log error.
1774 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001775 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001776 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001777 }
1778 break;
Viral Modid86bde22012-12-10 13:09:21 -08001779
Viral Modid86bde22012-12-10 13:09:21 -08001780 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1781 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1782 {
1783 /**
1784 ** Could not deactivate SingleShot NOA Insert
1785 ** timer. Log error.
1786 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001787 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001788 return;
1789 }
1790 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1791 val = SYS_MS_TO_TICKS(val);
1792 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1793 val, 0) != TX_SUCCESS)
1794 {
1795 /**
1796 * Could not change Single Shot NOA Insert
1797 * timer. Log error.
1798 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001799 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001800 return;
1801 }
1802 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001803
Jeff Johnson295189b2012-06-20 16:38:30 -07001804 default:
1805 // Invalid timerId. Log error
1806 break;
1807 }
1808} /****** end limDeactivateAndChangeTimer() ******/
1809
1810
1811
1812/**---------------------------------------------------------------
1813\fn limHeartBeatDeactivateAndChangeTimer
1814\brief This function deactivates and changes the heart beat
1815\ timer, eLIM_HEART_BEAT_TIMER.
1816\
1817\param pMac
1818\param psessionEntry
1819\return None
1820------------------------------------------------------------------*/
1821void
1822limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1823{
Ravi Joshid0699502013-07-08 15:48:47 -07001824 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001825
Ravi Joshid0699502013-07-08 15:48:47 -07001826 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001827#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001828 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1829 return;
Yathish9f22e662012-12-10 14:21:35 -08001830#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001831
Ravi Joshid0699502013-07-08 15:48:47 -07001832 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1833 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001834
Ravi Joshid0699502013-07-08 15:48:47 -07001835 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1836 changing. to avoid this problem, HeartBeat interval is made constant, by
1837 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001838
Ravi Joshid0699502013-07-08 15:48:47 -07001839 //val = psessionEntry->beaconParams.beaconInterval;
1840 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001841
Ravi Joshid0699502013-07-08 15:48:47 -07001842 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1843 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001844
Ravi Joshid0699502013-07-08 15:48:47 -07001845 PELOGW(limLog(pMac,LOGW,
1846 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1847 val1, psessionEntry->beaconParams.beaconInterval,
1848 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001849
Ravi Joshid0699502013-07-08 15:48:47 -07001850 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1851 * enough to judge the peer device inactivity when 32 peers are connected.
1852 * Hence increasing the HB timer timeout to
1853 * HBtimeout = (TBTT * num_beacons * num_peers)
1854 */
1855 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1856 pMac->lim.gLimNumIbssPeers > 0)
1857 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001858 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001859 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001860
Ravi Joshid0699502013-07-08 15:48:47 -07001861 // Change timer to reactivate it in future
1862 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001863
Ravi Joshid0699502013-07-08 15:48:47 -07001864 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1865 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001866
1867} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1868
1869
1870/**---------------------------------------------------------------
1871\fn limReactivateHeartBeatTimer
1872\brief This function s called to deactivate, change and
1873\ activate a timer.
1874\
1875\param pMac - Pointer to Global MAC structure
1876\param psessionEntry
1877\return None
1878------------------------------------------------------------------*/
1879void
1880limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1881{
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001882 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001883
Yathish9f22e662012-12-10 14:21:35 -08001884#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1885 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001886 {
1887 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001888 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001889 }
Yathish9f22e662012-12-10 14:21:35 -08001890#endif
1891
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001893 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001894
1895 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001896 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1897 {
1898 /*
1899 * There is increasing need to limit the apps wakeup due to WLAN
1900 * activity. During HB monitoring, the beacons from peer are sent to
1901 * the host causing the host to wakeup. Hence, offloading the HB
1902 * monitoring to LMAC
1903 */
1904 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1905 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1906 {
1907 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1908 {
1909 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1910 }
1911 else
1912 {
1913 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1914 }
1915 }
1916 else
1917 {
1918 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1919 {
1920 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1921 }
1922 else
1923 {
1924 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1925 }
1926 }
1927 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001928 }
1929
1930} /****** end limReactivateHeartBeatTimer() ******/
1931
Jeff Johnson295189b2012-06-20 16:38:30 -07001932
1933/**
1934 * limActivateHearBeatTimer()
1935 *
1936 *
1937 * @brief: This function is called to activate heartbeat timer
1938 *
1939 *LOGIC:
1940 *
1941 *ASSUMPTIONS:
1942 * NA
1943 *
1944 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1945 *
1946 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001947 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001948 *
1949 * @return TX_SUCCESS - timer is activated
1950 * errors - fail to start the timer
1951 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001952v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001953{
1954 v_UINT_t status = TX_TIMER_ERROR;
1955
Yathish9f22e662012-12-10 14:21:35 -08001956#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1957 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001958 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001959#endif
1960
Jeff Johnson295189b2012-06-20 16:38:30 -07001961 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1962 {
1963 //consider 0 interval a ok case
1964 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1965 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001966 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1967 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1968 {
1969 /* HB offload in IBSS mode */
1970 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1971 if (TX_SUCCESS != status)
1972 {
1973 PELOGE(limLog(pMac, LOGE,
1974 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1975 status);)
1976 }
1977 else
1978 {
1979 PELOGE(limLog(pMac, LOGE,
1980 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
1981 __func__);)
1982 }
1983
1984 }
1985 else
1986 {
1987 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1988 if ( TX_SUCCESS != status )
1989 {
1990 PELOGE(limLog(pMac, LOGE,
1991 FL("could not activate Heartbeat timer status(%d)"), status);)
1992 }
1993 else
1994 {
1995 PELOGE(limLog(pMac, LOGW,
1996 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
1997 }
1998 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001999 }
2000 else
2001 {
2002 status = TX_SUCCESS;
2003 }
2004 }
2005
2006 return (status);
2007}
2008
2009
2010
2011/**
2012 * limDeactivateAndChangePerStaIdTimer()
2013 *
2014 *
2015 * @brief: This function is called to deactivate and change a per STA timer
2016 * for future re-activation
2017 *
2018 *LOGIC:
2019 *
2020 *ASSUMPTIONS:
2021 * NA
2022 *
2023 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2024 *
2025 * @param pMac - Pointer to Global MAC structure
2026 * @param timerId - enum of timer to be deactivated and changed
2027 * This enum is defined in limUtils.h file
2028 * @param staId - staId
2029 *
2030 * @return None
2031 */
2032
2033void
2034limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2035{
2036 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07002037 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07002038
2039 switch (timerId)
2040 {
2041 case eLIM_CNF_WAIT_TIMER:
2042
2043 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2044 != TX_SUCCESS)
2045 {
2046 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002047 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002048
2049 }
2050
2051 // Change timer to reactivate it in future
2052
2053 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2054 &val) != eSIR_SUCCESS)
2055 {
2056 /**
2057 * Could not get cnf timeout value
2058 * from CFG. Log error.
2059 */
2060 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002061 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002062 }
2063 val = SYS_MS_TO_TICKS(val);
2064
2065 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2066 val, val) != TX_SUCCESS)
2067 {
2068 // Could not change cnf timer.
2069 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002070 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002071 }
2072
2073 break;
2074
2075 case eLIM_AUTH_RSP_TIMER:
2076 {
2077 tLimPreAuthNode *pAuthNode;
2078
2079 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2080
2081 if (pAuthNode == NULL)
2082 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002083 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002084 break;
2085 }
2086
2087 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2088 {
2089 // Could not deactivate auth response timer.
2090 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002091 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002092 }
2093
2094 // Change timer to reactivate it in future
2095
2096 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2097 {
2098 /**
2099 * Could not get auth rsp timeout value
2100 * from CFG. Log error.
2101 */
2102 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002103 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002104 }
2105
2106 val = SYS_MS_TO_TICKS(val);
2107
2108 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2109 {
2110 // Could not change auth rsp timer.
2111 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002112 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002113 }
2114 }
2115 break;
2116
Jeff Johnson295189b2012-06-20 16:38:30 -07002117
2118 default:
2119 // Invalid timerId. Log error
2120 break;
2121
2122 }
2123}
2124
2125
2126/**
2127 * limActivateCnfTimer()
2128 *
2129 *FUNCTION:
2130 * This function is called to activate a per STA timer
2131 *
2132 *LOGIC:
2133 *
2134 *ASSUMPTIONS:
2135 * NA
2136 *
2137 *NOTE:
2138 * NA
2139 *
2140 * @param pMac - Pointer to Global MAC structure
2141 * @param StaId - staId
2142 *
2143 * @return None
2144 */
2145
2146void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2147{
Jeff Johnsone7245742012-09-05 17:12:55 -07002148 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002149 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2150 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2151 != TX_SUCCESS)
2152 {
2153 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002154 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002155 }
2156}
2157
2158/**
2159 * limActivateAuthRspTimer()
2160 *
2161 *FUNCTION:
2162 * This function is called to activate a per STA timer
2163 *
2164 *LOGIC:
2165 *
2166 *ASSUMPTIONS:
2167 * NA
2168 *
2169 *NOTE:
2170 * NA
2171 *
2172 * @param pMac - Pointer to Global MAC structure
2173 * @param id - id
2174 *
2175 * @return None
2176 */
2177
2178void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2179{
Jeff Johnsone7245742012-09-05 17:12:55 -07002180 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002181 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2182 {
2183 /// Could not activate auth rsp timer.
2184 // Log error
2185 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002186 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002187 }
2188}
2189
2190
2191/**
2192 * limSendDisassocFrameThresholdHandler()
2193 *
2194 *FUNCTION:
2195 * This function reloads the credit to the send disassociate frame bucket
2196 *
2197 *LOGIC:
2198 *
2199 *ASSUMPTIONS:
2200 *
2201 *NOTE:
2202 * NA
2203 *
2204 * @param
2205 *
2206 * @return None
2207 */
2208
2209void
2210limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param)
2211{
2212 tSirMsgQ msg;
2213 tANI_U32 statusCode;
2214 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2215
2216 msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT;
2217 msg.bodyval = 0;
2218 msg.bodyptr = NULL;
2219
2220 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2221 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002222 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002223
2224}
2225
2226/**
2227 * limAssocCnfWaitTmerHandler()
2228 *
2229 *FUNCTION:
2230 * This function post a message to send a disassociate frame out.
2231 *
2232 *LOGIC:
2233 *
2234 *ASSUMPTIONS:
2235 *
2236 *NOTE:
2237 * NA
2238 *
2239 * @param
2240 *
2241 * @return None
2242 */
2243
2244void
2245limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2246{
2247 tSirMsgQ msg;
2248 tANI_U32 statusCode;
2249 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2250
2251 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2252 msg.bodyval = (tANI_U32)param;
2253 msg.bodyptr = NULL;
2254
2255 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2256 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002257 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002258
2259}
2260
2261/**
2262 * limKeepaliveTmerHandler()
2263 *
2264 *FUNCTION:
2265 * This function post a message to send a NULL data frame.
2266 *
2267 *LOGIC:
2268 *
2269 *ASSUMPTIONS:
2270 *
2271 *NOTE:
2272 * NA
2273 *
2274 * @param
2275 *
2276 * @return None
2277 */
2278
2279void
2280limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2281{
2282 tSirMsgQ msg;
2283 tANI_U32 statusCode;
2284 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2285
2286 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2287 msg.bodyval = (tANI_U32)param;
2288 msg.bodyptr = NULL;
2289
2290 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2291 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002292 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002293
2294}
2295
2296void
2297limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2298{
2299 tSirMsgQ msg;
2300 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2301
2302 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002303 FL("ChannelSwitch Timer expired. Posting msg to LIM "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002304
2305 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2306 msg.bodyval = (tANI_U32)param;
2307 msg.bodyptr = NULL;
2308
2309 limPostMsgApi(pMac, &msg);
2310}
2311
2312void
2313limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2314{
2315 tSirMsgQ msg;
2316 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2317
2318 msg.type = SIR_LIM_QUIET_TIMEOUT;
2319 msg.bodyval = (tANI_U32)param;
2320 msg.bodyptr = NULL;
2321
2322 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002323 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002324 limPostMsgApi(pMac, &msg);
2325}
2326
2327void
2328limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2329{
2330 tSirMsgQ msg;
2331 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2332
2333 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2334 msg.bodyval = (tANI_U32)param;
2335 msg.bodyptr = NULL;
2336 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002337 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002338 limPostMsgApi(pMac, &msg);
2339}
Jeff Johnson295189b2012-06-20 16:38:30 -07002340#if 0
2341void
2342limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2343{
2344 tSirMsgQ msg;
2345 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2346
2347 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2348 msg.bodyval = (tANI_U32)param;
2349 msg.bodyptr = NULL;
2350 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002351 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002352 limPostMsgApi(pMac, &msg);
2353}
2354#endif
Yathish9f22e662012-12-10 14:21:35 -08002355
2356#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2357/* ACTIVE_MODE_HB_OFFLOAD */
2358/**
2359 * limMissedBeaconInActiveMode()
2360 *
2361 *FUNCTION:
2362 * This function handle beacon miss indication from FW
2363 * in Active mode.
2364 *
2365 *LOGIC:
2366 *
2367 *ASSUMPTIONS:
2368 * NA
2369 *
2370 *NOTE:
2371 * NA
2372 *
2373 * @param param - Msg Type
2374 *
2375 * @return None
2376 */
2377void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002378limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002379{
2380 tANI_U32 statusCode;
2381 tSirMsgQ msg;
2382 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2383
2384 // Prepare and post message to LIM Message Queue
2385 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002386 {
Yathish9f22e662012-12-10 14:21:35 -08002387 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002388 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002389 msg.bodyval = 0;
2390 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002391 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002392 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2393 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002394 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002395 msg.type, statusCode);
2396 }
2397}
2398#endif