blob: ee1f6b034a6b7c3df0d753291e5bc000cc7a52f6 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Sushant Kaushik9e923872015-04-02 17:09:31 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
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.
Jeff Johnson295189b2012-06-20 16:38:30 -070020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
Jeff Johnson295189b2012-06-20 16:38:30 -070022/*
Kiet Lam842dad02014-02-18 18:44:02 -080023 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 * This file limTimerUtils.cc contains the utility functions
30 * LIM uses for handling various timers.
31 * Author: Chandra Modumudi
32 * Date: 02/13/02
33 * History:-
34 * Date Modified by Modification Information
35 * --------------------------------------------------------------------
36 */
37
38#include "limTypes.h"
39#include "limUtils.h"
40#include "limAssocUtils.h"
41#include "limSecurityUtils.h"
42#include "pmmApi.h"
43
44
45// default value 5000 ms for background scan period when it is disabled
46#define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000
47// channel Switch Timer in ticks
48#define LIM_CHANNEL_SWITCH_TIMER_TICKS 1
49// Lim Quite timer in ticks
50#define LIM_QUIET_TIMER_TICKS 100
Jeff Johnsonfeddb2d2012-12-10 14:41:22 -080051// Lim Quite BSS timer interval in ticks
Jeff Johnson295189b2012-06-20 16:38:30 -070052#define LIM_QUIET_BSS_TIMER_TICK 100
53// Lim KeepAlive timer default (3000)ms
54#define LIM_KEEPALIVE_TIMER_MS 3000
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -080055// Lim JoinProbeRequest Retry timer default (200)ms
56#define LIM_JOIN_PROBE_REQ_TIMER_MS 200
Sushant Kaushik9e923872015-04-02 17:09:31 +053057#define LIM_AUTH_RETRY_TIMER_MS 60
58
Jeff Johnson295189b2012-06-20 16:38:30 -070059
60//default beacon interval value used in HB timer interval calculation
61#define LIM_HB_TIMER_BEACON_INTERVAL 100
Gopichand Nakkalad492d202013-05-10 02:50:47 +053062
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053063/* This timer is a periodic timer which expires at every 1 sec to
Gopichand Nakkalad492d202013-05-10 02:50:47 +053064 convert ACTIVE DFS channel to DFS channels */
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053065#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
Gopichand Nakkalad492d202013-05-10 02:50:47 +053066
Jeff Johnson295189b2012-06-20 16:38:30 -070067/**
68 * limCreateTimers()
69 *
70 *FUNCTION:
71 * This function is called upon receiving
72 * 1. SME_START_REQ for STA in ESS role
73 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
74 *
75 *LOGIC:
76 *
77 *ASSUMPTIONS:
78 * NA
79 *
80 *NOTE:
81 * NA
82 *
83 * @param pMac - Pointer to Global MAC structure
84 *
85 * @return None
86 */
87
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070088v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070089limCreateTimers(tpAniSirGlobal pMac)
90{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070091 tANI_U32 cfgValue, i=0;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -080092 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -070093
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070094 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -070095
96 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
97 &cfgValue) != eSIR_SUCCESS)
98 {
99 /**
100 * Could not get MinChannelTimeout value
101 * from CFG. Log error.
102 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700103 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700104 }
105 cfgValue = SYS_MS_TO_TICKS(cfgValue);
106
107 // Create MIN/MAX channel timers and activate them later
108 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
109 "MIN CHANNEL TIMEOUT",
110 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
111 cfgValue, 0,
112 TX_NO_ACTIVATE) != TX_SUCCESS)
113 {
114 /// Could not start min channel timer.
115 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700116 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700117 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700118 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700119 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700120
121 /* Periodic probe request timer value is half of the Min channel
122 * timer. Probe request sends periodically till min/max channel
123 * timer expires
124 */
125
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800126 cfgValue1 = cfgValue/2 ;
127 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 {
129 // Create periodic probe request timer and activate them later
130 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
131 "Periodic Probe Request Timer",
132 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800133 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700134 TX_NO_ACTIVATE) != TX_SUCCESS)
135 {
136 /// Could not start Periodic Probe Req timer.
137 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700138 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700139 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 }
141 }
142
143
144 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
145 &cfgValue) != eSIR_SUCCESS)
146 {
147 /**
148 * Could not get MAXChannelTimeout value
149 * from CFG. Log error.
150 */
151 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700152 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700153 }
154 cfgValue = SYS_MS_TO_TICKS(cfgValue);
155
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800156 /* Limiting max numm of probe req for each channel scan */
157 pMac->lim.maxProbe = (cfgValue/cfgValue1);
158
Jeff Johnson295189b2012-06-20 16:38:30 -0700159 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
160 "MAX CHANNEL TIMEOUT",
161 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
162 cfgValue, 0,
163 TX_NO_ACTIVATE) != TX_SUCCESS)
164 {
165 /// Could not start max channel timer.
166 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700167 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700168
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700169 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700170 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700171 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700172
173 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
174 {
175 // Create Channel Switch Timer
176 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
177 "CHANNEL SWITCH TIMER",
178 limChannelSwitchTimerHandler,
179 0, // expiration_input
180 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
181 0, // reschedule_ticks
182 TX_NO_ACTIVATE) != TX_SUCCESS)
183 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700184 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700185 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700186 }
187
188 //
189 // Create Quiet Timer
190 // This is used on the STA to go and shut-off
191 // Tx/Rx "after" the specified quiteInterval
192 //
193 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
194 "QUIET TIMER",
195 limQuietTimerHandler,
196 SIR_LIM_QUIET_TIMEOUT, // expiration_input
197 LIM_QUIET_TIMER_TICKS, // initial_ticks
198 0, // reschedule_ticks
199 TX_NO_ACTIVATE) != TX_SUCCESS)
200 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700201 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700202 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700203 }
204
205 //
206 // Create Quiet BSS Timer
207 // After the specified quiteInterval, determined by
208 // gLimQuietTimer, this timer, gLimQuietBssTimer,
209 // trigger and put the STA to sleep for the specified
210 // gLimQuietDuration
211 //
212 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
213 "QUIET BSS TIMER",
214 limQuietBssTimerHandler,
215 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
216 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
217 0, // reschedule_ticks
218 TX_NO_ACTIVATE) != TX_SUCCESS)
219 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700220 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700221 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700222 }
223
224 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
225 &cfgValue) != eSIR_SUCCESS)
226 {
227 /**
228 * Could not get JoinFailureTimeout value
229 * from CFG. Log error.
230 */
231 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700232 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700233 }
234 cfgValue = SYS_MS_TO_TICKS(cfgValue);
235
236 // Create Join failure timer and activate it later
237 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
238 "JOIN FAILURE TIMEOUT",
239 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
240 cfgValue, 0,
241 TX_NO_ACTIVATE) != TX_SUCCESS)
242 {
243 /// Could not create Join failure timer.
244 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700245 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700246
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700247 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700248 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800249
Jeff Johnson62c27982013-02-27 17:53:55 -0800250 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800251 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
252 "Periodic Join Probe Request Timer",
253 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
254 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
255 TX_NO_ACTIVATE)) != TX_SUCCESS)
256 {
257 /// Could not create Periodic Join Probe Request timer.
258 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700259 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800260 goto err_timer;
261 }
Sushant Kaushik9e923872015-04-02 17:09:31 +0530262 //Send Auth frame every 60 ms
263 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
264 "Periodic AUTH Timer",
265 limTimerHandler, SIR_LIM_AUTH_RETRY_TIMEOUT,
266 SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0,
267 TX_NO_ACTIVATE)) != TX_SUCCESS)
268 {
269 /// Could not create Periodic Join Probe Request timer.
270 // Log error
271 limLog(pMac, LOGP, FL("could not create Periodic AUTH Timer timer"));
272 goto err_timer;
273 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700274 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
275 &cfgValue) != eSIR_SUCCESS)
276 {
277 /**
278 * Could not get AssocFailureTimeout value
279 * from CFG. Log error.
280 */
281 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700282 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700283 }
284 cfgValue = SYS_MS_TO_TICKS(cfgValue);
285
286 // Create Association failure timer and activate it later
287 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
288 "ASSOC FAILURE TIMEOUT",
289 limAssocFailureTimerHandler, LIM_ASSOC,
290 cfgValue, 0,
291 TX_NO_ACTIVATE) != TX_SUCCESS)
292 {
293 /// Could not create Assoc failure timer.
294 // Log error
295 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700296 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700297
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700298 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700299 }
300 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
301 &cfgValue) != eSIR_SUCCESS)
302 {
303 /**
304 * Could not get ReassocFailureTimeout value
305 * from CFG. Log error.
306 */
307 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700308 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700309 }
310 cfgValue = SYS_MS_TO_TICKS(cfgValue);
311
312 // Create Association failure timer and activate it later
313 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
314 "REASSOC FAILURE TIMEOUT",
315 limAssocFailureTimerHandler, LIM_REASSOC,
316 cfgValue, 0,
317 TX_NO_ACTIVATE) != TX_SUCCESS)
318 {
319 /// Could not create Reassoc failure timer.
320 // Log error
321 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700322 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700323
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700324 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700325 }
326
327 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700328 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700329
330 cfgValue = SYS_MS_TO_TICKS(cfgValue);
331
332 // Create Addts response timer and activate it later
333 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
334 "ADDTS RSP TIMEOUT",
335 limAddtsResponseTimerHandler,
336 SIR_LIM_ADDTS_RSP_TIMEOUT,
337 cfgValue, 0,
338 TX_NO_ACTIVATE) != TX_SUCCESS)
339 {
340 /// Could not create Auth failure timer.
341 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700342 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700343
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700344 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700345 }
346
347 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
348 &cfgValue) != eSIR_SUCCESS)
349 {
350 /**
351 * Could not get AuthFailureTimeout value
352 * from CFG. Log error.
353 */
354 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700355 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700356 }
357 cfgValue = SYS_MS_TO_TICKS(cfgValue);
358
359 // Create Auth failure timer and activate it later
360 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
361 "AUTH FAILURE TIMEOUT",
362 limTimerHandler,
363 SIR_LIM_AUTH_FAIL_TIMEOUT,
364 cfgValue, 0,
365 TX_NO_ACTIVATE) != TX_SUCCESS)
366 {
367 /// Could not create Auth failure timer.
368 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700369 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700370
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700371 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800373
Jeff Johnson295189b2012-06-20 16:38:30 -0700374 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
375 &cfgValue) != eSIR_SUCCESS)
376 {
377 /**
378 * Could not get BEACON_INTERVAL value
379 * from CFG. Log error.
380 */
381 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700382 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700383 }
384 cfgValue = SYS_MS_TO_TICKS(cfgValue);
385
386 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
387 "Heartbeat TIMEOUT",
388 limTimerHandler,
389 SIR_LIM_HEART_BEAT_TIMEOUT,
390 cfgValue,
391 0,
392 TX_NO_ACTIVATE) != TX_SUCCESS)
393 {
394 /// Could not start Heartbeat timer.
395 // Log error
396 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700397 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700398 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700399 }
400
401 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
402 &cfgValue) != eSIR_SUCCESS)
403 {
404 /**
405 * Could not get PROBE_AFTER_HB_FAILURE
406 * value from CFG. Log error.
407 */
408 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700409 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700410 }
411
412 // Change timer to reactivate it in future
413 cfgValue = SYS_MS_TO_TICKS(cfgValue);
414
415 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
416 "Probe after Heartbeat TIMEOUT",
417 limTimerHandler,
418 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
419 cfgValue,
420 0,
421 TX_NO_ACTIVATE) != TX_SUCCESS)
422 {
423 // Could not creat wt-probe-after-HeartBeat-failure timer.
424 // Log error
425 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700426 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700427 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700428 }
429
Jeff Johnson295189b2012-06-20 16:38:30 -0700430 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
431 &cfgValue) != eSIR_SUCCESS)
432 {
433 /**
434 * Could not get Background scan period value
435 * from CFG. Log error.
436 */
437 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700438 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700439 }
440
441 /*
442 * setting period to zero means disabling background scans when associated
443 * the way we do this is to set a flag indicating this and keeping
444 * the timer running, since it will be used for PDU leak workarounds
445 * as well as background scanning during SME idle states
446 */
447 if (cfgValue == 0)
448 {
449 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
450 pMac->lim.gLimBackgroundScanDisable = true;
451 }
452 else
453 pMac->lim.gLimBackgroundScanDisable = false;
454
455 cfgValue = SYS_MS_TO_TICKS(cfgValue);
456
457 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
458 "Background scan TIMEOUT",
459 limTimerHandler,
460 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
461 cfgValue,
462 cfgValue,
463 TX_NO_ACTIVATE) != TX_SUCCESS)
464 {
465 /// Could not start background scan timer.
466 // Log error
467 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700468 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700469 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700470 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700471 }
472
Jeff Johnson295189b2012-06-20 16:38:30 -0700473 /**
474 * Create keepalive timer and activate it right away for AP role
475 */
476
477 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
478 &cfgValue) != eSIR_SUCCESS)
479 {
480 /**
481 * Could not get keepalive timeout value
482 * from CFG. Log error.
483 */
484 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700485 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700486 }
487
488 // A value of zero implies keep alive should be disabled
489 if (cfgValue == 0)
490 {
491 cfgValue = LIM_KEEPALIVE_TIMER_MS;
492 pMac->sch.keepAlive = 0;
493 } else
494 pMac->sch.keepAlive = 1;
495
496
497 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
498
499 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
500 "KEEPALIVE_TIMEOUT",
501 limKeepaliveTmerHandler,
502 0,
503 cfgValue,
504 cfgValue,
505 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
506 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
507 != TX_SUCCESS)
508 {
509 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700510 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700511 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700512 }
513
514 /**
515 * Create all CNF_WAIT Timers upfront
516 */
517
518 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
519 &cfgValue) != eSIR_SUCCESS)
520 {
521 /**
522 * Could not get CNF_WAIT timeout value
523 * from CFG. Log error.
524 */
525 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700526 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700527 }
528 cfgValue = SYS_MS_TO_TICKS(cfgValue);
529
530 for (i=0; i<pMac->lim.maxStation; i++)
531 {
532 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
533 "CNF_MISS_TIMEOUT",
534 limCnfWaitTmerHandler,
535 (tANI_U32)i,
536 cfgValue,
537 0,
538 TX_NO_ACTIVATE) != TX_SUCCESS)
539 {
540 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700541 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700542 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700543 }
544 }
545
546 /*
547 ** Alloc and init table for the preAuth timer list
548 **
549 **/
550
551 // get max number of Preauthentication
552 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
553 &cfgValue) != eSIR_SUCCESS)
554 {
555 /*
556 ** Could not get max preauth value
557 ** from CFG. Log error.
558 **/
559 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700560 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700561 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530563 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_vmalloc(cfgValue*sizeof(tLimPreAuthNode));
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530564 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700565 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530566 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700567 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700568 }
569
570 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700571 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700572
573
Jeff Johnson295189b2012-06-20 16:38:30 -0700574 {
575 /**
576 * Create OLBC cache aging timer
577 */
578 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
579 &cfgValue) != eSIR_SUCCESS)
580 {
581 /**
582 * Could not get OLBC detect timeout value
583 * from CFG. Log error.
584 */
585 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700586 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700587 }
588
589 cfgValue = SYS_MS_TO_TICKS(cfgValue);
590
591 if (tx_timer_create(
592 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
593 "OLBC UPDATE CACHE TIMEOUT",
594 limUpdateOlbcCacheTimerHandler,
595 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
596 cfgValue,
597 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700598 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700599 {
600 // Cannot create update OLBC cache timer
601 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700602 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700603 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700604 }
605 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700606#ifdef WLAN_FEATURE_VOWIFI_11R
607 // In future we need to use the auth timer, cause
608 // the pre auth session will be introduced before sending
609 // Auth frame.
610 // We need to go off channel and come back to home channel
611 cfgValue = 1000;
612 cfgValue = SYS_MS_TO_TICKS(cfgValue);
613
614 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
615 "FT PREAUTH RSP TIMEOUT",
616 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
617 cfgValue, 0,
618 TX_NO_ACTIVATE) != TX_SUCCESS)
619 {
620 // Could not create Join failure timer.
621 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700622 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700623 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700624 }
625#endif
626
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800627#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700628 cfgValue = 5000;
629 cfgValue = SYS_MS_TO_TICKS(cfgValue);
630
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800631 if (tx_timer_create(&pMac->lim.limTimers.gLimEseTsmTimer,
632 "ESE TSM Stats TIMEOUT",
633 limTimerHandler, SIR_LIM_ESE_TSM_TIMEOUT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700634 cfgValue, 0,
635 TX_NO_ACTIVATE) != TX_SUCCESS)
636 {
637 // Could not create Join failure timer.
638 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700639 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700640 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700641 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800642#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700643
Jeff Johnson295189b2012-06-20 16:38:30 -0700644 cfgValue = 1000;
645 cfgValue = SYS_MS_TO_TICKS(cfgValue);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800646 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
647 "DISASSOC ACK TIMEOUT",
648 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
649 cfgValue, 0,
650 TX_NO_ACTIVATE) != TX_SUCCESS)
651 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700652 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800653 goto err_timer;
654 }
655
656 cfgValue = 1000;
657 cfgValue = SYS_MS_TO_TICKS(cfgValue);
658 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
659 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800660 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800661 cfgValue, 0,
662 TX_NO_ACTIVATE) != TX_SUCCESS)
663 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700664 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800665 goto err_timer;
666 }
Viral Modid86bde22012-12-10 13:09:21 -0800667
Viral Modid86bde22012-12-10 13:09:21 -0800668 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)
669 cfgValue = SYS_MS_TO_TICKS(cfgValue);
670 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
671 "Single Shot NOA Insert timeout",
672 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
673 cfgValue, 0,
674 TX_NO_ACTIVATE) != TX_SUCCESS)
675 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700676 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800677 goto err_timer;
678 }
Viral Modid86bde22012-12-10 13:09:21 -0800679
Hanumantha Reddy Pothula97ea0952015-10-09 11:29:39 +0530680 cfgValue = WNI_CFG_ACTIVE_PASSIVE_CON_MAX;
681 if (eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_PASSIVE_CON,
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530682 &cfgValue))
683 {
684 limLog(pMac, LOGP,
685 FL("could not retrieve WNI_CFG_ACTIVE_PASSIVE_CON"));
686 }
687 if (cfgValue)
688 {
689 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
690 cfgValue = SYS_MS_TO_TICKS(cfgValue);
691 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530692 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
693 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
694 TX_NO_ACTIVATE) != TX_SUCCESS)
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530695 {
696 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
697 goto err_timer;
698 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530699 }
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530700 else
701 {
702 limLog(pMac, LOG1,
703 FL("gLimActiveToPassiveChannelTimer not created %d"), cfgValue);
704 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530705
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700706 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700707
708 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800709 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800710 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800711#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
712 tx_timer_delete(&pMac->lim.limTimers.gLimEseTsmTimer);
713#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700714 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
715 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
716 while(((tANI_S32)--i) >= 0)
717 {
718 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
719 }
720 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700721 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
722 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
723 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
724 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
725 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
726 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
727 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800728 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800729 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Sushant Kaushik9e923872015-04-02 17:09:31 +0530730 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700731 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
732 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
733 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
734 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
735 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
736 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800737 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530738 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700739
740 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800741 {
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530742 vos_mem_vfree(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800743 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
744 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700745
746 return TX_TIMER_ERROR;
747
Jeff Johnson295189b2012-06-20 16:38:30 -0700748} /****** end limCreateTimers() ******/
749
750
751
752/**
753 * limTimerHandler()
754 *
755 *FUNCTION:
756 * This function is called upon
757 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
758 * 2. JOIN_FAILURE timer expiration while joining a BSS
759 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
760 * 4. Heartbeat timer expiration on STA
761 * 5. Background scan timer expiration on STA
762 * 6. AID release, Pre-auth cleanup and Link monitoring timer
763 * expiration on AP
764 *
765 *LOGIC:
766 *
767 *ASSUMPTIONS:
768 * NA
769 *
770 *NOTE:
771 * NA
772 *
773 * @param param - Message corresponding to the timer that expired
774 *
775 * @return None
776 */
777
778void
779limTimerHandler(void *pMacGlobal, tANI_U32 param)
780{
781 tANI_U32 statusCode;
782 tSirMsgQ msg;
783 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
784
785 // Prepare and post message to LIM Message Queue
786
787 msg.type = (tANI_U16) param;
788 msg.bodyptr = NULL;
789 msg.bodyval = 0;
790
791 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
792 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700793 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700794 msg.type, statusCode);
795} /****** end limTimerHandler() ******/
796
797
798/**
799 * limAddtsResponseTimerHandler()
800 *
801 *FUNCTION:
802 * This function is called upon Addts response timer expiration on sta
803 *
804 *LOGIC:
805 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
806 * when this function is executed.
807 *
808 *ASSUMPTIONS:
809 * NA
810 *
811 *NOTE:
812 * NA
813 *
814 * @param param - pointer to pre-auth node
815 *
816 * @return None
817 */
818
819void
820limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
821{
822 tSirMsgQ msg;
823 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
824
825 // Prepare and post message to LIM Message Queue
826
827 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
828 msg.bodyval = param;
829 msg.bodyptr = NULL;
830
831 limPostMsgApi(pMac, &msg);
832} /****** end limAuthResponseTimerHandler() ******/
833
834
835/**
836 * limAuthResponseTimerHandler()
837 *
838 *FUNCTION:
839 * This function is called upon Auth response timer expiration on AP
840 *
841 *LOGIC:
842 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
843 * when this function is executed.
844 *
845 *ASSUMPTIONS:
846 * NA
847 *
848 *NOTE:
849 * NA
850 *
851 * @param param - pointer to pre-auth node
852 *
853 * @return None
854 */
855
856void
857limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
858{
859 tSirMsgQ msg;
860 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
861
862 // Prepare and post message to LIM Message Queue
863
864 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
865 msg.bodyptr = NULL;
866 msg.bodyval = (tANI_U32)param;
867
868 limPostMsgApi(pMac, &msg);
869} /****** end limAuthResponseTimerHandler() ******/
870
871
872
873/**
874 * limAssocFailureTimerHandler()
875 *
876 *FUNCTION:
877 * This function is called upon Re/Assoc failure timer expiration
878 * on STA
879 *
880 *LOGIC:
881 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
882 * when this function is executed.
883 *
884 *ASSUMPTIONS:
885 * NA
886 *
887 *NOTE:
888 * NA
889 *
890 * @param param - Indicates whether this is assoc or reassoc
891 * failure timeout
892 * @return None
893 */
894
895void
896limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
897{
898 tSirMsgQ msg;
899 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
900
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800901#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700902 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530903 (NULL != pMac->lim.pSessionEntry) &&
904 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700905 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700906 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Sachin Ahuja07a43012015-01-30 17:04:38 +0530907#ifdef FEATURE_WLAN_ESE
908 if (((pMac->lim.pSessionEntry->isESEconnection) &&
909 (pMac->lim.reAssocRetryAttempt <
910 (LIM_MAX_REASSOC_RETRY_LIMIT - 1)))||
911 ((!pMac->lim.pSessionEntry->isESEconnection) &&
912 (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT))
913 )
914#else
915 if (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
916#endif
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700917 {
918 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
919 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700920 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700921 return;
922 }
923 else
924 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700925 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700926 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
927 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530928 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700929 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
930 }
931 }
932 }
933#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700934 // Prepare and post message to LIM Message Queue
935
936 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
937 msg.bodyval = (tANI_U32)param;
938 msg.bodyptr = NULL;
939
940 limPostMsgApi(pMac, &msg);
941} /****** end limAssocFailureTimerHandler() ******/
942
943
944/**
945 * limUpdateOlbcCacheTimerHandler()
946 *
947 *FUNCTION:
948 * This function is called upon update olbc cache timer expiration
949 * on STA
950 *
951 *LOGIC:
952 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
953 * when this function is executed.
954 *
955 *ASSUMPTIONS:
956 * NA
957 *
958 *NOTE:
959 * NA
960 *
961 * @param
962 *
963 * @return None
964 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700965void
966limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
967{
968 tSirMsgQ msg;
969 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
970
971 // Prepare and post message to LIM Message Queue
972
973 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
974 msg.bodyval = 0;
975 msg.bodyptr = NULL;
976
977 limPostMsgApi(pMac, &msg);
978} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -0700979
980/**
981 * limDeactivateAndChangeTimer()
982 *
983 *FUNCTION:
984 * This function is called to deactivate and change a timer
985 * for future re-activation
986 *
987 *LOGIC:
988 *
989 *ASSUMPTIONS:
990 * NA
991 *
992 *NOTE:
993 * NA
994 *
995 * @param pMac - Pointer to Global MAC structure
996 * @param timerId - enum of timer to be deactivated and changed
997 * This enum is defined in limUtils.h file
998 *
999 * @return None
1000 */
1001
1002void
1003limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1004{
1005 tANI_U32 val=0, val1=0;
Sushant Kaushik9e923872015-04-02 17:09:31 +05301006 tpPESession psessionEntry;
Jeff Johnson295189b2012-06-20 16:38:30 -07001007
Jeff Johnson295189b2012-06-20 16:38:30 -07001008 switch (timerId)
1009 {
1010 case eLIM_ADDTS_RSP_TIMER:
1011 pMac->lim.gLimAddtsRspTimerCount++;
1012 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1013 {
1014 // Could not deactivate AddtsRsp Timer
1015 // Log error
1016 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001017 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001018 }
1019 break;
1020
1021 case eLIM_MIN_CHANNEL_TIMER:
1022 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1023 != TX_SUCCESS)
1024 {
1025 // Could not deactivate min channel timer.
1026 // Log error
1027 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001028 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001029 }
1030
Jeff Johnsone7245742012-09-05 17:12:55 -07001031#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001032 // If a background was triggered via Quiet BSS,
1033 // then we need to adjust the MIN and MAX channel
1034 // timer's accordingly to the Quiet duration that
1035 // was specified
1036 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1037 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1038 {
1039 // gLimQuietDuration is already cached in units of
1040 // system ticks. No conversion is reqd...
1041 val = pMac->lim.gLimSpecMgmt.quietDuration;
1042 }
1043 else
1044 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001045#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001046 if(pMac->lim.gpLimMlmScanReq)
1047 {
1048 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001049 if (pMac->btc.btcScanCompromise)
1050 {
1051 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1052 {
1053 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1054 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1055 }
1056 else
1057 {
1058 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1059 }
1060 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001061 }
1062 else
1063 {
1064 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1065 //No need to change min timer. This is not a scan
1066 break;
1067 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001068#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001069 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001070#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001071
1072 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1073 val, 0) != TX_SUCCESS)
1074 {
1075 // Could not change min channel timer.
1076 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001077 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001078 }
1079
1080 break;
1081
1082 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1083 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1084 != TX_SUCCESS)
1085 {
1086 // Could not deactivate min channel timer.
1087 // Log error
1088 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001089 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001090 }
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301091 if(pMac->lim.gpLimMlmScanReq)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001092 {
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301093 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
1094 if (pMac->btc.btcScanCompromise)
1095 {
1096 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1097 {
1098 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1099 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1100 }
1101 else
1102 {
1103 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1104 }
1105 }
1106 }
1107 /*If val is 0 it means min Channel timer is 0 so take the value from maxChannelTimer*/
1108 if (!val)
1109 {
1110
1111 if(pMac->lim.gpLimMlmScanReq)
1112 {
1113 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime)/2;
1114 if (pMac->btc.btcScanCompromise)
1115 {
1116 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1117 {
1118 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)/2;
1119 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1120 }
1121 else
1122 {
1123 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1124 }
1125 }
1126 }
1127 else
1128 {
1129 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1130 //No need to change max timer. This is not a scan
1131 break;
1132 }
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001133 }
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301134 if (val)
Jeff Johnson295189b2012-06-20 16:38:30 -07001135 {
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301136 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1137 val, 0) != TX_SUCCESS)
1138 {
1139 // Could not change min channel timer.
1140 // Log error
1141 limLog(pMac, LOGE, FL("Unable to change periodic timer"));
1142 }
1143 }
1144 else
1145 {
1146 limLog(pMac, LOGE, FL("Do not change gLimPeriodicProbeReqTimer values,"
1147 "value = %d minchannel time = %d"
1148 "maxchannel time = %d"), val,
1149 pMac->lim.gpLimMlmScanReq->minChannelTime,
1150 pMac->lim.gpLimMlmScanReq->maxChannelTime);
Jeff Johnson295189b2012-06-20 16:38:30 -07001151 }
1152
1153 break;
1154
1155 case eLIM_MAX_CHANNEL_TIMER:
1156 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1157 != TX_SUCCESS)
1158 {
1159 // Could not deactivate max channel timer.
1160 // Log error
1161 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001162 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001163 }
1164
Jeff Johnson295189b2012-06-20 16:38:30 -07001165 // If a background was triggered via Quiet BSS,
1166 // then we need to adjust the MIN and MAX channel
1167 // timer's accordingly to the Quiet duration that
1168 // was specified
1169 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1170 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001171#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001172
1173 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1174 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1175 {
1176 // gLimQuietDuration is already cached in units of
1177 // system ticks. No conversion is reqd...
1178 val = pMac->lim.gLimSpecMgmt.quietDuration;
1179 }
1180 else
1181 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001182#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001183 if(pMac->lim.gpLimMlmScanReq)
1184 {
1185 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001186 if (pMac->btc.btcScanCompromise)
1187 {
1188 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1189 {
1190 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1191 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1192 }
1193 else
1194 {
1195 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1196 }
1197 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001198 }
1199 else
1200 {
1201 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1202 //No need to change max timer. This is not a scan
1203 break;
1204 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001205#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001206 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001207#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001208 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001209
1210 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1211 val, 0) != TX_SUCCESS)
1212 {
1213 // Could not change max channel timer.
1214 // Log error
1215 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001216 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001217 }
1218
1219 break;
1220
1221 case eLIM_JOIN_FAIL_TIMER:
1222 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1223 != TX_SUCCESS)
1224 {
1225 /**
1226 * Could not deactivate Join Failure
1227 * timer. Log error.
1228 */
1229 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001230 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 }
1232
1233 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1234 &val) != eSIR_SUCCESS)
1235 {
1236 /**
1237 * Could not get JoinFailureTimeout value
1238 * from CFG. Log error.
1239 */
1240 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001241 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001242 }
1243 val = SYS_MS_TO_TICKS(val);
1244
1245 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1246 val, 0) != TX_SUCCESS)
1247 {
1248 /**
1249 * Could not change Join Failure
1250 * timer. Log error.
1251 */
1252 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001253 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 }
1255
1256 break;
1257
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001258 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1259 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1260 != TX_SUCCESS)
1261 {
1262 // Could not deactivate periodic join req Times.
1263 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001264 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001265 }
1266
1267 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1268 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1269 val, 0) != TX_SUCCESS)
1270 {
1271 // Could not change periodic join req times.
1272 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001273 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001274 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001275
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001276 break;
1277
Jeff Johnson295189b2012-06-20 16:38:30 -07001278 case eLIM_AUTH_FAIL_TIMER:
1279 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1280 != TX_SUCCESS)
1281 {
1282 // Could not deactivate Auth failure timer.
1283 // Log error
1284 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001285 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001286 }
1287
1288 // Change timer to reactivate it in future
1289 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1290 &val) != eSIR_SUCCESS)
1291 {
1292 /**
1293 * Could not get AuthFailureTimeout value
1294 * from CFG. Log error.
1295 */
1296 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001297 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001298 }
1299 val = SYS_MS_TO_TICKS(val);
1300
1301 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1302 val, 0) != TX_SUCCESS)
1303 {
1304 // Could not change Authentication failure timer.
1305 // Log error
1306 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001307 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001308 }
1309
1310 break;
1311
Sushant Kaushik9e923872015-04-02 17:09:31 +05301312 case eLIM_AUTH_RETRY_TIMER:
1313
1314 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer)
1315 != TX_SUCCESS)
1316 {
1317 // Could not deactivate Auth Retry Timer.
1318 limLog(pMac, LOGP,
1319 FL("Unable to deactivate Auth Retry timer"));
1320 }
1321 if ((psessionEntry = peFindSessionBySessionId(pMac,
1322 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId))
1323 == NULL)
1324 {
1325 limLog(pMac, LOGP,
1326 FL("session does not exist for given SessionId : %d"),
1327 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId);
1328 break;
1329 }
1330 /* 3/5 of the beacon interval*/
1331 val = psessionEntry->beaconParams.beaconInterval * 3/5;
1332 val = SYS_MS_TO_TICKS(val);
1333 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
1334 val, 0) != TX_SUCCESS)
1335 {
1336 // Could not change Auth Retry timer.
1337 // Log error
1338 limLog(pMac, LOGP, FL("Unable to change Auth Retry timer"));
1339 }
1340
1341 break;
1342
Jeff Johnson295189b2012-06-20 16:38:30 -07001343 case eLIM_ASSOC_FAIL_TIMER:
1344 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1345 TX_SUCCESS)
1346 {
1347 // Could not deactivate Association failure timer.
1348 // Log error
1349 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001350 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001351 }
1352
1353 // Change timer to reactivate it in future
1354 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1355 &val) != eSIR_SUCCESS)
1356 {
1357 /**
1358 * Could not get AssocFailureTimeout value
1359 * from CFG. Log error.
1360 */
1361 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001362 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001363 }
1364 val = SYS_MS_TO_TICKS(val);
1365
1366 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1367 val, 0) != TX_SUCCESS)
1368 {
1369 // Could not change Association failure timer.
1370 // Log error
1371 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001372 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001373 }
1374
1375 break;
1376
1377 case eLIM_REASSOC_FAIL_TIMER:
1378 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1379 TX_SUCCESS)
1380 {
1381 // Could not deactivate Reassociation failure timer.
1382 // Log error
1383 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001384 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001385 }
1386
1387 // Change timer to reactivate it in future
1388 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1389 &val) != eSIR_SUCCESS)
1390 {
1391 /**
1392 * Could not get ReassocFailureTimeout value
1393 * from CFG. Log error.
1394 */
1395 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001396 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001397 }
1398 val = SYS_MS_TO_TICKS(val);
1399
1400 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1401 val, 0) != TX_SUCCESS)
1402 {
1403 // Could not change Reassociation failure timer.
1404 // Log error
1405 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001406 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001407 }
1408
1409 break;
1410
1411 case eLIM_HEART_BEAT_TIMER:
1412 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1413 TX_SUCCESS)
1414 {
1415 // Could not deactivate Heartbeat timer.
1416 // Log error
1417 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001418 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001419 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001420 else
1421 {
1422 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1423 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001424
1425 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1426 &val) != eSIR_SUCCESS)
1427 {
1428 /**
1429 * Could not get BEACON_INTERVAL value
1430 * from CFG. Log error.
1431 */
1432 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001433 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001434 }
1435
1436 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1437 eSIR_SUCCESS)
1438 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001439 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001440
1441 // Change timer to reactivate it in future
1442 val = SYS_MS_TO_TICKS(val * val1);
1443
1444 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1445 val, 0) != TX_SUCCESS)
1446 {
1447 // Could not change HeartBeat timer.
1448 // Log error
1449 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001450 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001451 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001452 else
1453 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001454 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001455 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001456 break;
1457
1458 case eLIM_PROBE_AFTER_HB_TIMER:
1459 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1460 TX_SUCCESS)
1461 {
1462 // Could not deactivate Heartbeat timer.
1463 // Log error
1464 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001465 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001466 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001467 else
1468 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301469 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001470 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001471
1472 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1473 &val) != eSIR_SUCCESS)
1474 {
1475 /**
1476 * Could not get PROBE_AFTER_HB_FAILURE
1477 * value from CFG. Log error.
1478 */
1479 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001480 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001481 }
1482
1483 // Change timer to reactivate it in future
1484 val = SYS_MS_TO_TICKS(val);
1485
1486 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1487 val, 0) != TX_SUCCESS)
1488 {
1489 // Could not change HeartBeat timer.
1490 // Log error
1491 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001492 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001493 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001494 else
1495 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001496 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001497 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001498
1499 break;
1500
1501 case eLIM_KEEPALIVE_TIMER:
1502 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1503 != TX_SUCCESS)
1504 {
1505 // Could not deactivate Keepalive timer.
1506 // Log error
1507 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001508 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001509 }
1510
1511 // Change timer to reactivate it in future
1512
1513 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1514 &val) != eSIR_SUCCESS)
1515 {
1516 /**
1517 * Could not get keepalive timeout value
1518 * from CFG. Log error.
1519 */
1520 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001521 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001522 }
1523 if (val == 0)
1524 {
1525 val = 3000;
1526 pMac->sch.keepAlive = 0;
1527 } else
1528 pMac->sch.keepAlive = 1;
1529
1530
1531
1532 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1533
1534 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1535 val, val) != TX_SUCCESS)
1536 {
1537 // Could not change KeepaliveTimer timer.
1538 // Log error
1539 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001540 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001541 }
1542
1543 break;
1544
Jeff Johnson295189b2012-06-20 16:38:30 -07001545 case eLIM_BACKGROUND_SCAN_TIMER:
1546 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1547 != TX_SUCCESS)
1548 {
1549 // Could not deactivate BackgroundScanTimer timer.
1550 // Log error
1551 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001552 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001553 }
1554
1555 // Change timer to reactivate it in future
1556 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1557 &val) != eSIR_SUCCESS)
1558 {
1559 /**
1560 * Could not get Background scan period value
1561 * from CFG. Log error.
1562 */
1563 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001564 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001565 }
1566 if (val == 0)
1567 {
1568 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1569 pMac->lim.gLimBackgroundScanDisable = true;
1570 }
1571 else
1572 pMac->lim.gLimBackgroundScanDisable = false;
1573
1574 val = SYS_MS_TO_TICKS(val);
1575
1576 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1577 val, val) != TX_SUCCESS)
1578 {
1579 // Could not change BackgroundScanTimer timer.
1580 // Log error
1581 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001582 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001583 }
1584
1585 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001586
Jeff Johnsone7245742012-09-05 17:12:55 -07001587#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001588 case eLIM_CHANNEL_SWITCH_TIMER:
1589 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1590 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001591 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001592 return;
1593 }
1594
1595 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1596 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1597 0) != TX_SUCCESS)
1598 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001599 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001600 return;
1601 }
1602 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001603#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001604
1605 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001606 break;
1607
Jeff Johnsone7245742012-09-05 17:12:55 -07001608#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001609 case eLIM_QUIET_BSS_TIMER:
1610 if (TX_SUCCESS !=
1611 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1612 {
1613 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001614 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001615 }
1616
1617 // gLimQuietDuration appears to be in units of ticks
1618 // Use it as is
1619 if (TX_SUCCESS !=
1620 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1621 pMac->lim.gLimSpecMgmt.quietDuration,
1622 0))
1623 {
1624 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001625 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001626 }
1627 break;
1628
1629 case eLIM_QUIET_TIMER:
1630 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1631 {
1632 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001633 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001634 }
1635
1636 // Set the NEW timeout value, in ticks
1637 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1638 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1639 {
1640 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001641 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001642 }
1643 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001644#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001645
Jeff Johnson295189b2012-06-20 16:38:30 -07001646#if 0
1647 case eLIM_WPS_OVERLAP_TIMER:
1648 {
1649 // Restart Learn Interval timer
1650
1651 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1652
1653 if (tx_timer_deactivate(
1654 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1655 {
1656 // Could not deactivate Learn Interval timer.
1657 // Log error
1658 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001659 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001660 }
1661
1662 if (tx_timer_change(
1663 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1664 WPSOverlapTimer, 0) != TX_SUCCESS)
1665 {
1666 // Could not change Learn Interval timer.
1667 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001668 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001669
1670 return;
1671 }
1672
1673 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001674 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001675 WPSOverlapTimer);
1676 }
1677 break;
1678#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001679
1680#ifdef WLAN_FEATURE_VOWIFI_11R
1681 case eLIM_FT_PREAUTH_RSP_TIMER:
1682 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1683 {
1684 /**
1685 ** Could not deactivate Join Failure
1686 ** timer. Log error.
1687 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001688 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001689 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001690 }
1691 val = 1000;
1692 val = SYS_MS_TO_TICKS(val);
1693 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1694 val, 0) != TX_SUCCESS)
1695 {
1696 /**
1697 * Could not change Join Failure
1698 * timer. Log error.
1699 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001700 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001701 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001702 }
1703 break;
1704#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001705#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001706 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001707 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001708 != TX_SUCCESS)
1709 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001710 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001711 }
1712 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001713#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
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
Siddharth Bhal224da542014-05-28 07:07:46 +05301834 if (NULL == psessionEntry)
1835 {
1836 limLog(pMac, LOGE, FL("%s: received session id NULL."
1837 " Heartbeat timer config failed"), __func__);
1838 return;
1839 }
1840
Yathish9f22e662012-12-10 14:21:35 -08001841#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001842 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1843 return;
Yathish9f22e662012-12-10 14:21:35 -08001844#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001845
Ravi Joshid0699502013-07-08 15:48:47 -07001846 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1847 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001848
Ravi Joshid0699502013-07-08 15:48:47 -07001849 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1850 changing. to avoid this problem, HeartBeat interval is made constant, by
1851 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001852
Ravi Joshid0699502013-07-08 15:48:47 -07001853 //val = psessionEntry->beaconParams.beaconInterval;
1854 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001855
Ravi Joshid0699502013-07-08 15:48:47 -07001856 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1857 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001858
Ravi Joshid0699502013-07-08 15:48:47 -07001859 PELOGW(limLog(pMac,LOGW,
1860 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1861 val1, psessionEntry->beaconParams.beaconInterval,
1862 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001863
Ravi Joshid0699502013-07-08 15:48:47 -07001864 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1865 * enough to judge the peer device inactivity when 32 peers are connected.
1866 * Hence increasing the HB timer timeout to
1867 * HBtimeout = (TBTT * num_beacons * num_peers)
1868 */
1869 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1870 pMac->lim.gLimNumIbssPeers > 0)
1871 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001872 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001873 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001874
Ravi Joshid0699502013-07-08 15:48:47 -07001875 // Change timer to reactivate it in future
1876 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001877
Ravi Joshid0699502013-07-08 15:48:47 -07001878 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1879 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001880
1881} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1882
1883
1884/**---------------------------------------------------------------
1885\fn limReactivateHeartBeatTimer
1886\brief This function s called to deactivate, change and
1887\ activate a timer.
1888\
1889\param pMac - Pointer to Global MAC structure
1890\param psessionEntry
1891\return None
1892------------------------------------------------------------------*/
1893void
1894limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1895{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301896 if (NULL == psessionEntry)
1897 {
1898 limLog(pMac, LOGE, FL("%s: received session id NULL."
1899 " Heartbeat timer config failed"), __func__);
1900 return;
1901 }
1902
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001903 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001904
Yathish9f22e662012-12-10 14:21:35 -08001905#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1906 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001907 {
1908 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001909 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001910 }
Yathish9f22e662012-12-10 14:21:35 -08001911#endif
1912
Jeff Johnson295189b2012-06-20 16:38:30 -07001913 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001914
1915 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001916 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1917 {
1918 /*
1919 * There is increasing need to limit the apps wakeup due to WLAN
1920 * activity. During HB monitoring, the beacons from peer are sent to
1921 * the host causing the host to wakeup. Hence, offloading the HB
1922 * monitoring to LMAC
1923 */
1924 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1925 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1926 {
1927 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1928 {
1929 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1930 }
1931 else
1932 {
1933 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1934 }
1935 }
1936 else
1937 {
1938 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1939 {
1940 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1941 }
1942 else
1943 {
1944 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1945 }
1946 }
1947 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001948 }
1949
1950} /****** end limReactivateHeartBeatTimer() ******/
1951
Jeff Johnson295189b2012-06-20 16:38:30 -07001952
1953/**
1954 * limActivateHearBeatTimer()
1955 *
1956 *
1957 * @brief: This function is called to activate heartbeat timer
1958 *
1959 *LOGIC:
1960 *
1961 *ASSUMPTIONS:
1962 * NA
1963 *
1964 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1965 *
1966 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001967 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001968 *
1969 * @return TX_SUCCESS - timer is activated
1970 * errors - fail to start the timer
1971 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001972v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001973{
1974 v_UINT_t status = TX_TIMER_ERROR;
1975
Yathish9f22e662012-12-10 14:21:35 -08001976#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1977 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001978 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001979#endif
1980
Jeff Johnson295189b2012-06-20 16:38:30 -07001981 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1982 {
1983 //consider 0 interval a ok case
1984 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1985 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001986 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1987 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1988 {
1989 /* HB offload in IBSS mode */
1990 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1991 if (TX_SUCCESS != status)
1992 {
1993 PELOGE(limLog(pMac, LOGE,
1994 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1995 status);)
1996 }
1997 else
1998 {
1999 PELOGE(limLog(pMac, LOGE,
2000 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
2001 __func__);)
2002 }
2003
2004 }
2005 else
2006 {
2007 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2008 if ( TX_SUCCESS != status )
2009 {
2010 PELOGE(limLog(pMac, LOGE,
2011 FL("could not activate Heartbeat timer status(%d)"), status);)
2012 }
2013 else
2014 {
2015 PELOGE(limLog(pMac, LOGW,
2016 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2017 }
2018 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002019 }
2020 else
2021 {
2022 status = TX_SUCCESS;
2023 }
2024 }
2025
2026 return (status);
2027}
2028
2029
2030
2031/**
2032 * limDeactivateAndChangePerStaIdTimer()
2033 *
2034 *
2035 * @brief: This function is called to deactivate and change a per STA timer
2036 * for future re-activation
2037 *
2038 *LOGIC:
2039 *
2040 *ASSUMPTIONS:
2041 * NA
2042 *
2043 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2044 *
2045 * @param pMac - Pointer to Global MAC structure
2046 * @param timerId - enum of timer to be deactivated and changed
2047 * This enum is defined in limUtils.h file
2048 * @param staId - staId
2049 *
2050 * @return None
2051 */
2052
2053void
2054limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2055{
2056 tANI_U32 val;
Jeff Johnson295189b2012-06-20 16:38:30 -07002057
2058 switch (timerId)
2059 {
2060 case eLIM_CNF_WAIT_TIMER:
2061
2062 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2063 != TX_SUCCESS)
2064 {
2065 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002066 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002067
2068 }
2069
2070 // Change timer to reactivate it in future
2071
2072 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2073 &val) != eSIR_SUCCESS)
2074 {
2075 /**
2076 * Could not get cnf timeout value
2077 * from CFG. Log error.
2078 */
2079 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002080 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002081 }
2082 val = SYS_MS_TO_TICKS(val);
2083
2084 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2085 val, val) != TX_SUCCESS)
2086 {
2087 // Could not change cnf timer.
2088 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002089 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002090 }
2091
2092 break;
2093
2094 case eLIM_AUTH_RSP_TIMER:
2095 {
2096 tLimPreAuthNode *pAuthNode;
2097
2098 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2099
2100 if (pAuthNode == NULL)
2101 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002102 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002103 break;
2104 }
2105
2106 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2107 {
2108 // Could not deactivate auth response timer.
2109 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002110 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002111 }
2112
2113 // Change timer to reactivate it in future
2114
2115 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2116 {
2117 /**
2118 * Could not get auth rsp timeout value
2119 * from CFG. Log error.
2120 */
2121 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002122 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002123 }
2124
2125 val = SYS_MS_TO_TICKS(val);
2126
2127 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2128 {
2129 // Could not change auth rsp timer.
2130 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002131 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002132 }
2133 }
2134 break;
2135
Jeff Johnson295189b2012-06-20 16:38:30 -07002136
2137 default:
2138 // Invalid timerId. Log error
2139 break;
2140
2141 }
2142}
2143
2144
2145/**
2146 * limActivateCnfTimer()
2147 *
2148 *FUNCTION:
2149 * This function is called to activate a per STA timer
2150 *
2151 *LOGIC:
2152 *
2153 *ASSUMPTIONS:
2154 * NA
2155 *
2156 *NOTE:
2157 * NA
2158 *
2159 * @param pMac - Pointer to Global MAC structure
2160 * @param StaId - staId
2161 *
2162 * @return None
2163 */
2164
2165void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2166{
Jeff Johnson295189b2012-06-20 16:38:30 -07002167 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2168 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2169 != TX_SUCCESS)
2170 {
2171 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002172 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002173 }
2174}
2175
2176/**
2177 * limActivateAuthRspTimer()
2178 *
2179 *FUNCTION:
2180 * This function is called to activate a per STA timer
2181 *
2182 *LOGIC:
2183 *
2184 *ASSUMPTIONS:
2185 * NA
2186 *
2187 *NOTE:
2188 * NA
2189 *
2190 * @param pMac - Pointer to Global MAC structure
2191 * @param id - id
2192 *
2193 * @return None
2194 */
2195
2196void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2197{
Jeff Johnson295189b2012-06-20 16:38:30 -07002198 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2199 {
2200 /// Could not activate auth rsp timer.
2201 // Log error
2202 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002203 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002204 }
2205}
2206
2207
2208/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002209 * limAssocCnfWaitTmerHandler()
2210 *
2211 *FUNCTION:
2212 * This function post a message to send a disassociate frame out.
2213 *
2214 *LOGIC:
2215 *
2216 *ASSUMPTIONS:
2217 *
2218 *NOTE:
2219 * NA
2220 *
2221 * @param
2222 *
2223 * @return None
2224 */
2225
2226void
2227limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2228{
2229 tSirMsgQ msg;
2230 tANI_U32 statusCode;
2231 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2232
2233 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2234 msg.bodyval = (tANI_U32)param;
2235 msg.bodyptr = NULL;
2236
2237 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2238 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002239 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002240
2241}
2242
2243/**
2244 * limKeepaliveTmerHandler()
2245 *
2246 *FUNCTION:
2247 * This function post a message to send a NULL data frame.
2248 *
2249 *LOGIC:
2250 *
2251 *ASSUMPTIONS:
2252 *
2253 *NOTE:
2254 * NA
2255 *
2256 * @param
2257 *
2258 * @return None
2259 */
2260
2261void
2262limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2263{
2264 tSirMsgQ msg;
2265 tANI_U32 statusCode;
2266 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2267
2268 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2269 msg.bodyval = (tANI_U32)param;
2270 msg.bodyptr = NULL;
2271
2272 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2273 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002274 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002275
2276}
2277
2278void
2279limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2280{
2281 tSirMsgQ msg;
2282 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2283
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302284 limLog(pMac, LOG1,
2285 FL("ChannelSwitch Timer expired. Posting msg to LIM "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002286
2287 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2288 msg.bodyval = (tANI_U32)param;
2289 msg.bodyptr = NULL;
2290
2291 limPostMsgApi(pMac, &msg);
2292}
2293
2294void
2295limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2296{
2297 tSirMsgQ msg;
2298 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2299
2300 msg.type = SIR_LIM_QUIET_TIMEOUT;
2301 msg.bodyval = (tANI_U32)param;
2302 msg.bodyptr = NULL;
2303
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302304 limLog(pMac, LOG1,
2305 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002306 limPostMsgApi(pMac, &msg);
2307}
2308
2309void
2310limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2311{
2312 tSirMsgQ msg;
2313 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2314
2315 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2316 msg.bodyval = (tANI_U32)param;
2317 msg.bodyptr = NULL;
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302318 limLog(pMac, LOG1,
2319 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002320 limPostMsgApi(pMac, &msg);
2321}
Jeff Johnson295189b2012-06-20 16:38:30 -07002322#if 0
2323void
2324limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2325{
2326 tSirMsgQ msg;
2327 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2328
2329 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2330 msg.bodyval = (tANI_U32)param;
2331 msg.bodyptr = NULL;
2332 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002333 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002334 limPostMsgApi(pMac, &msg);
2335}
2336#endif
Yathish9f22e662012-12-10 14:21:35 -08002337
2338#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2339/* ACTIVE_MODE_HB_OFFLOAD */
2340/**
2341 * limMissedBeaconInActiveMode()
2342 *
2343 *FUNCTION:
2344 * This function handle beacon miss indication from FW
2345 * in Active mode.
2346 *
2347 *LOGIC:
2348 *
2349 *ASSUMPTIONS:
2350 * NA
2351 *
2352 *NOTE:
2353 * NA
2354 *
2355 * @param param - Msg Type
2356 *
2357 * @return None
2358 */
2359void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002360limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002361{
2362 tANI_U32 statusCode;
2363 tSirMsgQ msg;
2364 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2365
2366 // Prepare and post message to LIM Message Queue
2367 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002368 {
Yathish9f22e662012-12-10 14:21:35 -08002369 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002370 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002371 msg.bodyval = 0;
2372 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002373 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002374 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2375 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002376 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002377 msg.type, statusCode);
2378 }
2379}
2380#endif