blob: 7fb43a95c36bb675ebfe2d0d185e2aa9c839ca78 [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;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800104 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -0700105
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700106 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700107
108 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
109 &cfgValue) != eSIR_SUCCESS)
110 {
111 /**
112 * Could not get MinChannelTimeout value
113 * from CFG. Log error.
114 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700115 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700116 }
117 cfgValue = SYS_MS_TO_TICKS(cfgValue);
118
119 // Create MIN/MAX channel timers and activate them later
120 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
121 "MIN CHANNEL TIMEOUT",
122 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
123 cfgValue, 0,
124 TX_NO_ACTIVATE) != TX_SUCCESS)
125 {
126 /// Could not start min channel timer.
127 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700128 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700129 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700130 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700131 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700132
133 /* Periodic probe request timer value is half of the Min channel
134 * timer. Probe request sends periodically till min/max channel
135 * timer expires
136 */
137
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800138 cfgValue1 = cfgValue/2 ;
139 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 {
141 // Create periodic probe request timer and activate them later
142 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
143 "Periodic Probe Request Timer",
144 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800145 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700146 TX_NO_ACTIVATE) != TX_SUCCESS)
147 {
148 /// Could not start Periodic Probe Req timer.
149 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700150 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700151 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700152 }
153 }
154
155
156 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
157 &cfgValue) != eSIR_SUCCESS)
158 {
159 /**
160 * Could not get MAXChannelTimeout value
161 * from CFG. Log error.
162 */
163 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700164 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700165 }
166 cfgValue = SYS_MS_TO_TICKS(cfgValue);
167
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800168 /* Limiting max numm of probe req for each channel scan */
169 pMac->lim.maxProbe = (cfgValue/cfgValue1);
170
Jeff Johnson295189b2012-06-20 16:38:30 -0700171 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
172 "MAX CHANNEL TIMEOUT",
173 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
174 cfgValue, 0,
175 TX_NO_ACTIVATE) != TX_SUCCESS)
176 {
177 /// Could not start max channel timer.
178 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700179 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700180
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700181 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700182 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700183 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700184
185 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
186 {
187 // Create Channel Switch Timer
188 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
189 "CHANNEL SWITCH TIMER",
190 limChannelSwitchTimerHandler,
191 0, // expiration_input
192 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
193 0, // reschedule_ticks
194 TX_NO_ACTIVATE) != TX_SUCCESS)
195 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700196 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700197 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700198 }
199
200 //
201 // Create Quiet Timer
202 // This is used on the STA to go and shut-off
203 // Tx/Rx "after" the specified quiteInterval
204 //
205 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
206 "QUIET TIMER",
207 limQuietTimerHandler,
208 SIR_LIM_QUIET_TIMEOUT, // expiration_input
209 LIM_QUIET_TIMER_TICKS, // initial_ticks
210 0, // reschedule_ticks
211 TX_NO_ACTIVATE) != TX_SUCCESS)
212 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700213 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700214 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700215 }
216
217 //
218 // Create Quiet BSS Timer
219 // After the specified quiteInterval, determined by
220 // gLimQuietTimer, this timer, gLimQuietBssTimer,
221 // trigger and put the STA to sleep for the specified
222 // gLimQuietDuration
223 //
224 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
225 "QUIET BSS TIMER",
226 limQuietBssTimerHandler,
227 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
228 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
229 0, // reschedule_ticks
230 TX_NO_ACTIVATE) != TX_SUCCESS)
231 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700232 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700233 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700234 }
235
236 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
237 &cfgValue) != eSIR_SUCCESS)
238 {
239 /**
240 * Could not get JoinFailureTimeout value
241 * from CFG. Log error.
242 */
243 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700244 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700245 }
246 cfgValue = SYS_MS_TO_TICKS(cfgValue);
247
248 // Create Join failure timer and activate it later
249 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
250 "JOIN FAILURE TIMEOUT",
251 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
252 cfgValue, 0,
253 TX_NO_ACTIVATE) != TX_SUCCESS)
254 {
255 /// Could not create Join failure timer.
256 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700257 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700258
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700259 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700260 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800261
Jeff Johnson62c27982013-02-27 17:53:55 -0800262 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800263 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
264 "Periodic Join Probe Request Timer",
265 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
266 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
267 TX_NO_ACTIVATE)) != TX_SUCCESS)
268 {
269 /// Could not create Periodic Join Probe Request timer.
270 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700271 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800272 goto err_timer;
273 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700274
275 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
276 &cfgValue) != eSIR_SUCCESS)
277 {
278 /**
279 * Could not get AssocFailureTimeout value
280 * from CFG. Log error.
281 */
282 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700283 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700284 }
285 cfgValue = SYS_MS_TO_TICKS(cfgValue);
286
287 // Create Association failure timer and activate it later
288 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
289 "ASSOC FAILURE TIMEOUT",
290 limAssocFailureTimerHandler, LIM_ASSOC,
291 cfgValue, 0,
292 TX_NO_ACTIVATE) != TX_SUCCESS)
293 {
294 /// Could not create Assoc failure timer.
295 // Log error
296 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700297 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700298
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700299 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700300 }
301 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
302 &cfgValue) != eSIR_SUCCESS)
303 {
304 /**
305 * Could not get ReassocFailureTimeout value
306 * from CFG. Log error.
307 */
308 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700309 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700310 }
311 cfgValue = SYS_MS_TO_TICKS(cfgValue);
312
313 // Create Association failure timer and activate it later
314 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
315 "REASSOC FAILURE TIMEOUT",
316 limAssocFailureTimerHandler, LIM_REASSOC,
317 cfgValue, 0,
318 TX_NO_ACTIVATE) != TX_SUCCESS)
319 {
320 /// Could not create Reassoc failure timer.
321 // Log error
322 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700323 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700324
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700325 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700326 }
327
328 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700329 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700330
331 cfgValue = SYS_MS_TO_TICKS(cfgValue);
332
333 // Create Addts response timer and activate it later
334 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
335 "ADDTS RSP TIMEOUT",
336 limAddtsResponseTimerHandler,
337 SIR_LIM_ADDTS_RSP_TIMEOUT,
338 cfgValue, 0,
339 TX_NO_ACTIVATE) != TX_SUCCESS)
340 {
341 /// Could not create Auth failure timer.
342 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700343 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700344
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700345 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700346 }
347
348 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
349 &cfgValue) != eSIR_SUCCESS)
350 {
351 /**
352 * Could not get AuthFailureTimeout value
353 * from CFG. Log error.
354 */
355 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700356 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700357 }
358 cfgValue = SYS_MS_TO_TICKS(cfgValue);
359
360 // Create Auth failure timer and activate it later
361 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
362 "AUTH FAILURE TIMEOUT",
363 limTimerHandler,
364 SIR_LIM_AUTH_FAIL_TIMEOUT,
365 cfgValue, 0,
366 TX_NO_ACTIVATE) != TX_SUCCESS)
367 {
368 /// Could not create Auth failure timer.
369 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700370 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700371
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700372 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700373 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800374
Jeff Johnson295189b2012-06-20 16:38:30 -0700375 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
376 &cfgValue) != eSIR_SUCCESS)
377 {
378 /**
379 * Could not get BEACON_INTERVAL value
380 * from CFG. Log error.
381 */
382 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700383 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700384 }
385 cfgValue = SYS_MS_TO_TICKS(cfgValue);
386
387 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
388 "Heartbeat TIMEOUT",
389 limTimerHandler,
390 SIR_LIM_HEART_BEAT_TIMEOUT,
391 cfgValue,
392 0,
393 TX_NO_ACTIVATE) != TX_SUCCESS)
394 {
395 /// Could not start Heartbeat timer.
396 // Log error
397 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700398 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700399 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700400 }
401
402 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
403 &cfgValue) != eSIR_SUCCESS)
404 {
405 /**
406 * Could not get PROBE_AFTER_HB_FAILURE
407 * value from CFG. Log error.
408 */
409 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700410 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700411 }
412
413 // Change timer to reactivate it in future
414 cfgValue = SYS_MS_TO_TICKS(cfgValue);
415
416 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
417 "Probe after Heartbeat TIMEOUT",
418 limTimerHandler,
419 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
420 cfgValue,
421 0,
422 TX_NO_ACTIVATE) != TX_SUCCESS)
423 {
424 // Could not creat wt-probe-after-HeartBeat-failure timer.
425 // Log error
426 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700427 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700428 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700429 }
430
Jeff Johnson295189b2012-06-20 16:38:30 -0700431 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
432 &cfgValue) != eSIR_SUCCESS)
433 {
434 /**
435 * Could not get Background scan period value
436 * from CFG. Log error.
437 */
438 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700439 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700440 }
441
442 /*
443 * setting period to zero means disabling background scans when associated
444 * the way we do this is to set a flag indicating this and keeping
445 * the timer running, since it will be used for PDU leak workarounds
446 * as well as background scanning during SME idle states
447 */
448 if (cfgValue == 0)
449 {
450 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
451 pMac->lim.gLimBackgroundScanDisable = true;
452 }
453 else
454 pMac->lim.gLimBackgroundScanDisable = false;
455
456 cfgValue = SYS_MS_TO_TICKS(cfgValue);
457
458 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
459 "Background scan TIMEOUT",
460 limTimerHandler,
461 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
462 cfgValue,
463 cfgValue,
464 TX_NO_ACTIVATE) != TX_SUCCESS)
465 {
466 /// Could not start background scan timer.
467 // Log error
468 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700469 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700470 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700471 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800472#ifdef FEATURE_WLAN_TDLS_INTERNAL
Jeff Johnson62c27982013-02-27 17:53:55 -0800473 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800474 * create TDLS timers..
475 * a) TDLS discovery response timer.
Jeff Johnson62c27982013-02-27 17:53:55 -0800476 */
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800477
478 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
479 &cfgValue) != eSIR_SUCCESS)
480 {
481 /*
482 * Could not get discovery response Timeout value
483 * from CFG. Log error.
484 */
485 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700486 FL("could not retrieve ReassocFailureTimeout value"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800487 }
488 cfgValue = SYS_MS_TO_TICKS(cfgValue);
489
Jeff Johnson62c27982013-02-27 17:53:55 -0800490 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800491 * create TDLS discovery response wait timer and activate it later
492 */
493 if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer,
494 "TDLS discovery response WAIT",
495 limTimerHandler,
496 SIR_LIM_TDLS_DISCOVERY_RSP_WAIT,
497 cfgValue, 0,
498 TX_NO_ACTIVATE) != TX_SUCCESS)
499 {
500 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700501 FL("could not create TDLS discovery response wait timer"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800502 goto err_timer;
503 }
504#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700505 }
506
507
508 cfgValue = SYS_MS_TO_TICKS(LIM_HASH_MISS_TIMER_MS);
509
510 if (tx_timer_create(
511 &pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer,
512 "Disassoc throttle TIMEOUT",
513 limSendDisassocFrameThresholdHandler,
514 SIR_LIM_HASH_MISS_THRES_TIMEOUT,
515 cfgValue,
516 cfgValue,
517 TX_AUTO_ACTIVATE) != TX_SUCCESS)
518 {
519 /// Could not start Send Disassociate Frame Threshold timer.
520 // Log error
521 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700522 FL("create Disassociate throttle timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700523 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700524 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700525 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700526 FL("Created Disassociate throttle timer "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700527
528 /**
529 * Create keepalive timer and activate it right away for AP role
530 */
531
532 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
533 &cfgValue) != eSIR_SUCCESS)
534 {
535 /**
536 * Could not get keepalive timeout value
537 * from CFG. Log error.
538 */
539 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700540 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 }
542
543 // A value of zero implies keep alive should be disabled
544 if (cfgValue == 0)
545 {
546 cfgValue = LIM_KEEPALIVE_TIMER_MS;
547 pMac->sch.keepAlive = 0;
548 } else
549 pMac->sch.keepAlive = 1;
550
551
552 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
553
554 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
555 "KEEPALIVE_TIMEOUT",
556 limKeepaliveTmerHandler,
557 0,
558 cfgValue,
559 cfgValue,
560 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
561 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
562 != TX_SUCCESS)
563 {
564 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700565 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700566 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700567 }
568
569 /**
570 * Create all CNF_WAIT Timers upfront
571 */
572
573 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
574 &cfgValue) != eSIR_SUCCESS)
575 {
576 /**
577 * Could not get CNF_WAIT timeout value
578 * from CFG. Log error.
579 */
580 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700581 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700582 }
583 cfgValue = SYS_MS_TO_TICKS(cfgValue);
584
585 for (i=0; i<pMac->lim.maxStation; i++)
586 {
587 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
588 "CNF_MISS_TIMEOUT",
589 limCnfWaitTmerHandler,
590 (tANI_U32)i,
591 cfgValue,
592 0,
593 TX_NO_ACTIVATE) != TX_SUCCESS)
594 {
595 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700596 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700597 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700598 }
599 }
600
601 /*
602 ** Alloc and init table for the preAuth timer list
603 **
604 **/
605
606 // get max number of Preauthentication
607 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
608 &cfgValue) != eSIR_SUCCESS)
609 {
610 /*
611 ** Could not get max preauth value
612 ** from CFG. Log error.
613 **/
614 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700615 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700616 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700617 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530618 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_malloc(cfgValue*sizeof(tLimPreAuthNode));
619 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700620 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530621 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700622 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700623 }
624
625 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700626 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700627
628
Jeff Johnson295189b2012-06-20 16:38:30 -0700629 {
630 /**
631 * Create OLBC cache aging timer
632 */
633 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
634 &cfgValue) != eSIR_SUCCESS)
635 {
636 /**
637 * Could not get OLBC detect timeout value
638 * from CFG. Log error.
639 */
640 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700641 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700642 }
643
644 cfgValue = SYS_MS_TO_TICKS(cfgValue);
645
646 if (tx_timer_create(
647 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
648 "OLBC UPDATE CACHE TIMEOUT",
649 limUpdateOlbcCacheTimerHandler,
650 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
651 cfgValue,
652 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700653 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700654 {
655 // Cannot create update OLBC cache timer
656 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700657 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700658 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700659 }
660 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700661#ifdef WLAN_FEATURE_VOWIFI_11R
662 // In future we need to use the auth timer, cause
663 // the pre auth session will be introduced before sending
664 // Auth frame.
665 // We need to go off channel and come back to home channel
666 cfgValue = 1000;
667 cfgValue = SYS_MS_TO_TICKS(cfgValue);
668
669 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
670 "FT PREAUTH RSP TIMEOUT",
671 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
672 cfgValue, 0,
673 TX_NO_ACTIVATE) != TX_SUCCESS)
674 {
675 // Could not create Join failure timer.
676 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700677 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700678 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700679 }
680#endif
681
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700682#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700683 cfgValue = 5000;
684 cfgValue = SYS_MS_TO_TICKS(cfgValue);
685
686 if (tx_timer_create(&pMac->lim.limTimers.gLimCcxTsmTimer,
687 "CCX TSM Stats TIMEOUT",
688 limTimerHandler, SIR_LIM_CCX_TSM_TIMEOUT,
689 cfgValue, 0,
690 TX_NO_ACTIVATE) != TX_SUCCESS)
691 {
692 // Could not create Join failure timer.
693 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700694 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700695 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700696 }
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700697#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700698
Jeff Johnson295189b2012-06-20 16:38:30 -0700699 cfgValue = 1000;
700 cfgValue = SYS_MS_TO_TICKS(cfgValue);
701 if (tx_timer_create(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
702 "FT PREAUTH RSP TIMEOUT",
703 limTimerHandler, SIR_LIM_REMAIN_CHN_TIMEOUT,
704 cfgValue, 0,
705 TX_NO_ACTIVATE) != TX_SUCCESS)
706 {
707 // Could not create Join failure timer.
708 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700709 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700710 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700711 }
712
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800713
714 cfgValue = 1000;
715 cfgValue = SYS_MS_TO_TICKS(cfgValue);
716 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
717 "DISASSOC ACK TIMEOUT",
718 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
719 cfgValue, 0,
720 TX_NO_ACTIVATE) != TX_SUCCESS)
721 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700722 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800723 goto err_timer;
724 }
725
726 cfgValue = 1000;
727 cfgValue = SYS_MS_TO_TICKS(cfgValue);
728 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
729 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800730 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800731 cfgValue, 0,
732 TX_NO_ACTIVATE) != TX_SUCCESS)
733 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700734 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800735 goto err_timer;
736 }
Viral Modid86bde22012-12-10 13:09:21 -0800737
Viral Modid86bde22012-12-10 13:09:21 -0800738 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)
739 cfgValue = SYS_MS_TO_TICKS(cfgValue);
740 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
741 "Single Shot NOA Insert timeout",
742 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
743 cfgValue, 0,
744 TX_NO_ACTIVATE) != TX_SUCCESS)
745 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700746 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800747 goto err_timer;
748 }
Viral Modid86bde22012-12-10 13:09:21 -0800749
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530750 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
751 cfgValue = SYS_MS_TO_TICKS(cfgValue);
752 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
753 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
754 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
755 TX_NO_ACTIVATE) != TX_SUCCESS)
756 {
757 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
758 goto err_timer;
759 }
760
761
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700762 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700763
764 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800765 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800766 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800767 tx_timer_delete(&pMac->lim.limTimers.gLimRemainOnChannelTimer);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700768#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700769 tx_timer_delete(&pMac->lim.limTimers.gLimCcxTsmTimer);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700770#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700771 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
772 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
773 while(((tANI_S32)--i) >= 0)
774 {
775 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
776 }
777 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
778 tx_timer_delete(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer);
779 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
780 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
781 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
782 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
783 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
784 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
785 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800786 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800787 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700788 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
789 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
790 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
791 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
792 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
793 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800794 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530795 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700796
797 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800798 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530799 vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800800 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
801 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700802
803 return TX_TIMER_ERROR;
804
Jeff Johnson295189b2012-06-20 16:38:30 -0700805} /****** end limCreateTimers() ******/
806
807
808
809/**
810 * limTimerHandler()
811 *
812 *FUNCTION:
813 * This function is called upon
814 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
815 * 2. JOIN_FAILURE timer expiration while joining a BSS
816 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
817 * 4. Heartbeat timer expiration on STA
818 * 5. Background scan timer expiration on STA
819 * 6. AID release, Pre-auth cleanup and Link monitoring timer
820 * expiration on AP
821 *
822 *LOGIC:
823 *
824 *ASSUMPTIONS:
825 * NA
826 *
827 *NOTE:
828 * NA
829 *
830 * @param param - Message corresponding to the timer that expired
831 *
832 * @return None
833 */
834
835void
836limTimerHandler(void *pMacGlobal, tANI_U32 param)
837{
838 tANI_U32 statusCode;
839 tSirMsgQ msg;
840 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
841
842 // Prepare and post message to LIM Message Queue
843
844 msg.type = (tANI_U16) param;
845 msg.bodyptr = NULL;
846 msg.bodyval = 0;
847
848 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
849 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700850 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700851 msg.type, statusCode);
852} /****** end limTimerHandler() ******/
853
854
855/**
856 * limAddtsResponseTimerHandler()
857 *
858 *FUNCTION:
859 * This function is called upon Addts response timer expiration on sta
860 *
861 *LOGIC:
862 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
863 * when this function is executed.
864 *
865 *ASSUMPTIONS:
866 * NA
867 *
868 *NOTE:
869 * NA
870 *
871 * @param param - pointer to pre-auth node
872 *
873 * @return None
874 */
875
876void
877limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
878{
879 tSirMsgQ msg;
880 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
881
882 // Prepare and post message to LIM Message Queue
883
884 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
885 msg.bodyval = param;
886 msg.bodyptr = NULL;
887
888 limPostMsgApi(pMac, &msg);
889} /****** end limAuthResponseTimerHandler() ******/
890
891
892/**
893 * limAuthResponseTimerHandler()
894 *
895 *FUNCTION:
896 * This function is called upon Auth response timer expiration on AP
897 *
898 *LOGIC:
899 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
900 * when this function is executed.
901 *
902 *ASSUMPTIONS:
903 * NA
904 *
905 *NOTE:
906 * NA
907 *
908 * @param param - pointer to pre-auth node
909 *
910 * @return None
911 */
912
913void
914limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
915{
916 tSirMsgQ msg;
917 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
918
919 // Prepare and post message to LIM Message Queue
920
921 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
922 msg.bodyptr = NULL;
923 msg.bodyval = (tANI_U32)param;
924
925 limPostMsgApi(pMac, &msg);
926} /****** end limAuthResponseTimerHandler() ******/
927
928
929
930/**
931 * limAssocFailureTimerHandler()
932 *
933 *FUNCTION:
934 * This function is called upon Re/Assoc failure timer expiration
935 * on STA
936 *
937 *LOGIC:
938 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
939 * when this function is executed.
940 *
941 *ASSUMPTIONS:
942 * NA
943 *
944 *NOTE:
945 * NA
946 *
947 * @param param - Indicates whether this is assoc or reassoc
948 * failure timeout
949 * @return None
950 */
951
952void
953limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
954{
955 tSirMsgQ msg;
956 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
957
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700958#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
959 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530960 (NULL != pMac->lim.pSessionEntry) &&
961 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700962 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700963 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700964 if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
965 {
966 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
967 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700968 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700969 return;
970 }
971 else
972 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700973 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700974 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
975 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530976 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700977 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
978 }
979 }
980 }
981#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700982 // Prepare and post message to LIM Message Queue
983
984 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
985 msg.bodyval = (tANI_U32)param;
986 msg.bodyptr = NULL;
987
988 limPostMsgApi(pMac, &msg);
989} /****** end limAssocFailureTimerHandler() ******/
990
991
992/**
993 * limUpdateOlbcCacheTimerHandler()
994 *
995 *FUNCTION:
996 * This function is called upon update olbc cache timer expiration
997 * on STA
998 *
999 *LOGIC:
1000 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
1001 * when this function is executed.
1002 *
1003 *ASSUMPTIONS:
1004 * NA
1005 *
1006 *NOTE:
1007 * NA
1008 *
1009 * @param
1010 *
1011 * @return None
1012 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001013void
1014limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
1015{
1016 tSirMsgQ msg;
1017 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
1018
1019 // Prepare and post message to LIM Message Queue
1020
1021 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
1022 msg.bodyval = 0;
1023 msg.bodyptr = NULL;
1024
1025 limPostMsgApi(pMac, &msg);
1026} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -07001027
1028/**
1029 * limDeactivateAndChangeTimer()
1030 *
1031 *FUNCTION:
1032 * This function is called to deactivate and change a timer
1033 * for future re-activation
1034 *
1035 *LOGIC:
1036 *
1037 *ASSUMPTIONS:
1038 * NA
1039 *
1040 *NOTE:
1041 * NA
1042 *
1043 * @param pMac - Pointer to Global MAC structure
1044 * @param timerId - enum of timer to be deactivated and changed
1045 * This enum is defined in limUtils.h file
1046 *
1047 * @return None
1048 */
1049
1050void
1051limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1052{
1053 tANI_U32 val=0, val1=0;
1054
Jeff Johnsone7245742012-09-05 17:12:55 -07001055 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001056
1057 switch (timerId)
1058 {
1059 case eLIM_ADDTS_RSP_TIMER:
1060 pMac->lim.gLimAddtsRspTimerCount++;
1061 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1062 {
1063 // Could not deactivate AddtsRsp Timer
1064 // Log error
1065 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001066 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001067 }
1068 break;
1069
1070 case eLIM_MIN_CHANNEL_TIMER:
1071 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1072 != TX_SUCCESS)
1073 {
1074 // Could not deactivate min channel timer.
1075 // Log error
1076 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001077 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001078 }
1079
Jeff Johnsone7245742012-09-05 17:12:55 -07001080#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001081 // If a background was triggered via Quiet BSS,
1082 // then we need to adjust the MIN and MAX channel
1083 // timer's accordingly to the Quiet duration that
1084 // was specified
1085 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1086 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1087 {
1088 // gLimQuietDuration is already cached in units of
1089 // system ticks. No conversion is reqd...
1090 val = pMac->lim.gLimSpecMgmt.quietDuration;
1091 }
1092 else
1093 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001094#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001095 if(pMac->lim.gpLimMlmScanReq)
1096 {
1097 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001098 if (pMac->btc.btcScanCompromise)
1099 {
1100 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1101 {
1102 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1103 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1104 }
1105 else
1106 {
1107 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1108 }
1109 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001110 }
1111 else
1112 {
1113 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1114 //No need to change min timer. This is not a scan
1115 break;
1116 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001117#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001118 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001119#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001120
1121 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1122 val, 0) != TX_SUCCESS)
1123 {
1124 // Could not change min channel timer.
1125 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001126 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001127 }
1128
1129 break;
1130
1131 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1132 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1133 != TX_SUCCESS)
1134 {
1135 // Could not deactivate min channel timer.
1136 // Log error
1137 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001138 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001139 }
1140
1141 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001142 if (pMac->btc.btcScanCompromise)
1143 {
1144 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1145 {
1146 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1147 }
1148 else
1149 {
1150 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1151 }
1152 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001153 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1154 val, 0) != TX_SUCCESS)
1155 {
1156 // Could not change min channel timer.
1157 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001158 limLog(pMac, LOGP, FL("Unable to change periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001159 }
1160
1161 break;
1162
1163 case eLIM_MAX_CHANNEL_TIMER:
1164 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1165 != TX_SUCCESS)
1166 {
1167 // Could not deactivate max channel timer.
1168 // Log error
1169 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001170 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001171 }
1172
Jeff Johnson295189b2012-06-20 16:38:30 -07001173 // If a background was triggered via Quiet BSS,
1174 // then we need to adjust the MIN and MAX channel
1175 // timer's accordingly to the Quiet duration that
1176 // was specified
1177 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1178 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001179#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001180
1181 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1182 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1183 {
1184 // gLimQuietDuration is already cached in units of
1185 // system ticks. No conversion is reqd...
1186 val = pMac->lim.gLimSpecMgmt.quietDuration;
1187 }
1188 else
1189 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001190#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001191 if(pMac->lim.gpLimMlmScanReq)
1192 {
1193 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001194 if (pMac->btc.btcScanCompromise)
1195 {
1196 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1197 {
1198 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1199 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1200 }
1201 else
1202 {
1203 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1204 }
1205 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001206 }
1207 else
1208 {
1209 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1210 //No need to change max timer. This is not a scan
1211 break;
1212 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001213#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001214 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001215#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001216 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001217
1218 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1219 val, 0) != TX_SUCCESS)
1220 {
1221 // Could not change max channel timer.
1222 // Log error
1223 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001224 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001225 }
1226
1227 break;
1228
1229 case eLIM_JOIN_FAIL_TIMER:
1230 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1231 != TX_SUCCESS)
1232 {
1233 /**
1234 * Could not deactivate Join Failure
1235 * timer. Log error.
1236 */
1237 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001238 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001239 }
1240
1241 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1242 &val) != eSIR_SUCCESS)
1243 {
1244 /**
1245 * Could not get JoinFailureTimeout value
1246 * from CFG. Log error.
1247 */
1248 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001249 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001250 }
1251 val = SYS_MS_TO_TICKS(val);
1252
1253 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1254 val, 0) != TX_SUCCESS)
1255 {
1256 /**
1257 * Could not change Join Failure
1258 * timer. Log error.
1259 */
1260 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001261 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001262 }
1263
1264 break;
1265
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001266 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1267 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1268 != TX_SUCCESS)
1269 {
1270 // Could not deactivate periodic join req Times.
1271 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001272 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001273 }
1274
1275 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1276 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1277 val, 0) != TX_SUCCESS)
1278 {
1279 // Could not change periodic join req times.
1280 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001281 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001282 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001283
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001284 break;
1285
Jeff Johnson295189b2012-06-20 16:38:30 -07001286 case eLIM_AUTH_FAIL_TIMER:
1287 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1288 != TX_SUCCESS)
1289 {
1290 // Could not deactivate Auth failure timer.
1291 // Log error
1292 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001293 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001294 }
1295
1296 // Change timer to reactivate it in future
1297 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1298 &val) != eSIR_SUCCESS)
1299 {
1300 /**
1301 * Could not get AuthFailureTimeout value
1302 * from CFG. Log error.
1303 */
1304 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001305 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001306 }
1307 val = SYS_MS_TO_TICKS(val);
1308
1309 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1310 val, 0) != TX_SUCCESS)
1311 {
1312 // Could not change Authentication failure timer.
1313 // Log error
1314 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001315 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001316 }
1317
1318 break;
1319
1320 case eLIM_ASSOC_FAIL_TIMER:
1321 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1322 TX_SUCCESS)
1323 {
1324 // Could not deactivate Association failure timer.
1325 // Log error
1326 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001327 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001328 }
1329
1330 // Change timer to reactivate it in future
1331 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1332 &val) != eSIR_SUCCESS)
1333 {
1334 /**
1335 * Could not get AssocFailureTimeout value
1336 * from CFG. Log error.
1337 */
1338 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001339 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001340 }
1341 val = SYS_MS_TO_TICKS(val);
1342
1343 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1344 val, 0) != TX_SUCCESS)
1345 {
1346 // Could not change Association failure timer.
1347 // Log error
1348 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001349 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 }
1351
1352 break;
1353
1354 case eLIM_REASSOC_FAIL_TIMER:
1355 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1356 TX_SUCCESS)
1357 {
1358 // Could not deactivate Reassociation failure timer.
1359 // Log error
1360 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001361 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001362 }
1363
1364 // Change timer to reactivate it in future
1365 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1366 &val) != eSIR_SUCCESS)
1367 {
1368 /**
1369 * Could not get ReassocFailureTimeout value
1370 * from CFG. Log error.
1371 */
1372 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001373 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001374 }
1375 val = SYS_MS_TO_TICKS(val);
1376
1377 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1378 val, 0) != TX_SUCCESS)
1379 {
1380 // Could not change Reassociation failure timer.
1381 // Log error
1382 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001383 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001384 }
1385
1386 break;
1387
1388 case eLIM_HEART_BEAT_TIMER:
1389 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1390 TX_SUCCESS)
1391 {
1392 // Could not deactivate Heartbeat timer.
1393 // Log error
1394 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001395 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001396 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001397 else
1398 {
1399 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1400 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001401
1402 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1403 &val) != eSIR_SUCCESS)
1404 {
1405 /**
1406 * Could not get BEACON_INTERVAL value
1407 * from CFG. Log error.
1408 */
1409 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001410 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001411 }
1412
1413 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1414 eSIR_SUCCESS)
1415 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001416 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001417
1418 // Change timer to reactivate it in future
1419 val = SYS_MS_TO_TICKS(val * val1);
1420
1421 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1422 val, 0) != TX_SUCCESS)
1423 {
1424 // Could not change HeartBeat timer.
1425 // Log error
1426 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001427 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001428 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001429 else
1430 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001431 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001432 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001433 break;
1434
1435 case eLIM_PROBE_AFTER_HB_TIMER:
1436 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1437 TX_SUCCESS)
1438 {
1439 // Could not deactivate Heartbeat timer.
1440 // Log error
1441 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001442 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001443 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001444 else
1445 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301446 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001447 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001448
1449 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1450 &val) != eSIR_SUCCESS)
1451 {
1452 /**
1453 * Could not get PROBE_AFTER_HB_FAILURE
1454 * value from CFG. Log error.
1455 */
1456 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001457 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001458 }
1459
1460 // Change timer to reactivate it in future
1461 val = SYS_MS_TO_TICKS(val);
1462
1463 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1464 val, 0) != TX_SUCCESS)
1465 {
1466 // Could not change HeartBeat timer.
1467 // Log error
1468 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001469 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001470 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001471 else
1472 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001473 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001474 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001475
1476 break;
1477
1478 case eLIM_KEEPALIVE_TIMER:
1479 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1480 != TX_SUCCESS)
1481 {
1482 // Could not deactivate Keepalive timer.
1483 // Log error
1484 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001485 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001486 }
1487
1488 // Change timer to reactivate it in future
1489
1490 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1491 &val) != eSIR_SUCCESS)
1492 {
1493 /**
1494 * Could not get keepalive timeout value
1495 * from CFG. Log error.
1496 */
1497 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001498 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001499 }
1500 if (val == 0)
1501 {
1502 val = 3000;
1503 pMac->sch.keepAlive = 0;
1504 } else
1505 pMac->sch.keepAlive = 1;
1506
1507
1508
1509 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1510
1511 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1512 val, val) != TX_SUCCESS)
1513 {
1514 // Could not change KeepaliveTimer timer.
1515 // Log error
1516 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001517 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001518 }
1519
1520 break;
1521
Jeff Johnson295189b2012-06-20 16:38:30 -07001522 case eLIM_BACKGROUND_SCAN_TIMER:
1523 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1524 != TX_SUCCESS)
1525 {
1526 // Could not deactivate BackgroundScanTimer timer.
1527 // Log error
1528 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001529 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001530 }
1531
1532 // Change timer to reactivate it in future
1533 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1534 &val) != eSIR_SUCCESS)
1535 {
1536 /**
1537 * Could not get Background scan period value
1538 * from CFG. Log error.
1539 */
1540 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001541 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001542 }
1543 if (val == 0)
1544 {
1545 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1546 pMac->lim.gLimBackgroundScanDisable = true;
1547 }
1548 else
1549 pMac->lim.gLimBackgroundScanDisable = false;
1550
1551 val = SYS_MS_TO_TICKS(val);
1552
1553 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1554 val, val) != TX_SUCCESS)
1555 {
1556 // Could not change BackgroundScanTimer timer.
1557 // Log error
1558 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001559 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001560 }
1561
1562 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001563
Jeff Johnsone7245742012-09-05 17:12:55 -07001564#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001565 case eLIM_CHANNEL_SWITCH_TIMER:
1566 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1567 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001568 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001569 return;
1570 }
1571
1572 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1573 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1574 0) != TX_SUCCESS)
1575 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001576 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001577 return;
1578 }
1579 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001580#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001581
1582 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001583 break;
1584
Jeff Johnsone7245742012-09-05 17:12:55 -07001585#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001586 case eLIM_QUIET_BSS_TIMER:
1587 if (TX_SUCCESS !=
1588 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1589 {
1590 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001591 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001592 }
1593
1594 // gLimQuietDuration appears to be in units of ticks
1595 // Use it as is
1596 if (TX_SUCCESS !=
1597 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1598 pMac->lim.gLimSpecMgmt.quietDuration,
1599 0))
1600 {
1601 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001602 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001603 }
1604 break;
1605
1606 case eLIM_QUIET_TIMER:
1607 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1608 {
1609 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001610 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001611 }
1612
1613 // Set the NEW timeout value, in ticks
1614 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1615 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1616 {
1617 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001618 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001619 }
1620 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001621#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001622
Jeff Johnson295189b2012-06-20 16:38:30 -07001623#if 0
1624 case eLIM_WPS_OVERLAP_TIMER:
1625 {
1626 // Restart Learn Interval timer
1627
1628 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1629
1630 if (tx_timer_deactivate(
1631 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1632 {
1633 // Could not deactivate Learn Interval timer.
1634 // Log error
1635 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001636 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001637 }
1638
1639 if (tx_timer_change(
1640 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1641 WPSOverlapTimer, 0) != TX_SUCCESS)
1642 {
1643 // Could not change Learn Interval timer.
1644 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001645 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001646
1647 return;
1648 }
1649
1650 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001651 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001652 WPSOverlapTimer);
1653 }
1654 break;
1655#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001656
1657#ifdef WLAN_FEATURE_VOWIFI_11R
1658 case eLIM_FT_PREAUTH_RSP_TIMER:
1659 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1660 {
1661 /**
1662 ** Could not deactivate Join Failure
1663 ** timer. Log error.
1664 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001665 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001666 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001667 }
1668 val = 1000;
1669 val = SYS_MS_TO_TICKS(val);
1670 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1671 val, 0) != TX_SUCCESS)
1672 {
1673 /**
1674 * Could not change Join Failure
1675 * timer. Log error.
1676 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001677 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001678 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001679 }
1680 break;
1681#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001682#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001683 case eLIM_TSM_TIMER:
1684 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer)
1685 != TX_SUCCESS)
1686 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001687 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001688 }
1689 break;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001690#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001691 case eLIM_REMAIN_CHN_TIMER:
1692 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS)
1693 {
1694 /**
1695 ** Could not deactivate Join Failure
1696 ** timer. Log error.
1697 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001698 limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001699 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001700 }
1701 val = 1000;
1702 val = SYS_MS_TO_TICKS(val);
1703 if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
1704 val, 0) != TX_SUCCESS)
1705 {
1706 /**
1707 * Could not change Join Failure
1708 * timer. Log error.
1709 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001710 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001711 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001712 }
1713 break;
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301714
1715 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1716 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1717 {
1718 /**
1719 ** Could not deactivate Active to passive channel timer.
1720 ** Log error.
1721 **/
1722 limLog(pMac, LOGP, FL("Unable to Deactivate "
1723 "Active to passive channel timer"));
1724 return;
1725 }
1726 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1727 val = SYS_MS_TO_TICKS(val);
1728 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1729 val, 0) != TX_SUCCESS)
1730 {
1731 /**
1732 * Could not change timer to check scan type for passive channel.
1733 * timer. Log error.
1734 */
1735 limLog(pMac, LOGP, FL("Unable to change timer"));
1736 return;
1737 }
1738 break;
1739
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001740 case eLIM_DISASSOC_ACK_TIMER:
1741 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1742 {
1743 /**
1744 ** Could not deactivate Join Failure
1745 ** timer. Log error.
1746 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001747 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001748 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001749 }
1750 val = 1000;
1751 val = SYS_MS_TO_TICKS(val);
1752 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1753 val, 0) != TX_SUCCESS)
1754 {
1755 /**
1756 * Could not change Join Failure
1757 * timer. Log error.
1758 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001759 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001760 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001761 }
1762 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001763
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001764 case eLIM_DEAUTH_ACK_TIMER:
1765 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1766 {
1767 /**
1768 ** Could not deactivate Join Failure
1769 ** timer. Log error.
1770 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001771 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001772 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001773 }
1774 val = 1000;
1775 val = SYS_MS_TO_TICKS(val);
1776 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1777 val, 0) != TX_SUCCESS)
1778 {
1779 /**
1780 * Could not change Join Failure
1781 * timer. Log error.
1782 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001783 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001784 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001785 }
1786 break;
Viral Modid86bde22012-12-10 13:09:21 -08001787
Viral Modid86bde22012-12-10 13:09:21 -08001788 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1789 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1790 {
1791 /**
1792 ** Could not deactivate SingleShot NOA Insert
1793 ** timer. Log error.
1794 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001795 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001796 return;
1797 }
1798 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1799 val = SYS_MS_TO_TICKS(val);
1800 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1801 val, 0) != TX_SUCCESS)
1802 {
1803 /**
1804 * Could not change Single Shot NOA Insert
1805 * timer. Log error.
1806 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001807 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001808 return;
1809 }
1810 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001811
Jeff Johnson295189b2012-06-20 16:38:30 -07001812 default:
1813 // Invalid timerId. Log error
1814 break;
1815 }
1816} /****** end limDeactivateAndChangeTimer() ******/
1817
1818
1819
1820/**---------------------------------------------------------------
1821\fn limHeartBeatDeactivateAndChangeTimer
1822\brief This function deactivates and changes the heart beat
1823\ timer, eLIM_HEART_BEAT_TIMER.
1824\
1825\param pMac
1826\param psessionEntry
1827\return None
1828------------------------------------------------------------------*/
1829void
1830limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1831{
Ravi Joshid0699502013-07-08 15:48:47 -07001832 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001833
Ravi Joshid0699502013-07-08 15:48:47 -07001834 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001835#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001836 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1837 return;
Yathish9f22e662012-12-10 14:21:35 -08001838#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001839
Ravi Joshid0699502013-07-08 15:48:47 -07001840 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1841 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001842
Ravi Joshid0699502013-07-08 15:48:47 -07001843 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1844 changing. to avoid this problem, HeartBeat interval is made constant, by
1845 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001846
Ravi Joshid0699502013-07-08 15:48:47 -07001847 //val = psessionEntry->beaconParams.beaconInterval;
1848 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001849
Ravi Joshid0699502013-07-08 15:48:47 -07001850 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1851 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001852
Ravi Joshid0699502013-07-08 15:48:47 -07001853 PELOGW(limLog(pMac,LOGW,
1854 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1855 val1, psessionEntry->beaconParams.beaconInterval,
1856 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001857
Ravi Joshid0699502013-07-08 15:48:47 -07001858 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1859 * enough to judge the peer device inactivity when 32 peers are connected.
1860 * Hence increasing the HB timer timeout to
1861 * HBtimeout = (TBTT * num_beacons * num_peers)
1862 */
1863 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1864 pMac->lim.gLimNumIbssPeers > 0)
1865 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001866 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001867 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001868
Ravi Joshid0699502013-07-08 15:48:47 -07001869 // Change timer to reactivate it in future
1870 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001871
Ravi Joshid0699502013-07-08 15:48:47 -07001872 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1873 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001874
1875} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1876
1877
1878/**---------------------------------------------------------------
1879\fn limReactivateHeartBeatTimer
1880\brief This function s called to deactivate, change and
1881\ activate a timer.
1882\
1883\param pMac - Pointer to Global MAC structure
1884\param psessionEntry
1885\return None
1886------------------------------------------------------------------*/
1887void
1888limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1889{
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001890 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001891
Yathish9f22e662012-12-10 14:21:35 -08001892#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1893 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001894 {
1895 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001896 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001897 }
Yathish9f22e662012-12-10 14:21:35 -08001898#endif
1899
Jeff Johnson295189b2012-06-20 16:38:30 -07001900 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001901 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001902
1903 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001904 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1905 {
1906 /*
1907 * There is increasing need to limit the apps wakeup due to WLAN
1908 * activity. During HB monitoring, the beacons from peer are sent to
1909 * the host causing the host to wakeup. Hence, offloading the HB
1910 * monitoring to LMAC
1911 */
1912 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1913 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1914 {
1915 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1916 {
1917 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1918 }
1919 else
1920 {
1921 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1922 }
1923 }
1924 else
1925 {
1926 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1927 {
1928 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1929 }
1930 else
1931 {
1932 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1933 }
1934 }
1935 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001936 }
1937
1938} /****** end limReactivateHeartBeatTimer() ******/
1939
Jeff Johnson295189b2012-06-20 16:38:30 -07001940
1941/**
1942 * limActivateHearBeatTimer()
1943 *
1944 *
1945 * @brief: This function is called to activate heartbeat timer
1946 *
1947 *LOGIC:
1948 *
1949 *ASSUMPTIONS:
1950 * NA
1951 *
1952 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1953 *
1954 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001955 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001956 *
1957 * @return TX_SUCCESS - timer is activated
1958 * errors - fail to start the timer
1959 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001960v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001961{
1962 v_UINT_t status = TX_TIMER_ERROR;
1963
Yathish9f22e662012-12-10 14:21:35 -08001964#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1965 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001966 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001967#endif
1968
Jeff Johnson295189b2012-06-20 16:38:30 -07001969 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1970 {
1971 //consider 0 interval a ok case
1972 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1973 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001974 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1975 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1976 {
1977 /* HB offload in IBSS mode */
1978 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1979 if (TX_SUCCESS != status)
1980 {
1981 PELOGE(limLog(pMac, LOGE,
1982 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1983 status);)
1984 }
1985 else
1986 {
1987 PELOGE(limLog(pMac, LOGE,
1988 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
1989 __func__);)
1990 }
1991
1992 }
1993 else
1994 {
1995 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1996 if ( TX_SUCCESS != status )
1997 {
1998 PELOGE(limLog(pMac, LOGE,
1999 FL("could not activate Heartbeat timer status(%d)"), status);)
2000 }
2001 else
2002 {
2003 PELOGE(limLog(pMac, LOGW,
2004 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2005 }
2006 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002007 }
2008 else
2009 {
2010 status = TX_SUCCESS;
2011 }
2012 }
2013
2014 return (status);
2015}
2016
2017
2018
2019/**
2020 * limDeactivateAndChangePerStaIdTimer()
2021 *
2022 *
2023 * @brief: This function is called to deactivate and change a per STA timer
2024 * for future re-activation
2025 *
2026 *LOGIC:
2027 *
2028 *ASSUMPTIONS:
2029 * NA
2030 *
2031 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2032 *
2033 * @param pMac - Pointer to Global MAC structure
2034 * @param timerId - enum of timer to be deactivated and changed
2035 * This enum is defined in limUtils.h file
2036 * @param staId - staId
2037 *
2038 * @return None
2039 */
2040
2041void
2042limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2043{
2044 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07002045 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07002046
2047 switch (timerId)
2048 {
2049 case eLIM_CNF_WAIT_TIMER:
2050
2051 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2052 != TX_SUCCESS)
2053 {
2054 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002055 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002056
2057 }
2058
2059 // Change timer to reactivate it in future
2060
2061 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2062 &val) != eSIR_SUCCESS)
2063 {
2064 /**
2065 * Could not get cnf timeout value
2066 * from CFG. Log error.
2067 */
2068 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002069 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002070 }
2071 val = SYS_MS_TO_TICKS(val);
2072
2073 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2074 val, val) != TX_SUCCESS)
2075 {
2076 // Could not change cnf timer.
2077 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002078 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002079 }
2080
2081 break;
2082
2083 case eLIM_AUTH_RSP_TIMER:
2084 {
2085 tLimPreAuthNode *pAuthNode;
2086
2087 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2088
2089 if (pAuthNode == NULL)
2090 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002091 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002092 break;
2093 }
2094
2095 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2096 {
2097 // Could not deactivate auth response timer.
2098 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002099 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002100 }
2101
2102 // Change timer to reactivate it in future
2103
2104 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2105 {
2106 /**
2107 * Could not get auth rsp timeout value
2108 * from CFG. Log error.
2109 */
2110 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002111 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002112 }
2113
2114 val = SYS_MS_TO_TICKS(val);
2115
2116 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2117 {
2118 // Could not change auth rsp timer.
2119 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002120 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002121 }
2122 }
2123 break;
2124
Jeff Johnson295189b2012-06-20 16:38:30 -07002125
2126 default:
2127 // Invalid timerId. Log error
2128 break;
2129
2130 }
2131}
2132
2133
2134/**
2135 * limActivateCnfTimer()
2136 *
2137 *FUNCTION:
2138 * This function is called to activate a per STA timer
2139 *
2140 *LOGIC:
2141 *
2142 *ASSUMPTIONS:
2143 * NA
2144 *
2145 *NOTE:
2146 * NA
2147 *
2148 * @param pMac - Pointer to Global MAC structure
2149 * @param StaId - staId
2150 *
2151 * @return None
2152 */
2153
2154void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2155{
Jeff Johnsone7245742012-09-05 17:12:55 -07002156 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002157 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2158 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2159 != TX_SUCCESS)
2160 {
2161 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002162 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002163 }
2164}
2165
2166/**
2167 * limActivateAuthRspTimer()
2168 *
2169 *FUNCTION:
2170 * This function is called to activate a per STA timer
2171 *
2172 *LOGIC:
2173 *
2174 *ASSUMPTIONS:
2175 * NA
2176 *
2177 *NOTE:
2178 * NA
2179 *
2180 * @param pMac - Pointer to Global MAC structure
2181 * @param id - id
2182 *
2183 * @return None
2184 */
2185
2186void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2187{
Jeff Johnsone7245742012-09-05 17:12:55 -07002188 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002189 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2190 {
2191 /// Could not activate auth rsp timer.
2192 // Log error
2193 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002194 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002195 }
2196}
2197
2198
2199/**
2200 * limSendDisassocFrameThresholdHandler()
2201 *
2202 *FUNCTION:
2203 * This function reloads the credit to the send disassociate frame bucket
2204 *
2205 *LOGIC:
2206 *
2207 *ASSUMPTIONS:
2208 *
2209 *NOTE:
2210 * NA
2211 *
2212 * @param
2213 *
2214 * @return None
2215 */
2216
2217void
2218limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param)
2219{
2220 tSirMsgQ msg;
2221 tANI_U32 statusCode;
2222 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2223
2224 msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT;
2225 msg.bodyval = 0;
2226 msg.bodyptr = NULL;
2227
2228 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2229 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002230 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002231
2232}
2233
2234/**
2235 * limAssocCnfWaitTmerHandler()
2236 *
2237 *FUNCTION:
2238 * This function post a message to send a disassociate frame out.
2239 *
2240 *LOGIC:
2241 *
2242 *ASSUMPTIONS:
2243 *
2244 *NOTE:
2245 * NA
2246 *
2247 * @param
2248 *
2249 * @return None
2250 */
2251
2252void
2253limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2254{
2255 tSirMsgQ msg;
2256 tANI_U32 statusCode;
2257 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2258
2259 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2260 msg.bodyval = (tANI_U32)param;
2261 msg.bodyptr = NULL;
2262
2263 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2264 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002265 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002266
2267}
2268
2269/**
2270 * limKeepaliveTmerHandler()
2271 *
2272 *FUNCTION:
2273 * This function post a message to send a NULL data frame.
2274 *
2275 *LOGIC:
2276 *
2277 *ASSUMPTIONS:
2278 *
2279 *NOTE:
2280 * NA
2281 *
2282 * @param
2283 *
2284 * @return None
2285 */
2286
2287void
2288limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2289{
2290 tSirMsgQ msg;
2291 tANI_U32 statusCode;
2292 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2293
2294 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2295 msg.bodyval = (tANI_U32)param;
2296 msg.bodyptr = NULL;
2297
2298 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2299 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002300 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002301
2302}
2303
2304void
2305limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2306{
2307 tSirMsgQ msg;
2308 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2309
2310 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002311 FL("ChannelSwitch Timer expired. Posting msg to LIM "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002312
2313 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2314 msg.bodyval = (tANI_U32)param;
2315 msg.bodyptr = NULL;
2316
2317 limPostMsgApi(pMac, &msg);
2318}
2319
2320void
2321limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2322{
2323 tSirMsgQ msg;
2324 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2325
2326 msg.type = SIR_LIM_QUIET_TIMEOUT;
2327 msg.bodyval = (tANI_U32)param;
2328 msg.bodyptr = NULL;
2329
2330 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002331 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002332 limPostMsgApi(pMac, &msg);
2333}
2334
2335void
2336limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2337{
2338 tSirMsgQ msg;
2339 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2340
2341 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2342 msg.bodyval = (tANI_U32)param;
2343 msg.bodyptr = NULL;
2344 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002345 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002346 limPostMsgApi(pMac, &msg);
2347}
Jeff Johnson295189b2012-06-20 16:38:30 -07002348#if 0
2349void
2350limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2351{
2352 tSirMsgQ msg;
2353 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2354
2355 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2356 msg.bodyval = (tANI_U32)param;
2357 msg.bodyptr = NULL;
2358 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002359 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002360 limPostMsgApi(pMac, &msg);
2361}
2362#endif
Yathish9f22e662012-12-10 14:21:35 -08002363
2364#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2365/* ACTIVE_MODE_HB_OFFLOAD */
2366/**
2367 * limMissedBeaconInActiveMode()
2368 *
2369 *FUNCTION:
2370 * This function handle beacon miss indication from FW
2371 * in Active mode.
2372 *
2373 *LOGIC:
2374 *
2375 *ASSUMPTIONS:
2376 * NA
2377 *
2378 *NOTE:
2379 * NA
2380 *
2381 * @param param - Msg Type
2382 *
2383 * @return None
2384 */
2385void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002386limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002387{
2388 tANI_U32 statusCode;
2389 tSirMsgQ msg;
2390 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2391
2392 // Prepare and post message to LIM Message Queue
2393 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002394 {
Yathish9f22e662012-12-10 14:21:35 -08002395 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002396 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002397 msg.bodyval = 0;
2398 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002399 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002400 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2401 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002402 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002403 msg.type, statusCode);
2404 }
2405}
2406#endif