blob: 0237271371290e65032e4834fc99fd1d4cbf3832 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Abhishek Singh3a93ee42016-09-29 17:00:03 +05302 * Copyright (c) 2012-2016 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"
Padma, Santhosh Kumarb036fc72015-11-13 16:22:23 +053043#include "limApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070044
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
Padma, Santhosh Kumarb036fc72015-11-13 16:22:23 +0530791 if ((statusCode = limPostMsgApiHighPri(pMac, &msg)) != eSIR_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700792 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);
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301049 if (pMac->btc.btc_scan_compromise_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001050 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301051 if (pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001052 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301053 val = SYS_MS_TO_TICKS(
1054 pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001055 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1056 }
1057 else
1058 {
1059 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1060 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301061 } else if (pMac->btc.btc_scan_compromise_sco &&
1062 pMac->roam.configParam.min_chntime_btc_sco) {
1063 val = SYS_MS_TO_TICKS(
1064 pMac->roam.configParam.min_chntime_btc_sco);
1065 limLog(pMac, LOG1,
1066 FL("Using BTC SCO Min Active Scan time %d"), val);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001067 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001068 }
1069 else
1070 {
1071 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1072 //No need to change min timer. This is not a scan
1073 break;
1074 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001075#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001076 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001077#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001078
1079 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1080 val, 0) != TX_SUCCESS)
1081 {
1082 // Could not change min channel timer.
1083 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001084 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001085 }
1086
1087 break;
1088
1089 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1090 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1091 != TX_SUCCESS)
1092 {
1093 // Could not deactivate min channel timer.
1094 // Log error
1095 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001096 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001097 }
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301098 if(pMac->lim.gpLimMlmScanReq)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001099 {
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301100 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301101 if (pMac->btc.btc_scan_compromise_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301102 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301103 if (pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301104 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301105 val = SYS_MS_TO_TICKS(
1106 pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)/2;
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301107 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1108 }
1109 else
1110 {
1111 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1112 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301113 } else if (pMac->btc.btc_scan_compromise_sco &&
1114 pMac->roam.configParam.min_chntime_btc_sco) {
1115 val = SYS_MS_TO_TICKS(
1116 pMac->roam.configParam.min_chntime_btc_sco / 2);
1117 limLog(pMac, LOG1,
1118 FL("Using BTC SCO Min Active Scan time %d"), val);
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301119 }
1120 }
1121 /*If val is 0 it means min Channel timer is 0 so take the value from maxChannelTimer*/
1122 if (!val)
1123 {
1124
1125 if(pMac->lim.gpLimMlmScanReq)
1126 {
1127 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime)/2;
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301128 if (pMac->btc.btc_scan_compromise_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301129 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301130 if (pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301131 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301132 val = SYS_MS_TO_TICKS(
1133 pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)/2;
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301134 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1135 }
1136 else
1137 {
1138 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1139 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301140 } else if (pMac->btc.btc_scan_compromise_sco &&
1141 pMac->roam.configParam.max_chntime_btc_sco) {
1142 val = SYS_MS_TO_TICKS(
1143 pMac->roam.configParam.max_chntime_btc_sco / 2);
1144 limLog(pMac, LOG1,
1145 FL("Using BTC SCO Max Active Scan time %d"), val);
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301146 }
1147 }
1148 else
1149 {
1150 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1151 //No need to change max timer. This is not a scan
1152 break;
1153 }
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001154 }
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301155 if (val)
Jeff Johnson295189b2012-06-20 16:38:30 -07001156 {
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301157 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1158 val, 0) != TX_SUCCESS)
1159 {
1160 // Could not change min channel timer.
1161 // Log error
1162 limLog(pMac, LOGE, FL("Unable to change periodic timer"));
1163 }
1164 }
1165 else
1166 {
1167 limLog(pMac, LOGE, FL("Do not change gLimPeriodicProbeReqTimer values,"
1168 "value = %d minchannel time = %d"
1169 "maxchannel time = %d"), val,
1170 pMac->lim.gpLimMlmScanReq->minChannelTime,
1171 pMac->lim.gpLimMlmScanReq->maxChannelTime);
Jeff Johnson295189b2012-06-20 16:38:30 -07001172 }
1173
1174 break;
1175
1176 case eLIM_MAX_CHANNEL_TIMER:
1177 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1178 != TX_SUCCESS)
1179 {
1180 // Could not deactivate max channel timer.
1181 // Log error
1182 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001183 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001184 }
1185
Jeff Johnson295189b2012-06-20 16:38:30 -07001186 // If a background was triggered via Quiet BSS,
1187 // then we need to adjust the MIN and MAX channel
1188 // timer's accordingly to the Quiet duration that
1189 // was specified
1190 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1191 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001192#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001193
1194 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1195 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1196 {
1197 // gLimQuietDuration is already cached in units of
1198 // system ticks. No conversion is reqd...
1199 val = pMac->lim.gLimSpecMgmt.quietDuration;
1200 }
1201 else
1202 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001203#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001204 if(pMac->lim.gpLimMlmScanReq)
1205 {
1206 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301207 if (pMac->btc.btc_scan_compromise_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001208 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301209 if (pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001210 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301211 val = SYS_MS_TO_TICKS(
1212 pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001213 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1214 }
1215 else
1216 {
1217 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1218 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301219 } else if (pMac->btc.btc_scan_compromise_sco &&
1220 pMac->roam.configParam.max_chntime_btc_sco) {
1221 val = SYS_MS_TO_TICKS(
1222 pMac->roam.configParam.max_chntime_btc_sco);
1223 limLog(pMac, LOG1,
1224 FL("Using BTC SCO Max Active Scan time %d"), val);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001225 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001226 }
1227 else
1228 {
1229 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1230 //No need to change max timer. This is not a scan
1231 break;
1232 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001233#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001234 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001235#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001236 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001237
1238 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1239 val, 0) != TX_SUCCESS)
1240 {
1241 // Could not change max channel timer.
1242 // Log error
1243 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001244 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001245 }
1246
1247 break;
1248
1249 case eLIM_JOIN_FAIL_TIMER:
1250 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1251 != TX_SUCCESS)
1252 {
1253 /**
1254 * Could not deactivate Join Failure
1255 * timer. Log error.
1256 */
1257 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001258 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001259 }
1260
1261 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1262 &val) != eSIR_SUCCESS)
1263 {
1264 /**
1265 * Could not get JoinFailureTimeout value
1266 * from CFG. Log error.
1267 */
1268 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001269 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001270 }
1271 val = SYS_MS_TO_TICKS(val);
1272
1273 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1274 val, 0) != TX_SUCCESS)
1275 {
1276 /**
1277 * Could not change Join Failure
1278 * timer. Log error.
1279 */
1280 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001281 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001282 }
1283
1284 break;
1285
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001286 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1287 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1288 != TX_SUCCESS)
1289 {
1290 // Could not deactivate periodic join req Times.
1291 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001292 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001293 }
1294
1295 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1296 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1297 val, 0) != TX_SUCCESS)
1298 {
1299 // Could not change periodic join req times.
1300 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001301 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001302 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001303
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001304 break;
1305
Jeff Johnson295189b2012-06-20 16:38:30 -07001306 case eLIM_AUTH_FAIL_TIMER:
1307 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1308 != TX_SUCCESS)
1309 {
1310 // Could not deactivate Auth failure timer.
1311 // Log error
1312 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001313 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001314 }
1315
1316 // Change timer to reactivate it in future
1317 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1318 &val) != eSIR_SUCCESS)
1319 {
1320 /**
1321 * Could not get AuthFailureTimeout value
1322 * from CFG. Log error.
1323 */
1324 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001325 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001326 }
1327 val = SYS_MS_TO_TICKS(val);
1328
1329 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1330 val, 0) != TX_SUCCESS)
1331 {
1332 // Could not change Authentication failure timer.
1333 // Log error
1334 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001335 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001336 }
1337
1338 break;
1339
Sushant Kaushik9e923872015-04-02 17:09:31 +05301340 case eLIM_AUTH_RETRY_TIMER:
1341
1342 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer)
1343 != TX_SUCCESS)
1344 {
1345 // Could not deactivate Auth Retry Timer.
1346 limLog(pMac, LOGP,
1347 FL("Unable to deactivate Auth Retry timer"));
1348 }
1349 if ((psessionEntry = peFindSessionBySessionId(pMac,
1350 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId))
1351 == NULL)
1352 {
1353 limLog(pMac, LOGP,
1354 FL("session does not exist for given SessionId : %d"),
1355 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId);
1356 break;
1357 }
1358 /* 3/5 of the beacon interval*/
1359 val = psessionEntry->beaconParams.beaconInterval * 3/5;
1360 val = SYS_MS_TO_TICKS(val);
1361 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
1362 val, 0) != TX_SUCCESS)
1363 {
1364 // Could not change Auth Retry timer.
1365 // Log error
1366 limLog(pMac, LOGP, FL("Unable to change Auth Retry timer"));
1367 }
1368
1369 break;
1370
Jeff Johnson295189b2012-06-20 16:38:30 -07001371 case eLIM_ASSOC_FAIL_TIMER:
1372 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1373 TX_SUCCESS)
1374 {
1375 // Could not deactivate Association failure timer.
1376 // Log error
1377 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001378 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 }
1380
1381 // Change timer to reactivate it in future
1382 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1383 &val) != eSIR_SUCCESS)
1384 {
1385 /**
1386 * Could not get AssocFailureTimeout value
1387 * from CFG. Log error.
1388 */
1389 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001390 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001391 }
1392 val = SYS_MS_TO_TICKS(val);
1393
1394 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1395 val, 0) != TX_SUCCESS)
1396 {
1397 // Could not change Association failure timer.
1398 // Log error
1399 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001400 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001401 }
1402
1403 break;
1404
1405 case eLIM_REASSOC_FAIL_TIMER:
1406 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1407 TX_SUCCESS)
1408 {
1409 // Could not deactivate Reassociation failure timer.
1410 // Log error
1411 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001412 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001413 }
1414
1415 // Change timer to reactivate it in future
1416 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1417 &val) != eSIR_SUCCESS)
1418 {
1419 /**
1420 * Could not get ReassocFailureTimeout value
1421 * from CFG. Log error.
1422 */
1423 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001424 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001425 }
1426 val = SYS_MS_TO_TICKS(val);
1427
1428 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1429 val, 0) != TX_SUCCESS)
1430 {
1431 // Could not change Reassociation failure timer.
1432 // Log error
1433 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001434 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001435 }
1436
1437 break;
1438
1439 case eLIM_HEART_BEAT_TIMER:
1440 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1441 TX_SUCCESS)
1442 {
1443 // Could not deactivate Heartbeat timer.
1444 // Log error
1445 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001446 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001447 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001448 else
1449 {
1450 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1451 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001452
1453 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1454 &val) != eSIR_SUCCESS)
1455 {
1456 /**
1457 * Could not get BEACON_INTERVAL value
1458 * from CFG. Log error.
1459 */
1460 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001461 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001462 }
1463
1464 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1465 eSIR_SUCCESS)
1466 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001467 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001468
1469 // Change timer to reactivate it in future
1470 val = SYS_MS_TO_TICKS(val * val1);
1471
1472 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1473 val, 0) != TX_SUCCESS)
1474 {
1475 // Could not change HeartBeat timer.
1476 // Log error
1477 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001478 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001479 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001480 else
1481 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001482 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001483 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001484 break;
1485
1486 case eLIM_PROBE_AFTER_HB_TIMER:
1487 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1488 TX_SUCCESS)
1489 {
1490 // Could not deactivate Heartbeat timer.
1491 // Log error
1492 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001493 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001494 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001495 else
1496 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301497 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001498 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001499
1500 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1501 &val) != eSIR_SUCCESS)
1502 {
1503 /**
1504 * Could not get PROBE_AFTER_HB_FAILURE
1505 * value from CFG. Log error.
1506 */
1507 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001508 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001509 }
1510
1511 // Change timer to reactivate it in future
1512 val = SYS_MS_TO_TICKS(val);
1513
1514 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1515 val, 0) != TX_SUCCESS)
1516 {
1517 // Could not change HeartBeat timer.
1518 // Log error
1519 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001520 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001521 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001522 else
1523 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001524 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001525 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001526
1527 break;
1528
1529 case eLIM_KEEPALIVE_TIMER:
1530 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1531 != TX_SUCCESS)
1532 {
1533 // Could not deactivate Keepalive timer.
1534 // Log error
1535 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001536 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001537 }
1538
1539 // Change timer to reactivate it in future
1540
1541 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1542 &val) != eSIR_SUCCESS)
1543 {
1544 /**
1545 * Could not get keepalive timeout value
1546 * from CFG. Log error.
1547 */
1548 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001549 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001550 }
1551 if (val == 0)
1552 {
1553 val = 3000;
1554 pMac->sch.keepAlive = 0;
1555 } else
1556 pMac->sch.keepAlive = 1;
1557
1558
1559
1560 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1561
1562 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1563 val, val) != TX_SUCCESS)
1564 {
1565 // Could not change KeepaliveTimer timer.
1566 // Log error
1567 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001568 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001569 }
1570
1571 break;
1572
Jeff Johnson295189b2012-06-20 16:38:30 -07001573 case eLIM_BACKGROUND_SCAN_TIMER:
1574 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1575 != TX_SUCCESS)
1576 {
1577 // Could not deactivate BackgroundScanTimer timer.
1578 // Log error
1579 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001580 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001581 }
1582
1583 // Change timer to reactivate it in future
1584 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1585 &val) != eSIR_SUCCESS)
1586 {
1587 /**
1588 * Could not get Background scan period value
1589 * from CFG. Log error.
1590 */
1591 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001592 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001593 }
1594 if (val == 0)
1595 {
1596 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1597 pMac->lim.gLimBackgroundScanDisable = true;
1598 }
1599 else
1600 pMac->lim.gLimBackgroundScanDisable = false;
1601
1602 val = SYS_MS_TO_TICKS(val);
1603
1604 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1605 val, val) != TX_SUCCESS)
1606 {
1607 // Could not change BackgroundScanTimer timer.
1608 // Log error
1609 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001610 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001611 }
1612
1613 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001614
Jeff Johnsone7245742012-09-05 17:12:55 -07001615#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001616 case eLIM_CHANNEL_SWITCH_TIMER:
1617 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1618 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001619 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001620 return;
1621 }
1622
1623 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1624 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1625 0) != TX_SUCCESS)
1626 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001627 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001628 return;
1629 }
1630 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001631#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001632
1633 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001634 break;
1635
Jeff Johnsone7245742012-09-05 17:12:55 -07001636#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001637 case eLIM_QUIET_BSS_TIMER:
1638 if (TX_SUCCESS !=
1639 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1640 {
1641 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001642 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001643 }
1644
1645 // gLimQuietDuration appears to be in units of ticks
1646 // Use it as is
1647 if (TX_SUCCESS !=
1648 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1649 pMac->lim.gLimSpecMgmt.quietDuration,
1650 0))
1651 {
1652 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001653 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001654 }
1655 break;
1656
1657 case eLIM_QUIET_TIMER:
1658 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1659 {
1660 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001661 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001662 }
1663
1664 // Set the NEW timeout value, in ticks
1665 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1666 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1667 {
1668 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001669 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001670 }
1671 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001672#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001673
Jeff Johnson295189b2012-06-20 16:38:30 -07001674#if 0
1675 case eLIM_WPS_OVERLAP_TIMER:
1676 {
1677 // Restart Learn Interval timer
1678
1679 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1680
1681 if (tx_timer_deactivate(
1682 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1683 {
1684 // Could not deactivate Learn Interval timer.
1685 // Log error
1686 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001687 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001688 }
1689
1690 if (tx_timer_change(
1691 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1692 WPSOverlapTimer, 0) != TX_SUCCESS)
1693 {
1694 // Could not change Learn Interval timer.
1695 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001696 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001697
1698 return;
1699 }
1700
1701 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001702 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001703 WPSOverlapTimer);
1704 }
1705 break;
1706#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001707
1708#ifdef WLAN_FEATURE_VOWIFI_11R
1709 case eLIM_FT_PREAUTH_RSP_TIMER:
1710 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1711 {
1712 /**
1713 ** Could not deactivate Join Failure
1714 ** timer. Log error.
1715 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001716 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001717 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001718 }
1719 val = 1000;
1720 val = SYS_MS_TO_TICKS(val);
1721 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1722 val, 0) != TX_SUCCESS)
1723 {
1724 /**
1725 * Could not change Join Failure
1726 * timer. Log error.
1727 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001728 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001729 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001730 }
1731 break;
1732#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001733#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001734 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001735 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001736 != TX_SUCCESS)
1737 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001738 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001739 }
1740 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001741#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301742
1743 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1744 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1745 {
1746 /**
1747 ** Could not deactivate Active to passive channel timer.
1748 ** Log error.
1749 **/
1750 limLog(pMac, LOGP, FL("Unable to Deactivate "
1751 "Active to passive channel timer"));
1752 return;
1753 }
1754 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1755 val = SYS_MS_TO_TICKS(val);
1756 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1757 val, 0) != TX_SUCCESS)
1758 {
1759 /**
1760 * Could not change timer to check scan type for passive channel.
1761 * timer. Log error.
1762 */
1763 limLog(pMac, LOGP, FL("Unable to change timer"));
1764 return;
1765 }
1766 break;
1767
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001768 case eLIM_DISASSOC_ACK_TIMER:
1769 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1770 {
1771 /**
1772 ** Could not deactivate Join Failure
1773 ** timer. Log error.
1774 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001775 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001776 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001777 }
1778 val = 1000;
1779 val = SYS_MS_TO_TICKS(val);
1780 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1781 val, 0) != TX_SUCCESS)
1782 {
1783 /**
1784 * Could not change Join Failure
1785 * timer. Log error.
1786 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001787 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001788 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001789 }
1790 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001791
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001792 case eLIM_DEAUTH_ACK_TIMER:
1793 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1794 {
1795 /**
1796 ** Could not deactivate Join Failure
1797 ** timer. Log error.
1798 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001799 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001800 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001801 }
1802 val = 1000;
1803 val = SYS_MS_TO_TICKS(val);
1804 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1805 val, 0) != TX_SUCCESS)
1806 {
1807 /**
1808 * Could not change Join Failure
1809 * timer. Log error.
1810 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001811 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001812 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001813 }
1814 break;
Viral Modid86bde22012-12-10 13:09:21 -08001815
Viral Modid86bde22012-12-10 13:09:21 -08001816 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1817 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1818 {
1819 /**
1820 ** Could not deactivate SingleShot NOA Insert
1821 ** timer. Log error.
1822 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001823 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001824 return;
1825 }
1826 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1827 val = SYS_MS_TO_TICKS(val);
1828 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1829 val, 0) != TX_SUCCESS)
1830 {
1831 /**
1832 * Could not change Single Shot NOA Insert
1833 * timer. Log error.
1834 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001835 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001836 return;
1837 }
1838 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001839
Jeff Johnson295189b2012-06-20 16:38:30 -07001840 default:
1841 // Invalid timerId. Log error
1842 break;
1843 }
1844} /****** end limDeactivateAndChangeTimer() ******/
1845
1846
1847
1848/**---------------------------------------------------------------
1849\fn limHeartBeatDeactivateAndChangeTimer
1850\brief This function deactivates and changes the heart beat
1851\ timer, eLIM_HEART_BEAT_TIMER.
1852\
1853\param pMac
1854\param psessionEntry
1855\return None
1856------------------------------------------------------------------*/
1857void
1858limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1859{
Ravi Joshid0699502013-07-08 15:48:47 -07001860 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001861
Siddharth Bhal224da542014-05-28 07:07:46 +05301862 if (NULL == psessionEntry)
1863 {
1864 limLog(pMac, LOGE, FL("%s: received session id NULL."
1865 " Heartbeat timer config failed"), __func__);
1866 return;
1867 }
1868
Yathish9f22e662012-12-10 14:21:35 -08001869#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001870 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1871 return;
Yathish9f22e662012-12-10 14:21:35 -08001872#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001873
Ravi Joshid0699502013-07-08 15:48:47 -07001874 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1875 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001876
Ravi Joshid0699502013-07-08 15:48:47 -07001877 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1878 changing. to avoid this problem, HeartBeat interval is made constant, by
1879 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001880
Ravi Joshid0699502013-07-08 15:48:47 -07001881 //val = psessionEntry->beaconParams.beaconInterval;
1882 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001883
Ravi Joshid0699502013-07-08 15:48:47 -07001884 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1885 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001886
Ravi Joshid0699502013-07-08 15:48:47 -07001887 PELOGW(limLog(pMac,LOGW,
1888 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1889 val1, psessionEntry->beaconParams.beaconInterval,
1890 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001891
Ravi Joshid0699502013-07-08 15:48:47 -07001892 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1893 * enough to judge the peer device inactivity when 32 peers are connected.
1894 * Hence increasing the HB timer timeout to
1895 * HBtimeout = (TBTT * num_beacons * num_peers)
1896 */
1897 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1898 pMac->lim.gLimNumIbssPeers > 0)
1899 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001900 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001901 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001902
Ravi Joshid0699502013-07-08 15:48:47 -07001903 // Change timer to reactivate it in future
1904 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001905
Ravi Joshid0699502013-07-08 15:48:47 -07001906 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1907 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001908
1909} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1910
1911
1912/**---------------------------------------------------------------
1913\fn limReactivateHeartBeatTimer
1914\brief This function s called to deactivate, change and
1915\ activate a timer.
1916\
1917\param pMac - Pointer to Global MAC structure
1918\param psessionEntry
1919\return None
1920------------------------------------------------------------------*/
1921void
1922limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1923{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301924 if (NULL == psessionEntry)
1925 {
1926 limLog(pMac, LOGE, FL("%s: received session id NULL."
1927 " Heartbeat timer config failed"), __func__);
1928 return;
1929 }
1930
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001931 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001932
Yathish9f22e662012-12-10 14:21:35 -08001933#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1934 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001935 {
1936 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001937 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001938 }
Yathish9f22e662012-12-10 14:21:35 -08001939#endif
1940
Jeff Johnson295189b2012-06-20 16:38:30 -07001941 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001942
1943 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001944 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1945 {
1946 /*
1947 * There is increasing need to limit the apps wakeup due to WLAN
1948 * activity. During HB monitoring, the beacons from peer are sent to
1949 * the host causing the host to wakeup. Hence, offloading the HB
1950 * monitoring to LMAC
1951 */
1952 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1953 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1954 {
1955 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1956 {
1957 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1958 }
1959 else
1960 {
1961 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1962 }
1963 }
1964 else
1965 {
1966 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1967 {
1968 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1969 }
1970 else
1971 {
1972 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1973 }
1974 }
1975 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001976 }
1977
1978} /****** end limReactivateHeartBeatTimer() ******/
1979
Jeff Johnson295189b2012-06-20 16:38:30 -07001980
1981/**
1982 * limActivateHearBeatTimer()
1983 *
1984 *
1985 * @brief: This function is called to activate heartbeat timer
1986 *
1987 *LOGIC:
1988 *
1989 *ASSUMPTIONS:
1990 * NA
1991 *
1992 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1993 *
1994 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001995 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001996 *
1997 * @return TX_SUCCESS - timer is activated
1998 * errors - fail to start the timer
1999 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002000v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002001{
2002 v_UINT_t status = TX_TIMER_ERROR;
2003
Yathish9f22e662012-12-10 14:21:35 -08002004#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2005 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07002006 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08002007#endif
2008
Jeff Johnson295189b2012-06-20 16:38:30 -07002009 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
2010 {
2011 //consider 0 interval a ok case
2012 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
2013 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002014 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
2015 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
2016 {
2017 /* HB offload in IBSS mode */
2018 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2019 if (TX_SUCCESS != status)
2020 {
2021 PELOGE(limLog(pMac, LOGE,
2022 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
2023 status);)
2024 }
2025 else
2026 {
2027 PELOGE(limLog(pMac, LOGE,
2028 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
2029 __func__);)
2030 }
2031
2032 }
2033 else
2034 {
2035 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2036 if ( TX_SUCCESS != status )
2037 {
2038 PELOGE(limLog(pMac, LOGE,
2039 FL("could not activate Heartbeat timer status(%d)"), status);)
2040 }
2041 else
2042 {
2043 PELOGE(limLog(pMac, LOGW,
2044 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2045 }
2046 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002047 }
2048 else
2049 {
2050 status = TX_SUCCESS;
2051 }
2052 }
2053
2054 return (status);
2055}
2056
2057
2058
2059/**
2060 * limDeactivateAndChangePerStaIdTimer()
2061 *
2062 *
2063 * @brief: This function is called to deactivate and change a per STA timer
2064 * for future re-activation
2065 *
2066 *LOGIC:
2067 *
2068 *ASSUMPTIONS:
2069 * NA
2070 *
2071 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2072 *
2073 * @param pMac - Pointer to Global MAC structure
2074 * @param timerId - enum of timer to be deactivated and changed
2075 * This enum is defined in limUtils.h file
2076 * @param staId - staId
2077 *
2078 * @return None
2079 */
2080
2081void
2082limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2083{
2084 tANI_U32 val;
Jeff Johnson295189b2012-06-20 16:38:30 -07002085
2086 switch (timerId)
2087 {
2088 case eLIM_CNF_WAIT_TIMER:
2089
2090 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2091 != TX_SUCCESS)
2092 {
2093 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002094 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002095
2096 }
2097
2098 // Change timer to reactivate it in future
2099
2100 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2101 &val) != eSIR_SUCCESS)
2102 {
2103 /**
2104 * Could not get cnf timeout value
2105 * from CFG. Log error.
2106 */
2107 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002108 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002109 }
2110 val = SYS_MS_TO_TICKS(val);
2111
2112 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2113 val, val) != TX_SUCCESS)
2114 {
2115 // Could not change cnf timer.
2116 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002117 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002118 }
2119
2120 break;
2121
2122 case eLIM_AUTH_RSP_TIMER:
2123 {
2124 tLimPreAuthNode *pAuthNode;
2125
2126 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2127
2128 if (pAuthNode == NULL)
2129 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002130 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002131 break;
2132 }
2133
2134 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2135 {
2136 // Could not deactivate auth response timer.
2137 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002138 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002139 }
2140
2141 // Change timer to reactivate it in future
2142
2143 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2144 {
2145 /**
2146 * Could not get auth rsp timeout value
2147 * from CFG. Log error.
2148 */
2149 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002150 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002151 }
2152
2153 val = SYS_MS_TO_TICKS(val);
2154
2155 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2156 {
2157 // Could not change auth rsp timer.
2158 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002159 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002160 }
2161 }
2162 break;
2163
Jeff Johnson295189b2012-06-20 16:38:30 -07002164
2165 default:
2166 // Invalid timerId. Log error
2167 break;
2168
2169 }
2170}
2171
2172
2173/**
2174 * limActivateCnfTimer()
2175 *
2176 *FUNCTION:
2177 * This function is called to activate a per STA timer
2178 *
2179 *LOGIC:
2180 *
2181 *ASSUMPTIONS:
2182 * NA
2183 *
2184 *NOTE:
2185 * NA
2186 *
2187 * @param pMac - Pointer to Global MAC structure
2188 * @param StaId - staId
2189 *
2190 * @return None
2191 */
2192
2193void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2194{
Jeff Johnson295189b2012-06-20 16:38:30 -07002195 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2196 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2197 != TX_SUCCESS)
2198 {
2199 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002200 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002201 }
2202}
2203
2204/**
2205 * limActivateAuthRspTimer()
2206 *
2207 *FUNCTION:
2208 * This function is called to activate a per STA timer
2209 *
2210 *LOGIC:
2211 *
2212 *ASSUMPTIONS:
2213 * NA
2214 *
2215 *NOTE:
2216 * NA
2217 *
2218 * @param pMac - Pointer to Global MAC structure
2219 * @param id - id
2220 *
2221 * @return None
2222 */
2223
2224void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2225{
Jeff Johnson295189b2012-06-20 16:38:30 -07002226 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2227 {
2228 /// Could not activate auth rsp timer.
2229 // Log error
2230 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002231 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002232 }
2233}
2234
2235
2236/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002237 * limAssocCnfWaitTmerHandler()
2238 *
2239 *FUNCTION:
2240 * This function post a message to send a disassociate frame out.
2241 *
2242 *LOGIC:
2243 *
2244 *ASSUMPTIONS:
2245 *
2246 *NOTE:
2247 * NA
2248 *
2249 * @param
2250 *
2251 * @return None
2252 */
2253
2254void
2255limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2256{
2257 tSirMsgQ msg;
2258 tANI_U32 statusCode;
2259 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2260
2261 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2262 msg.bodyval = (tANI_U32)param;
2263 msg.bodyptr = NULL;
2264
2265 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2266 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002267 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002268
2269}
2270
2271/**
2272 * limKeepaliveTmerHandler()
2273 *
2274 *FUNCTION:
2275 * This function post a message to send a NULL data frame.
2276 *
2277 *LOGIC:
2278 *
2279 *ASSUMPTIONS:
2280 *
2281 *NOTE:
2282 * NA
2283 *
2284 * @param
2285 *
2286 * @return None
2287 */
2288
2289void
2290limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2291{
2292 tSirMsgQ msg;
2293 tANI_U32 statusCode;
2294 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2295
2296 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2297 msg.bodyval = (tANI_U32)param;
2298 msg.bodyptr = NULL;
2299
2300 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2301 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002302 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002303
2304}
2305
2306void
2307limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2308{
2309 tSirMsgQ msg;
2310 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2311
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302312 limLog(pMac, LOG1,
2313 FL("ChannelSwitch Timer expired. Posting msg to LIM "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002314
2315 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2316 msg.bodyval = (tANI_U32)param;
2317 msg.bodyptr = NULL;
2318
2319 limPostMsgApi(pMac, &msg);
2320}
2321
2322void
2323limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2324{
2325 tSirMsgQ msg;
2326 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2327
2328 msg.type = SIR_LIM_QUIET_TIMEOUT;
2329 msg.bodyval = (tANI_U32)param;
2330 msg.bodyptr = NULL;
2331
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302332 limLog(pMac, LOG1,
2333 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002334 limPostMsgApi(pMac, &msg);
2335}
2336
2337void
2338limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2339{
2340 tSirMsgQ msg;
2341 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2342
2343 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2344 msg.bodyval = (tANI_U32)param;
2345 msg.bodyptr = NULL;
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302346 limLog(pMac, LOG1,
2347 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002348 limPostMsgApi(pMac, &msg);
2349}
Jeff Johnson295189b2012-06-20 16:38:30 -07002350#if 0
2351void
2352limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2353{
2354 tSirMsgQ msg;
2355 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2356
2357 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2358 msg.bodyval = (tANI_U32)param;
2359 msg.bodyptr = NULL;
2360 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002361 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002362 limPostMsgApi(pMac, &msg);
2363}
2364#endif
Yathish9f22e662012-12-10 14:21:35 -08002365
2366#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2367/* ACTIVE_MODE_HB_OFFLOAD */
2368/**
2369 * limMissedBeaconInActiveMode()
2370 *
2371 *FUNCTION:
2372 * This function handle beacon miss indication from FW
2373 * in Active mode.
2374 *
2375 *LOGIC:
2376 *
2377 *ASSUMPTIONS:
2378 * NA
2379 *
2380 *NOTE:
2381 * NA
2382 *
2383 * @param param - Msg Type
2384 *
2385 * @return None
2386 */
2387void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002388limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002389{
2390 tANI_U32 statusCode;
2391 tSirMsgQ msg;
2392 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2393
2394 // Prepare and post message to LIM Message Queue
2395 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002396 {
Yathish9f22e662012-12-10 14:21:35 -08002397 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002398 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002399 msg.bodyval = 0;
2400 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002401 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002402 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2403 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002404 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002405 msg.type, statusCode);
2406 }
2407}
2408#endif