blob: 6dce2103e4b1186787842c01d88d9bf088455e4f [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)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800794 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530795 vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800796 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
797 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700798
799 return TX_TIMER_ERROR;
800
Jeff Johnson295189b2012-06-20 16:38:30 -0700801} /****** end limCreateTimers() ******/
802
803
804
805/**
806 * limTimerHandler()
807 *
808 *FUNCTION:
809 * This function is called upon
810 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
811 * 2. JOIN_FAILURE timer expiration while joining a BSS
812 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
813 * 4. Heartbeat timer expiration on STA
814 * 5. Background scan timer expiration on STA
815 * 6. AID release, Pre-auth cleanup and Link monitoring timer
816 * expiration on AP
817 *
818 *LOGIC:
819 *
820 *ASSUMPTIONS:
821 * NA
822 *
823 *NOTE:
824 * NA
825 *
826 * @param param - Message corresponding to the timer that expired
827 *
828 * @return None
829 */
830
831void
832limTimerHandler(void *pMacGlobal, tANI_U32 param)
833{
834 tANI_U32 statusCode;
835 tSirMsgQ msg;
836 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
837
838 // Prepare and post message to LIM Message Queue
839
840 msg.type = (tANI_U16) param;
841 msg.bodyptr = NULL;
842 msg.bodyval = 0;
843
844 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
845 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700846 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700847 msg.type, statusCode);
848} /****** end limTimerHandler() ******/
849
850
851/**
852 * limAddtsResponseTimerHandler()
853 *
854 *FUNCTION:
855 * This function is called upon Addts response timer expiration on sta
856 *
857 *LOGIC:
858 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
859 * when this function is executed.
860 *
861 *ASSUMPTIONS:
862 * NA
863 *
864 *NOTE:
865 * NA
866 *
867 * @param param - pointer to pre-auth node
868 *
869 * @return None
870 */
871
872void
873limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
874{
875 tSirMsgQ msg;
876 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
877
878 // Prepare and post message to LIM Message Queue
879
880 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
881 msg.bodyval = param;
882 msg.bodyptr = NULL;
883
884 limPostMsgApi(pMac, &msg);
885} /****** end limAuthResponseTimerHandler() ******/
886
887
888/**
889 * limAuthResponseTimerHandler()
890 *
891 *FUNCTION:
892 * This function is called upon Auth response timer expiration on AP
893 *
894 *LOGIC:
895 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
896 * when this function is executed.
897 *
898 *ASSUMPTIONS:
899 * NA
900 *
901 *NOTE:
902 * NA
903 *
904 * @param param - pointer to pre-auth node
905 *
906 * @return None
907 */
908
909void
910limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
911{
912 tSirMsgQ msg;
913 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
914
915 // Prepare and post message to LIM Message Queue
916
917 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
918 msg.bodyptr = NULL;
919 msg.bodyval = (tANI_U32)param;
920
921 limPostMsgApi(pMac, &msg);
922} /****** end limAuthResponseTimerHandler() ******/
923
924
925
926/**
927 * limAssocFailureTimerHandler()
928 *
929 *FUNCTION:
930 * This function is called upon Re/Assoc failure timer expiration
931 * on STA
932 *
933 *LOGIC:
934 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
935 * when this function is executed.
936 *
937 *ASSUMPTIONS:
938 * NA
939 *
940 *NOTE:
941 * NA
942 *
943 * @param param - Indicates whether this is assoc or reassoc
944 * failure timeout
945 * @return None
946 */
947
948void
949limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
950{
951 tSirMsgQ msg;
952 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
953
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700954#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
955 if((LIM_REASSOC == param) &&
956 (NULL != pMac->lim.pSessionEntry))
957 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700958 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700959 if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
960 {
961 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
962 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700963 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700964 return;
965 }
966 else
967 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700968 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700969 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
970 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530971 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700972 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
973 }
974 }
975 }
976#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700977 // Prepare and post message to LIM Message Queue
978
979 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
980 msg.bodyval = (tANI_U32)param;
981 msg.bodyptr = NULL;
982
983 limPostMsgApi(pMac, &msg);
984} /****** end limAssocFailureTimerHandler() ******/
985
986
987/**
988 * limUpdateOlbcCacheTimerHandler()
989 *
990 *FUNCTION:
991 * This function is called upon update olbc cache timer expiration
992 * on STA
993 *
994 *LOGIC:
995 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
996 * when this function is executed.
997 *
998 *ASSUMPTIONS:
999 * NA
1000 *
1001 *NOTE:
1002 * NA
1003 *
1004 * @param
1005 *
1006 * @return None
1007 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001008void
1009limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
1010{
1011 tSirMsgQ msg;
1012 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
1013
1014 // Prepare and post message to LIM Message Queue
1015
1016 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
1017 msg.bodyval = 0;
1018 msg.bodyptr = NULL;
1019
1020 limPostMsgApi(pMac, &msg);
1021} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -07001022
1023/**
1024 * limDeactivateAndChangeTimer()
1025 *
1026 *FUNCTION:
1027 * This function is called to deactivate and change a timer
1028 * for future re-activation
1029 *
1030 *LOGIC:
1031 *
1032 *ASSUMPTIONS:
1033 * NA
1034 *
1035 *NOTE:
1036 * NA
1037 *
1038 * @param pMac - Pointer to Global MAC structure
1039 * @param timerId - enum of timer to be deactivated and changed
1040 * This enum is defined in limUtils.h file
1041 *
1042 * @return None
1043 */
1044
1045void
1046limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1047{
1048 tANI_U32 val=0, val1=0;
1049
Jeff Johnsone7245742012-09-05 17:12:55 -07001050 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001051
1052 switch (timerId)
1053 {
1054 case eLIM_ADDTS_RSP_TIMER:
1055 pMac->lim.gLimAddtsRspTimerCount++;
1056 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1057 {
1058 // Could not deactivate AddtsRsp Timer
1059 // Log error
1060 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001061 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001062 }
1063 break;
1064
1065 case eLIM_MIN_CHANNEL_TIMER:
1066 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1067 != TX_SUCCESS)
1068 {
1069 // Could not deactivate min channel timer.
1070 // Log error
1071 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001072 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001073 }
1074
Jeff Johnsone7245742012-09-05 17:12:55 -07001075#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001076 // If a background was triggered via Quiet BSS,
1077 // then we need to adjust the MIN and MAX channel
1078 // timer's accordingly to the Quiet duration that
1079 // was specified
1080 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1081 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1082 {
1083 // gLimQuietDuration is already cached in units of
1084 // system ticks. No conversion is reqd...
1085 val = pMac->lim.gLimSpecMgmt.quietDuration;
1086 }
1087 else
1088 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001089#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001090 if(pMac->lim.gpLimMlmScanReq)
1091 {
1092 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001093 if (pMac->btc.btcScanCompromise)
1094 {
1095 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1096 {
1097 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1098 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1099 }
1100 else
1101 {
1102 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1103 }
1104 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001105 }
1106 else
1107 {
1108 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1109 //No need to change min timer. This is not a scan
1110 break;
1111 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001112#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001113 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001114#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001115
1116 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1117 val, 0) != TX_SUCCESS)
1118 {
1119 // Could not change min channel timer.
1120 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001121 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001122 }
1123
1124 break;
1125
1126 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1127 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1128 != TX_SUCCESS)
1129 {
1130 // Could not deactivate min channel timer.
1131 // Log error
1132 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001133 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001134 }
1135
1136 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001137 if (pMac->btc.btcScanCompromise)
1138 {
1139 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1140 {
1141 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1142 }
1143 else
1144 {
1145 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1146 }
1147 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001148 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1149 val, 0) != TX_SUCCESS)
1150 {
1151 // Could not change min channel timer.
1152 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001153 limLog(pMac, LOGP, FL("Unable to change periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001154 }
1155
1156 break;
1157
1158 case eLIM_MAX_CHANNEL_TIMER:
1159 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1160 != TX_SUCCESS)
1161 {
1162 // Could not deactivate max channel timer.
1163 // Log error
1164 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001165 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001166 }
1167
Jeff Johnson295189b2012-06-20 16:38:30 -07001168 // If a background was triggered via Quiet BSS,
1169 // then we need to adjust the MIN and MAX channel
1170 // timer's accordingly to the Quiet duration that
1171 // was specified
1172 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1173 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001174#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001175
1176 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1177 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1178 {
1179 // gLimQuietDuration is already cached in units of
1180 // system ticks. No conversion is reqd...
1181 val = pMac->lim.gLimSpecMgmt.quietDuration;
1182 }
1183 else
1184 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001185#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001186 if(pMac->lim.gpLimMlmScanReq)
1187 {
1188 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001189 if (pMac->btc.btcScanCompromise)
1190 {
1191 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1192 {
1193 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1194 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1195 }
1196 else
1197 {
1198 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1199 }
1200 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001201 }
1202 else
1203 {
1204 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1205 //No need to change max timer. This is not a scan
1206 break;
1207 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001208#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001209 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001210#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001211 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001212
1213 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1214 val, 0) != TX_SUCCESS)
1215 {
1216 // Could not change max channel timer.
1217 // Log error
1218 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001219 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001220 }
1221
1222 break;
1223
1224 case eLIM_JOIN_FAIL_TIMER:
1225 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1226 != TX_SUCCESS)
1227 {
1228 /**
1229 * Could not deactivate Join Failure
1230 * timer. Log error.
1231 */
1232 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001233 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001234 }
1235
1236 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1237 &val) != eSIR_SUCCESS)
1238 {
1239 /**
1240 * Could not get JoinFailureTimeout value
1241 * from CFG. Log error.
1242 */
1243 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001244 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001245 }
1246 val = SYS_MS_TO_TICKS(val);
1247
1248 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1249 val, 0) != TX_SUCCESS)
1250 {
1251 /**
1252 * Could not change Join Failure
1253 * timer. Log error.
1254 */
1255 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001256 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001257 }
1258
1259 break;
1260
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001261 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1262 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1263 != TX_SUCCESS)
1264 {
1265 // Could not deactivate periodic join req Times.
1266 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001267 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001268 }
1269
1270 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1271 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1272 val, 0) != TX_SUCCESS)
1273 {
1274 // Could not change periodic join req times.
1275 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001276 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001277 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001278
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001279 break;
1280
Jeff Johnson295189b2012-06-20 16:38:30 -07001281 case eLIM_AUTH_FAIL_TIMER:
1282 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1283 != TX_SUCCESS)
1284 {
1285 // Could not deactivate Auth failure timer.
1286 // Log error
1287 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001288 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001289 }
1290
1291 // Change timer to reactivate it in future
1292 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1293 &val) != eSIR_SUCCESS)
1294 {
1295 /**
1296 * Could not get AuthFailureTimeout value
1297 * from CFG. Log error.
1298 */
1299 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001300 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001301 }
1302 val = SYS_MS_TO_TICKS(val);
1303
1304 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1305 val, 0) != TX_SUCCESS)
1306 {
1307 // Could not change Authentication failure timer.
1308 // Log error
1309 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001310 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001311 }
1312
1313 break;
1314
1315 case eLIM_ASSOC_FAIL_TIMER:
1316 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1317 TX_SUCCESS)
1318 {
1319 // Could not deactivate Association failure timer.
1320 // Log error
1321 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001322 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001323 }
1324
1325 // Change timer to reactivate it in future
1326 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1327 &val) != eSIR_SUCCESS)
1328 {
1329 /**
1330 * Could not get AssocFailureTimeout value
1331 * from CFG. Log error.
1332 */
1333 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001334 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001335 }
1336 val = SYS_MS_TO_TICKS(val);
1337
1338 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1339 val, 0) != TX_SUCCESS)
1340 {
1341 // Could not change Association failure timer.
1342 // Log error
1343 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001344 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001345 }
1346
1347 break;
1348
1349 case eLIM_REASSOC_FAIL_TIMER:
1350 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1351 TX_SUCCESS)
1352 {
1353 // Could not deactivate Reassociation failure timer.
1354 // Log error
1355 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001356 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001357 }
1358
1359 // Change timer to reactivate it in future
1360 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1361 &val) != eSIR_SUCCESS)
1362 {
1363 /**
1364 * Could not get ReassocFailureTimeout value
1365 * from CFG. Log error.
1366 */
1367 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001368 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001369 }
1370 val = SYS_MS_TO_TICKS(val);
1371
1372 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1373 val, 0) != TX_SUCCESS)
1374 {
1375 // Could not change Reassociation failure timer.
1376 // Log error
1377 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001378 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 }
1380
1381 break;
1382
1383 case eLIM_HEART_BEAT_TIMER:
1384 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1385 TX_SUCCESS)
1386 {
1387 // Could not deactivate Heartbeat timer.
1388 // Log error
1389 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001390 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001391 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001392 else
1393 {
1394 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1395 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001396
1397 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1398 &val) != eSIR_SUCCESS)
1399 {
1400 /**
1401 * Could not get BEACON_INTERVAL value
1402 * from CFG. Log error.
1403 */
1404 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001405 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 }
1407
1408 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1409 eSIR_SUCCESS)
1410 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001411 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001412
1413 // Change timer to reactivate it in future
1414 val = SYS_MS_TO_TICKS(val * val1);
1415
1416 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1417 val, 0) != TX_SUCCESS)
1418 {
1419 // Could not change HeartBeat timer.
1420 // Log error
1421 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001422 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001423 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001424 else
1425 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001426 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001427 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001428 break;
1429
1430 case eLIM_PROBE_AFTER_HB_TIMER:
1431 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1432 TX_SUCCESS)
1433 {
1434 // Could not deactivate Heartbeat timer.
1435 // Log error
1436 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001437 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001438 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001439 else
1440 {
1441 limLog(pMac, LOGE, FL("Deactivated probe after hb timer"));
1442 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001443
1444 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1445 &val) != eSIR_SUCCESS)
1446 {
1447 /**
1448 * Could not get PROBE_AFTER_HB_FAILURE
1449 * value from CFG. Log error.
1450 */
1451 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001452 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001453 }
1454
1455 // Change timer to reactivate it in future
1456 val = SYS_MS_TO_TICKS(val);
1457
1458 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1459 val, 0) != TX_SUCCESS)
1460 {
1461 // Could not change HeartBeat timer.
1462 // Log error
1463 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001464 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001465 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001466 else
1467 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001468 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001469 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001470
1471 break;
1472
1473 case eLIM_KEEPALIVE_TIMER:
1474 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1475 != TX_SUCCESS)
1476 {
1477 // Could not deactivate Keepalive timer.
1478 // Log error
1479 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001480 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001481 }
1482
1483 // Change timer to reactivate it in future
1484
1485 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1486 &val) != eSIR_SUCCESS)
1487 {
1488 /**
1489 * Could not get keepalive timeout value
1490 * from CFG. Log error.
1491 */
1492 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001493 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001494 }
1495 if (val == 0)
1496 {
1497 val = 3000;
1498 pMac->sch.keepAlive = 0;
1499 } else
1500 pMac->sch.keepAlive = 1;
1501
1502
1503
1504 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1505
1506 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1507 val, val) != TX_SUCCESS)
1508 {
1509 // Could not change KeepaliveTimer timer.
1510 // Log error
1511 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001512 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001513 }
1514
1515 break;
1516
Jeff Johnson295189b2012-06-20 16:38:30 -07001517 case eLIM_BACKGROUND_SCAN_TIMER:
1518 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1519 != TX_SUCCESS)
1520 {
1521 // Could not deactivate BackgroundScanTimer timer.
1522 // Log error
1523 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001524 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001525 }
1526
1527 // Change timer to reactivate it in future
1528 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1529 &val) != eSIR_SUCCESS)
1530 {
1531 /**
1532 * Could not get Background scan period value
1533 * from CFG. Log error.
1534 */
1535 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001536 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001537 }
1538 if (val == 0)
1539 {
1540 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1541 pMac->lim.gLimBackgroundScanDisable = true;
1542 }
1543 else
1544 pMac->lim.gLimBackgroundScanDisable = false;
1545
1546 val = SYS_MS_TO_TICKS(val);
1547
1548 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1549 val, val) != TX_SUCCESS)
1550 {
1551 // Could not change BackgroundScanTimer timer.
1552 // Log error
1553 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001554 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001555 }
1556
1557 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001558
Jeff Johnsone7245742012-09-05 17:12:55 -07001559#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001560 case eLIM_CHANNEL_SWITCH_TIMER:
1561 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1562 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001563 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001564 return;
1565 }
1566
1567 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1568 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1569 0) != TX_SUCCESS)
1570 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001571 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001572 return;
1573 }
1574 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001575#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001576
1577 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001578 break;
1579
Jeff Johnsone7245742012-09-05 17:12:55 -07001580#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001581 case eLIM_QUIET_BSS_TIMER:
1582 if (TX_SUCCESS !=
1583 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1584 {
1585 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001586 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001587 }
1588
1589 // gLimQuietDuration appears to be in units of ticks
1590 // Use it as is
1591 if (TX_SUCCESS !=
1592 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1593 pMac->lim.gLimSpecMgmt.quietDuration,
1594 0))
1595 {
1596 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001597 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001598 }
1599 break;
1600
1601 case eLIM_QUIET_TIMER:
1602 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1603 {
1604 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001605 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001606 }
1607
1608 // Set the NEW timeout value, in ticks
1609 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1610 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1611 {
1612 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001613 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001614 }
1615 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001616#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001617
Jeff Johnson295189b2012-06-20 16:38:30 -07001618#if 0
1619 case eLIM_WPS_OVERLAP_TIMER:
1620 {
1621 // Restart Learn Interval timer
1622
1623 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1624
1625 if (tx_timer_deactivate(
1626 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1627 {
1628 // Could not deactivate Learn Interval timer.
1629 // Log error
1630 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001631 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001632 }
1633
1634 if (tx_timer_change(
1635 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1636 WPSOverlapTimer, 0) != TX_SUCCESS)
1637 {
1638 // Could not change Learn Interval timer.
1639 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001640 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001641
1642 return;
1643 }
1644
1645 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001646 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001647 WPSOverlapTimer);
1648 }
1649 break;
1650#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001651
1652#ifdef WLAN_FEATURE_VOWIFI_11R
1653 case eLIM_FT_PREAUTH_RSP_TIMER:
1654 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1655 {
1656 /**
1657 ** Could not deactivate Join Failure
1658 ** timer. Log error.
1659 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001660 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001661 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001662 }
1663 val = 1000;
1664 val = SYS_MS_TO_TICKS(val);
1665 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1666 val, 0) != TX_SUCCESS)
1667 {
1668 /**
1669 * Could not change Join Failure
1670 * timer. Log error.
1671 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001672 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001673 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001674 }
1675 break;
1676#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001677#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001678 case eLIM_TSM_TIMER:
1679 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer)
1680 != TX_SUCCESS)
1681 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001682 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001683 }
1684 break;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001685#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001686 case eLIM_REMAIN_CHN_TIMER:
1687 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS)
1688 {
1689 /**
1690 ** Could not deactivate Join Failure
1691 ** timer. Log error.
1692 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001693 limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001694 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001695 }
1696 val = 1000;
1697 val = SYS_MS_TO_TICKS(val);
1698 if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
1699 val, 0) != TX_SUCCESS)
1700 {
1701 /**
1702 * Could not change Join Failure
1703 * timer. Log error.
1704 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001705 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001706 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001707 }
1708 break;
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301709
1710 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1711 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1712 {
1713 /**
1714 ** Could not deactivate Active to passive channel timer.
1715 ** Log error.
1716 **/
1717 limLog(pMac, LOGP, FL("Unable to Deactivate "
1718 "Active to passive channel timer"));
1719 return;
1720 }
1721 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1722 val = SYS_MS_TO_TICKS(val);
1723 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1724 val, 0) != TX_SUCCESS)
1725 {
1726 /**
1727 * Could not change timer to check scan type for passive channel.
1728 * timer. Log error.
1729 */
1730 limLog(pMac, LOGP, FL("Unable to change timer"));
1731 return;
1732 }
1733 break;
1734
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001735 case eLIM_DISASSOC_ACK_TIMER:
1736 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1737 {
1738 /**
1739 ** Could not deactivate Join Failure
1740 ** timer. Log error.
1741 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001742 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001743 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001744 }
1745 val = 1000;
1746 val = SYS_MS_TO_TICKS(val);
1747 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1748 val, 0) != TX_SUCCESS)
1749 {
1750 /**
1751 * Could not change Join Failure
1752 * timer. Log error.
1753 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001754 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001755 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001756 }
1757 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001758
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001759 case eLIM_DEAUTH_ACK_TIMER:
1760 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1761 {
1762 /**
1763 ** Could not deactivate Join Failure
1764 ** timer. Log error.
1765 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001766 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001767 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001768 }
1769 val = 1000;
1770 val = SYS_MS_TO_TICKS(val);
1771 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1772 val, 0) != TX_SUCCESS)
1773 {
1774 /**
1775 * Could not change Join Failure
1776 * timer. Log error.
1777 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001778 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001779 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001780 }
1781 break;
Viral Modid86bde22012-12-10 13:09:21 -08001782
Viral Modid86bde22012-12-10 13:09:21 -08001783 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1784 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1785 {
1786 /**
1787 ** Could not deactivate SingleShot NOA Insert
1788 ** timer. Log error.
1789 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001790 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001791 return;
1792 }
1793 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1794 val = SYS_MS_TO_TICKS(val);
1795 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1796 val, 0) != TX_SUCCESS)
1797 {
1798 /**
1799 * Could not change Single Shot NOA Insert
1800 * timer. Log error.
1801 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001802 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001803 return;
1804 }
1805 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001806
Jeff Johnson295189b2012-06-20 16:38:30 -07001807 default:
1808 // Invalid timerId. Log error
1809 break;
1810 }
1811} /****** end limDeactivateAndChangeTimer() ******/
1812
1813
1814
1815/**---------------------------------------------------------------
1816\fn limHeartBeatDeactivateAndChangeTimer
1817\brief This function deactivates and changes the heart beat
1818\ timer, eLIM_HEART_BEAT_TIMER.
1819\
1820\param pMac
1821\param psessionEntry
1822\return None
1823------------------------------------------------------------------*/
1824void
1825limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1826{
Ravi Joshid0699502013-07-08 15:48:47 -07001827 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001828
Ravi Joshid0699502013-07-08 15:48:47 -07001829 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001830#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001831 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1832 return;
Yathish9f22e662012-12-10 14:21:35 -08001833#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001834
Ravi Joshid0699502013-07-08 15:48:47 -07001835 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1836 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001837
Ravi Joshid0699502013-07-08 15:48:47 -07001838 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1839 changing. to avoid this problem, HeartBeat interval is made constant, by
1840 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001841
Ravi Joshid0699502013-07-08 15:48:47 -07001842 //val = psessionEntry->beaconParams.beaconInterval;
1843 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001844
Ravi Joshid0699502013-07-08 15:48:47 -07001845 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1846 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001847
Ravi Joshid0699502013-07-08 15:48:47 -07001848 PELOGW(limLog(pMac,LOGW,
1849 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1850 val1, psessionEntry->beaconParams.beaconInterval,
1851 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001852
Ravi Joshid0699502013-07-08 15:48:47 -07001853 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1854 * enough to judge the peer device inactivity when 32 peers are connected.
1855 * Hence increasing the HB timer timeout to
1856 * HBtimeout = (TBTT * num_beacons * num_peers)
1857 */
1858 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1859 pMac->lim.gLimNumIbssPeers > 0)
1860 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001861 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001862 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001863
Ravi Joshid0699502013-07-08 15:48:47 -07001864 // Change timer to reactivate it in future
1865 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001866
Ravi Joshid0699502013-07-08 15:48:47 -07001867 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1868 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001869
1870} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1871
1872
1873/**---------------------------------------------------------------
1874\fn limReactivateHeartBeatTimer
1875\brief This function s called to deactivate, change and
1876\ activate a timer.
1877\
1878\param pMac - Pointer to Global MAC structure
1879\param psessionEntry
1880\return None
1881------------------------------------------------------------------*/
1882void
1883limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1884{
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001885 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001886
Yathish9f22e662012-12-10 14:21:35 -08001887#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1888 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001889 {
1890 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001891 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001892 }
Yathish9f22e662012-12-10 14:21:35 -08001893#endif
1894
Jeff Johnson295189b2012-06-20 16:38:30 -07001895 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001896 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001897
1898 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001899 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1900 {
1901 /*
1902 * There is increasing need to limit the apps wakeup due to WLAN
1903 * activity. During HB monitoring, the beacons from peer are sent to
1904 * the host causing the host to wakeup. Hence, offloading the HB
1905 * monitoring to LMAC
1906 */
1907 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1908 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1909 {
1910 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1911 {
1912 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1913 }
1914 else
1915 {
1916 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1917 }
1918 }
1919 else
1920 {
1921 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1922 {
1923 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1924 }
1925 else
1926 {
1927 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1928 }
1929 }
1930 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001931 }
1932
1933} /****** end limReactivateHeartBeatTimer() ******/
1934
Jeff Johnson295189b2012-06-20 16:38:30 -07001935
1936/**
1937 * limActivateHearBeatTimer()
1938 *
1939 *
1940 * @brief: This function is called to activate heartbeat timer
1941 *
1942 *LOGIC:
1943 *
1944 *ASSUMPTIONS:
1945 * NA
1946 *
1947 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1948 *
1949 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001950 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001951 *
1952 * @return TX_SUCCESS - timer is activated
1953 * errors - fail to start the timer
1954 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001955v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001956{
1957 v_UINT_t status = TX_TIMER_ERROR;
1958
Yathish9f22e662012-12-10 14:21:35 -08001959#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1960 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001961 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001962#endif
1963
Jeff Johnson295189b2012-06-20 16:38:30 -07001964 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1965 {
1966 //consider 0 interval a ok case
1967 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1968 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001969 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1970 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1971 {
1972 /* HB offload in IBSS mode */
1973 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1974 if (TX_SUCCESS != status)
1975 {
1976 PELOGE(limLog(pMac, LOGE,
1977 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1978 status);)
1979 }
1980 else
1981 {
1982 PELOGE(limLog(pMac, LOGE,
1983 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
1984 __func__);)
1985 }
1986
1987 }
1988 else
1989 {
1990 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1991 if ( TX_SUCCESS != status )
1992 {
1993 PELOGE(limLog(pMac, LOGE,
1994 FL("could not activate Heartbeat timer status(%d)"), status);)
1995 }
1996 else
1997 {
1998 PELOGE(limLog(pMac, LOGW,
1999 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2000 }
2001 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002002 }
2003 else
2004 {
2005 status = TX_SUCCESS;
2006 }
2007 }
2008
2009 return (status);
2010}
2011
2012
2013
2014/**
2015 * limDeactivateAndChangePerStaIdTimer()
2016 *
2017 *
2018 * @brief: This function is called to deactivate and change a per STA timer
2019 * for future re-activation
2020 *
2021 *LOGIC:
2022 *
2023 *ASSUMPTIONS:
2024 * NA
2025 *
2026 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2027 *
2028 * @param pMac - Pointer to Global MAC structure
2029 * @param timerId - enum of timer to be deactivated and changed
2030 * This enum is defined in limUtils.h file
2031 * @param staId - staId
2032 *
2033 * @return None
2034 */
2035
2036void
2037limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2038{
2039 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07002040 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07002041
2042 switch (timerId)
2043 {
2044 case eLIM_CNF_WAIT_TIMER:
2045
2046 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2047 != TX_SUCCESS)
2048 {
2049 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002050 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002051
2052 }
2053
2054 // Change timer to reactivate it in future
2055
2056 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2057 &val) != eSIR_SUCCESS)
2058 {
2059 /**
2060 * Could not get cnf timeout value
2061 * from CFG. Log error.
2062 */
2063 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002064 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002065 }
2066 val = SYS_MS_TO_TICKS(val);
2067
2068 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2069 val, val) != TX_SUCCESS)
2070 {
2071 // Could not change cnf timer.
2072 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002073 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002074 }
2075
2076 break;
2077
2078 case eLIM_AUTH_RSP_TIMER:
2079 {
2080 tLimPreAuthNode *pAuthNode;
2081
2082 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2083
2084 if (pAuthNode == NULL)
2085 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002086 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002087 break;
2088 }
2089
2090 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2091 {
2092 // Could not deactivate auth response timer.
2093 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002094 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002095 }
2096
2097 // Change timer to reactivate it in future
2098
2099 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2100 {
2101 /**
2102 * Could not get auth rsp timeout value
2103 * from CFG. Log error.
2104 */
2105 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002106 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002107 }
2108
2109 val = SYS_MS_TO_TICKS(val);
2110
2111 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2112 {
2113 // Could not change auth rsp timer.
2114 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002115 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002116 }
2117 }
2118 break;
2119
Jeff Johnson295189b2012-06-20 16:38:30 -07002120
2121 default:
2122 // Invalid timerId. Log error
2123 break;
2124
2125 }
2126}
2127
2128
2129/**
2130 * limActivateCnfTimer()
2131 *
2132 *FUNCTION:
2133 * This function is called to activate a per STA timer
2134 *
2135 *LOGIC:
2136 *
2137 *ASSUMPTIONS:
2138 * NA
2139 *
2140 *NOTE:
2141 * NA
2142 *
2143 * @param pMac - Pointer to Global MAC structure
2144 * @param StaId - staId
2145 *
2146 * @return None
2147 */
2148
2149void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2150{
Jeff Johnsone7245742012-09-05 17:12:55 -07002151 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002152 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2153 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2154 != TX_SUCCESS)
2155 {
2156 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002157 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002158 }
2159}
2160
2161/**
2162 * limActivateAuthRspTimer()
2163 *
2164 *FUNCTION:
2165 * This function is called to activate a per STA timer
2166 *
2167 *LOGIC:
2168 *
2169 *ASSUMPTIONS:
2170 * NA
2171 *
2172 *NOTE:
2173 * NA
2174 *
2175 * @param pMac - Pointer to Global MAC structure
2176 * @param id - id
2177 *
2178 * @return None
2179 */
2180
2181void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2182{
Jeff Johnsone7245742012-09-05 17:12:55 -07002183 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002184 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2185 {
2186 /// Could not activate auth rsp timer.
2187 // Log error
2188 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002189 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002190 }
2191}
2192
2193
2194/**
2195 * limSendDisassocFrameThresholdHandler()
2196 *
2197 *FUNCTION:
2198 * This function reloads the credit to the send disassociate frame bucket
2199 *
2200 *LOGIC:
2201 *
2202 *ASSUMPTIONS:
2203 *
2204 *NOTE:
2205 * NA
2206 *
2207 * @param
2208 *
2209 * @return None
2210 */
2211
2212void
2213limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param)
2214{
2215 tSirMsgQ msg;
2216 tANI_U32 statusCode;
2217 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2218
2219 msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT;
2220 msg.bodyval = 0;
2221 msg.bodyptr = NULL;
2222
2223 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2224 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002225 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002226
2227}
2228
2229/**
2230 * limAssocCnfWaitTmerHandler()
2231 *
2232 *FUNCTION:
2233 * This function post a message to send a disassociate frame out.
2234 *
2235 *LOGIC:
2236 *
2237 *ASSUMPTIONS:
2238 *
2239 *NOTE:
2240 * NA
2241 *
2242 * @param
2243 *
2244 * @return None
2245 */
2246
2247void
2248limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2249{
2250 tSirMsgQ msg;
2251 tANI_U32 statusCode;
2252 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2253
2254 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2255 msg.bodyval = (tANI_U32)param;
2256 msg.bodyptr = NULL;
2257
2258 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2259 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002260 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002261
2262}
2263
2264/**
2265 * limKeepaliveTmerHandler()
2266 *
2267 *FUNCTION:
2268 * This function post a message to send a NULL data frame.
2269 *
2270 *LOGIC:
2271 *
2272 *ASSUMPTIONS:
2273 *
2274 *NOTE:
2275 * NA
2276 *
2277 * @param
2278 *
2279 * @return None
2280 */
2281
2282void
2283limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2284{
2285 tSirMsgQ msg;
2286 tANI_U32 statusCode;
2287 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2288
2289 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2290 msg.bodyval = (tANI_U32)param;
2291 msg.bodyptr = NULL;
2292
2293 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2294 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002295 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002296
2297}
2298
2299void
2300limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2301{
2302 tSirMsgQ msg;
2303 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2304
2305 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002306 FL("ChannelSwitch Timer expired. Posting msg to LIM "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002307
2308 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2309 msg.bodyval = (tANI_U32)param;
2310 msg.bodyptr = NULL;
2311
2312 limPostMsgApi(pMac, &msg);
2313}
2314
2315void
2316limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2317{
2318 tSirMsgQ msg;
2319 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2320
2321 msg.type = SIR_LIM_QUIET_TIMEOUT;
2322 msg.bodyval = (tANI_U32)param;
2323 msg.bodyptr = NULL;
2324
2325 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002326 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002327 limPostMsgApi(pMac, &msg);
2328}
2329
2330void
2331limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2332{
2333 tSirMsgQ msg;
2334 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2335
2336 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2337 msg.bodyval = (tANI_U32)param;
2338 msg.bodyptr = NULL;
2339 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002340 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002341 limPostMsgApi(pMac, &msg);
2342}
Jeff Johnson295189b2012-06-20 16:38:30 -07002343#if 0
2344void
2345limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2346{
2347 tSirMsgQ msg;
2348 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2349
2350 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2351 msg.bodyval = (tANI_U32)param;
2352 msg.bodyptr = NULL;
2353 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002354 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002355 limPostMsgApi(pMac, &msg);
2356}
2357#endif
Yathish9f22e662012-12-10 14:21:35 -08002358
2359#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2360/* ACTIVE_MODE_HB_OFFLOAD */
2361/**
2362 * limMissedBeaconInActiveMode()
2363 *
2364 *FUNCTION:
2365 * This function handle beacon miss indication from FW
2366 * in Active mode.
2367 *
2368 *LOGIC:
2369 *
2370 *ASSUMPTIONS:
2371 * NA
2372 *
2373 *NOTE:
2374 * NA
2375 *
2376 * @param param - Msg Type
2377 *
2378 * @return None
2379 */
2380void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002381limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002382{
2383 tANI_U32 statusCode;
2384 tSirMsgQ msg;
2385 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2386
2387 // Prepare and post message to LIM Message Queue
2388 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002389 {
Yathish9f22e662012-12-10 14:21:35 -08002390 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002391 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002392 msg.bodyval = 0;
2393 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002394 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002395 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2396 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002397 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002398 msg.type, statusCode);
2399 }
2400}
2401#endif