blob: 71c7dde0980afd77d7f0ded735adac5e2d1c65f5 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +05302 * Copyright (c) 2012-2017 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
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +053067#ifdef WLAN_FEATURE_LFR_MBB
68#define PREAUTH_REASSOC_TIMEOUT 500
69#endif
70
Jeff Johnson295189b2012-06-20 16:38:30 -070071/**
72 * limCreateTimers()
73 *
74 *FUNCTION:
75 * This function is called upon receiving
76 * 1. SME_START_REQ for STA in ESS role
77 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
78 *
79 *LOGIC:
80 *
81 *ASSUMPTIONS:
82 * NA
83 *
84 *NOTE:
85 * NA
86 *
87 * @param pMac - Pointer to Global MAC structure
88 *
89 * @return None
90 */
91
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070092v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070093limCreateTimers(tpAniSirGlobal pMac)
94{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070095 tANI_U32 cfgValue, i=0;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -080096 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -070097
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070098 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -070099
100 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
101 &cfgValue) != eSIR_SUCCESS)
102 {
103 /**
104 * Could not get MinChannelTimeout value
105 * from CFG. Log error.
106 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700107 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700108 }
109 cfgValue = SYS_MS_TO_TICKS(cfgValue);
110
111 // Create MIN/MAX channel timers and activate them later
112 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
113 "MIN CHANNEL TIMEOUT",
114 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
115 cfgValue, 0,
116 TX_NO_ACTIVATE) != TX_SUCCESS)
117 {
118 /// Could not start min channel timer.
119 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700120 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700121 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700122 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700123 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700124
125 /* Periodic probe request timer value is half of the Min channel
126 * timer. Probe request sends periodically till min/max channel
127 * timer expires
128 */
129
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800130 cfgValue1 = cfgValue/2 ;
131 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 {
133 // Create periodic probe request timer and activate them later
134 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
135 "Periodic Probe Request Timer",
136 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800137 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700138 TX_NO_ACTIVATE) != TX_SUCCESS)
139 {
140 /// Could not start Periodic Probe Req timer.
141 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700142 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700143 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700144 }
145 }
146
147
148 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
149 &cfgValue) != eSIR_SUCCESS)
150 {
151 /**
152 * Could not get MAXChannelTimeout value
153 * from CFG. Log error.
154 */
155 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700156 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700157 }
158 cfgValue = SYS_MS_TO_TICKS(cfgValue);
159
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800160 /* Limiting max numm of probe req for each channel scan */
161 pMac->lim.maxProbe = (cfgValue/cfgValue1);
162
Jeff Johnson295189b2012-06-20 16:38:30 -0700163 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
164 "MAX CHANNEL TIMEOUT",
165 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
166 cfgValue, 0,
167 TX_NO_ACTIVATE) != TX_SUCCESS)
168 {
169 /// Could not start max channel timer.
170 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700171 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700172
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700173 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700174 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700175 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700176
177 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
178 {
179 // Create Channel Switch Timer
180 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
181 "CHANNEL SWITCH TIMER",
182 limChannelSwitchTimerHandler,
183 0, // expiration_input
184 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
185 0, // reschedule_ticks
186 TX_NO_ACTIVATE) != TX_SUCCESS)
187 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700188 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700189 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700190 }
191
192 //
193 // Create Quiet Timer
194 // This is used on the STA to go and shut-off
195 // Tx/Rx "after" the specified quiteInterval
196 //
197 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
198 "QUIET TIMER",
199 limQuietTimerHandler,
200 SIR_LIM_QUIET_TIMEOUT, // expiration_input
201 LIM_QUIET_TIMER_TICKS, // initial_ticks
202 0, // reschedule_ticks
203 TX_NO_ACTIVATE) != TX_SUCCESS)
204 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700205 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700206 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700207 }
208
209 //
210 // Create Quiet BSS Timer
211 // After the specified quiteInterval, determined by
212 // gLimQuietTimer, this timer, gLimQuietBssTimer,
213 // trigger and put the STA to sleep for the specified
214 // gLimQuietDuration
215 //
216 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
217 "QUIET BSS TIMER",
218 limQuietBssTimerHandler,
219 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
220 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
221 0, // reschedule_ticks
222 TX_NO_ACTIVATE) != TX_SUCCESS)
223 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700224 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700225 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700226 }
227
228 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
229 &cfgValue) != eSIR_SUCCESS)
230 {
231 /**
232 * Could not get JoinFailureTimeout value
233 * from CFG. Log error.
234 */
235 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700236 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700237 }
238 cfgValue = SYS_MS_TO_TICKS(cfgValue);
239
240 // Create Join failure timer and activate it later
241 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
242 "JOIN FAILURE TIMEOUT",
243 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
244 cfgValue, 0,
245 TX_NO_ACTIVATE) != TX_SUCCESS)
246 {
247 /// Could not create Join failure timer.
248 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700249 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700250
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700251 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700252 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800253
Jeff Johnson62c27982013-02-27 17:53:55 -0800254 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800255 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
256 "Periodic Join Probe Request Timer",
257 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
258 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
259 TX_NO_ACTIVATE)) != TX_SUCCESS)
260 {
261 /// Could not create Periodic Join Probe Request timer.
262 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700263 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800264 goto err_timer;
265 }
Sushant Kaushik9e923872015-04-02 17:09:31 +0530266 //Send Auth frame every 60 ms
267 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
268 "Periodic AUTH Timer",
269 limTimerHandler, SIR_LIM_AUTH_RETRY_TIMEOUT,
270 SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0,
271 TX_NO_ACTIVATE)) != TX_SUCCESS)
272 {
273 /// Could not create Periodic Join Probe Request timer.
274 // Log error
275 limLog(pMac, LOGP, FL("could not create Periodic AUTH Timer timer"));
276 goto err_timer;
277 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700278 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
279 &cfgValue) != eSIR_SUCCESS)
280 {
281 /**
282 * Could not get AssocFailureTimeout value
283 * from CFG. Log error.
284 */
285 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700286 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700287 }
288 cfgValue = SYS_MS_TO_TICKS(cfgValue);
289
290 // Create Association failure timer and activate it later
291 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
292 "ASSOC FAILURE TIMEOUT",
293 limAssocFailureTimerHandler, LIM_ASSOC,
294 cfgValue, 0,
295 TX_NO_ACTIVATE) != TX_SUCCESS)
296 {
297 /// Could not create Assoc failure timer.
298 // Log error
299 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700300 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700301
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700302 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700303 }
304 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
305 &cfgValue) != eSIR_SUCCESS)
306 {
307 /**
308 * Could not get ReassocFailureTimeout value
309 * from CFG. Log error.
310 */
311 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700312 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700313 }
314 cfgValue = SYS_MS_TO_TICKS(cfgValue);
315
316 // Create Association failure timer and activate it later
317 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
318 "REASSOC FAILURE TIMEOUT",
319 limAssocFailureTimerHandler, LIM_REASSOC,
320 cfgValue, 0,
321 TX_NO_ACTIVATE) != TX_SUCCESS)
322 {
323 /// Could not create Reassoc failure timer.
324 // Log error
325 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700326 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700327
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700328 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700329 }
330
331 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700332 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700333
334 cfgValue = SYS_MS_TO_TICKS(cfgValue);
335
336 // Create Addts response timer and activate it later
337 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
338 "ADDTS RSP TIMEOUT",
339 limAddtsResponseTimerHandler,
340 SIR_LIM_ADDTS_RSP_TIMEOUT,
341 cfgValue, 0,
342 TX_NO_ACTIVATE) != TX_SUCCESS)
343 {
344 /// Could not create Auth failure timer.
345 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700346 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700347
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700348 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700349 }
350
351 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
352 &cfgValue) != eSIR_SUCCESS)
353 {
354 /**
355 * Could not get AuthFailureTimeout value
356 * from CFG. Log error.
357 */
358 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700359 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700360 }
361 cfgValue = SYS_MS_TO_TICKS(cfgValue);
362
363 // Create Auth failure timer and activate it later
364 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
365 "AUTH FAILURE TIMEOUT",
366 limTimerHandler,
367 SIR_LIM_AUTH_FAIL_TIMEOUT,
368 cfgValue, 0,
369 TX_NO_ACTIVATE) != TX_SUCCESS)
370 {
371 /// Could not create Auth failure timer.
372 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700373 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700374
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700375 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700376 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800377
Jeff Johnson295189b2012-06-20 16:38:30 -0700378 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
379 &cfgValue) != eSIR_SUCCESS)
380 {
381 /**
382 * Could not get BEACON_INTERVAL value
383 * from CFG. Log error.
384 */
385 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700386 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700387 }
388 cfgValue = SYS_MS_TO_TICKS(cfgValue);
389
390 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
391 "Heartbeat TIMEOUT",
392 limTimerHandler,
393 SIR_LIM_HEART_BEAT_TIMEOUT,
394 cfgValue,
395 0,
396 TX_NO_ACTIVATE) != TX_SUCCESS)
397 {
398 /// Could not start Heartbeat timer.
399 // Log error
400 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700401 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700402 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700403 }
404
405 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
406 &cfgValue) != eSIR_SUCCESS)
407 {
408 /**
409 * Could not get PROBE_AFTER_HB_FAILURE
410 * value from CFG. Log error.
411 */
412 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700413 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700414 }
415
416 // Change timer to reactivate it in future
417 cfgValue = SYS_MS_TO_TICKS(cfgValue);
418
419 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
420 "Probe after Heartbeat TIMEOUT",
421 limTimerHandler,
422 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
423 cfgValue,
424 0,
425 TX_NO_ACTIVATE) != TX_SUCCESS)
426 {
427 // Could not creat wt-probe-after-HeartBeat-failure timer.
428 // Log error
429 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700430 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700431 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700432 }
433
Jeff Johnson295189b2012-06-20 16:38:30 -0700434 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
435 &cfgValue) != eSIR_SUCCESS)
436 {
437 /**
438 * Could not get Background scan period value
439 * from CFG. Log error.
440 */
441 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700442 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700443 }
444
445 /*
446 * setting period to zero means disabling background scans when associated
447 * the way we do this is to set a flag indicating this and keeping
448 * the timer running, since it will be used for PDU leak workarounds
449 * as well as background scanning during SME idle states
450 */
451 if (cfgValue == 0)
452 {
453 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
454 pMac->lim.gLimBackgroundScanDisable = true;
455 }
456 else
457 pMac->lim.gLimBackgroundScanDisable = false;
458
459 cfgValue = SYS_MS_TO_TICKS(cfgValue);
460
461 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
462 "Background scan TIMEOUT",
463 limTimerHandler,
464 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
465 cfgValue,
466 cfgValue,
467 TX_NO_ACTIVATE) != TX_SUCCESS)
468 {
469 /// Could not start background scan timer.
470 // Log error
471 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700472 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700473 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700474 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700475 }
476
Jeff Johnson295189b2012-06-20 16:38:30 -0700477 /**
478 * Create keepalive timer and activate it right away for AP role
479 */
480
481 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
482 &cfgValue) != eSIR_SUCCESS)
483 {
484 /**
485 * Could not get keepalive timeout value
486 * from CFG. Log error.
487 */
488 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700489 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700490 }
491
492 // A value of zero implies keep alive should be disabled
493 if (cfgValue == 0)
494 {
495 cfgValue = LIM_KEEPALIVE_TIMER_MS;
496 pMac->sch.keepAlive = 0;
497 } else
498 pMac->sch.keepAlive = 1;
499
500
501 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
502
503 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
504 "KEEPALIVE_TIMEOUT",
505 limKeepaliveTmerHandler,
506 0,
507 cfgValue,
508 cfgValue,
509 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
510 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
511 != TX_SUCCESS)
512 {
513 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700514 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700515 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700516 }
517
518 /**
519 * Create all CNF_WAIT Timers upfront
520 */
521
522 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
523 &cfgValue) != eSIR_SUCCESS)
524 {
525 /**
526 * Could not get CNF_WAIT timeout value
527 * from CFG. Log error.
528 */
529 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700530 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700531 }
532 cfgValue = SYS_MS_TO_TICKS(cfgValue);
533
534 for (i=0; i<pMac->lim.maxStation; i++)
535 {
536 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
537 "CNF_MISS_TIMEOUT",
538 limCnfWaitTmerHandler,
539 (tANI_U32)i,
540 cfgValue,
541 0,
542 TX_NO_ACTIVATE) != TX_SUCCESS)
543 {
544 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700545 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700546 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700547 }
548 }
549
550 /*
551 ** Alloc and init table for the preAuth timer list
552 **
553 **/
554
555 // get max number of Preauthentication
556 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
557 &cfgValue) != eSIR_SUCCESS)
558 {
559 /*
560 ** Could not get max preauth value
561 ** from CFG. Log error.
562 **/
563 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700564 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700565 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700566 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530567 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_vmalloc(cfgValue*sizeof(tLimPreAuthNode));
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530568 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700569 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530570 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700571 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700572 }
573
574 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700575 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700576
577
Jeff Johnson295189b2012-06-20 16:38:30 -0700578 {
579 /**
580 * Create OLBC cache aging timer
581 */
582 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
583 &cfgValue) != eSIR_SUCCESS)
584 {
585 /**
586 * Could not get OLBC detect timeout value
587 * from CFG. Log error.
588 */
589 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700590 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700591 }
592
593 cfgValue = SYS_MS_TO_TICKS(cfgValue);
594
595 if (tx_timer_create(
596 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
597 "OLBC UPDATE CACHE TIMEOUT",
598 limUpdateOlbcCacheTimerHandler,
599 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
600 cfgValue,
601 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700602 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700603 {
604 // Cannot create update OLBC cache timer
605 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700606 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700607 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700608 }
609 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700610#ifdef WLAN_FEATURE_VOWIFI_11R
611 // In future we need to use the auth timer, cause
612 // the pre auth session will be introduced before sending
613 // Auth frame.
614 // We need to go off channel and come back to home channel
615 cfgValue = 1000;
616 cfgValue = SYS_MS_TO_TICKS(cfgValue);
617
618 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
619 "FT PREAUTH RSP TIMEOUT",
620 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
621 cfgValue, 0,
622 TX_NO_ACTIVATE) != TX_SUCCESS)
623 {
624 // Could not create Join failure timer.
625 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700626 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700627 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700628 }
629#endif
630
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530631#ifdef WLAN_FEATURE_LFR_MBB
632 cfgValue = PREAUTH_REASSOC_TIMEOUT;
633 cfgValue = SYS_MS_TO_TICKS(cfgValue);
634
635 if (tx_timer_create(&pMac->lim.limTimers.glim_pre_auth_mbb_rsp_timer,
636 "PREAUTH MBB RSP TIMEOUT",
637 limTimerHandler, SIR_LIM_PREAUTH_MBB_RSP_TIMEOUT,
638 cfgValue, 0,
639 TX_NO_ACTIVATE) != TX_SUCCESS)
640 {
641 limLog(pMac, LOGP, FL("could not create PREAUTH_MBB_RSP timer"));
642 goto err_timer;
643 }
644#endif
645
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800646#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700647 cfgValue = 5000;
648 cfgValue = SYS_MS_TO_TICKS(cfgValue);
649
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800650 if (tx_timer_create(&pMac->lim.limTimers.gLimEseTsmTimer,
651 "ESE TSM Stats TIMEOUT",
652 limTimerHandler, SIR_LIM_ESE_TSM_TIMEOUT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700653 cfgValue, 0,
654 TX_NO_ACTIVATE) != TX_SUCCESS)
655 {
656 // Could not create Join failure timer.
657 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700658 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700659 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700660 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800661#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700662
Jeff Johnson295189b2012-06-20 16:38:30 -0700663 cfgValue = 1000;
664 cfgValue = SYS_MS_TO_TICKS(cfgValue);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800665 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
666 "DISASSOC ACK TIMEOUT",
667 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
668 cfgValue, 0,
669 TX_NO_ACTIVATE) != TX_SUCCESS)
670 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700671 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800672 goto err_timer;
673 }
674
675 cfgValue = 1000;
676 cfgValue = SYS_MS_TO_TICKS(cfgValue);
677 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
678 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800679 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800680 cfgValue, 0,
681 TX_NO_ACTIVATE) != TX_SUCCESS)
682 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700683 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800684 goto err_timer;
685 }
Viral Modid86bde22012-12-10 13:09:21 -0800686
Viral Modid86bde22012-12-10 13:09:21 -0800687 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)
688 cfgValue = SYS_MS_TO_TICKS(cfgValue);
689 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
690 "Single Shot NOA Insert timeout",
691 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
692 cfgValue, 0,
693 TX_NO_ACTIVATE) != TX_SUCCESS)
694 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700695 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800696 goto err_timer;
697 }
Viral Modid86bde22012-12-10 13:09:21 -0800698
Hanumantha Reddy Pothula97ea0952015-10-09 11:29:39 +0530699 cfgValue = WNI_CFG_ACTIVE_PASSIVE_CON_MAX;
700 if (eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_PASSIVE_CON,
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530701 &cfgValue))
702 {
703 limLog(pMac, LOGP,
704 FL("could not retrieve WNI_CFG_ACTIVE_PASSIVE_CON"));
705 }
706 if (cfgValue)
707 {
708 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
709 cfgValue = SYS_MS_TO_TICKS(cfgValue);
710 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530711 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
712 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
713 TX_NO_ACTIVATE) != TX_SUCCESS)
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530714 {
715 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
716 goto err_timer;
717 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530718 }
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530719 else
720 {
721 limLog(pMac, LOG1,
722 FL("gLimActiveToPassiveChannelTimer not created %d"), cfgValue);
723 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530724
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700725 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700726
727 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800728 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800729 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800730#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
731 tx_timer_delete(&pMac->lim.limTimers.gLimEseTsmTimer);
732#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700733 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530734#ifdef WLAN_FEATURE_LFR_MBB
735 tx_timer_delete(&pMac->lim.limTimers.glim_pre_auth_mbb_rsp_timer);
736#endif
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700737 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
738 while(((tANI_S32)--i) >= 0)
739 {
740 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
741 }
742 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700743 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
744 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
745 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
746 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
747 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
748 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
749 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800750 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800751 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Sushant Kaushik9e923872015-04-02 17:09:31 +0530752 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700753 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
754 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
755 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
756 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
757 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
758 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800759 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530760 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700761
762 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800763 {
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530764 vos_mem_vfree(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800765 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
766 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700767
768 return TX_TIMER_ERROR;
769
Jeff Johnson295189b2012-06-20 16:38:30 -0700770} /****** end limCreateTimers() ******/
771
772
773
774/**
775 * limTimerHandler()
776 *
777 *FUNCTION:
778 * This function is called upon
779 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
780 * 2. JOIN_FAILURE timer expiration while joining a BSS
781 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
782 * 4. Heartbeat timer expiration on STA
783 * 5. Background scan timer expiration on STA
784 * 6. AID release, Pre-auth cleanup and Link monitoring timer
785 * expiration on AP
786 *
787 *LOGIC:
788 *
789 *ASSUMPTIONS:
790 * NA
791 *
792 *NOTE:
793 * NA
794 *
795 * @param param - Message corresponding to the timer that expired
796 *
797 * @return None
798 */
799
800void
801limTimerHandler(void *pMacGlobal, tANI_U32 param)
802{
803 tANI_U32 statusCode;
804 tSirMsgQ msg;
805 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
806
807 // Prepare and post message to LIM Message Queue
808
809 msg.type = (tANI_U16) param;
810 msg.bodyptr = NULL;
811 msg.bodyval = 0;
812
Padma, Santhosh Kumarb036fc72015-11-13 16:22:23 +0530813 if ((statusCode = limPostMsgApiHighPri(pMac, &msg)) != eSIR_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700814 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700815 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700816 msg.type, statusCode);
817} /****** end limTimerHandler() ******/
818
819
820/**
821 * limAddtsResponseTimerHandler()
822 *
823 *FUNCTION:
824 * This function is called upon Addts response timer expiration on sta
825 *
826 *LOGIC:
827 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
828 * when this function is executed.
829 *
830 *ASSUMPTIONS:
831 * NA
832 *
833 *NOTE:
834 * NA
835 *
836 * @param param - pointer to pre-auth node
837 *
838 * @return None
839 */
840
841void
842limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
843{
844 tSirMsgQ msg;
845 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
846
847 // Prepare and post message to LIM Message Queue
848
849 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
850 msg.bodyval = param;
851 msg.bodyptr = NULL;
852
853 limPostMsgApi(pMac, &msg);
854} /****** end limAuthResponseTimerHandler() ******/
855
856
857/**
858 * limAuthResponseTimerHandler()
859 *
860 *FUNCTION:
861 * This function is called upon Auth response timer expiration on AP
862 *
863 *LOGIC:
864 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
865 * when this function is executed.
866 *
867 *ASSUMPTIONS:
868 * NA
869 *
870 *NOTE:
871 * NA
872 *
873 * @param param - pointer to pre-auth node
874 *
875 * @return None
876 */
877
878void
879limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
880{
881 tSirMsgQ msg;
882 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
883
884 // Prepare and post message to LIM Message Queue
885
886 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
887 msg.bodyptr = NULL;
888 msg.bodyval = (tANI_U32)param;
889
890 limPostMsgApi(pMac, &msg);
891} /****** end limAuthResponseTimerHandler() ******/
892
893
894
895/**
896 * limAssocFailureTimerHandler()
897 *
898 *FUNCTION:
899 * This function is called upon Re/Assoc failure timer expiration
900 * on STA
901 *
902 *LOGIC:
903 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
904 * when this function is executed.
905 *
906 *ASSUMPTIONS:
907 * NA
908 *
909 *NOTE:
910 * NA
911 *
912 * @param param - Indicates whether this is assoc or reassoc
913 * failure timeout
914 * @return None
915 */
916
917void
918limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
919{
920 tSirMsgQ msg;
921 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
922
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800923#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700924 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530925 (NULL != pMac->lim.pSessionEntry) &&
926 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700927 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700928 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Sachin Ahuja07a43012015-01-30 17:04:38 +0530929#ifdef FEATURE_WLAN_ESE
930 if (((pMac->lim.pSessionEntry->isESEconnection) &&
931 (pMac->lim.reAssocRetryAttempt <
932 (LIM_MAX_REASSOC_RETRY_LIMIT - 1)))||
933 ((!pMac->lim.pSessionEntry->isESEconnection) &&
934 (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT))
935 )
936#else
937 if (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
938#endif
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700939 {
940 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
941 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700942 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700943 return;
944 }
945 else
946 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700947 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700948 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
949 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530950 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700951 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
952 }
953 }
954 }
955#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700956 // Prepare and post message to LIM Message Queue
957
958 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
959 msg.bodyval = (tANI_U32)param;
960 msg.bodyptr = NULL;
961
962 limPostMsgApi(pMac, &msg);
963} /****** end limAssocFailureTimerHandler() ******/
964
965
966/**
967 * limUpdateOlbcCacheTimerHandler()
968 *
969 *FUNCTION:
970 * This function is called upon update olbc cache timer expiration
971 * on STA
972 *
973 *LOGIC:
974 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
975 * when this function is executed.
976 *
977 *ASSUMPTIONS:
978 * NA
979 *
980 *NOTE:
981 * NA
982 *
983 * @param
984 *
985 * @return None
986 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700987void
988limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
989{
990 tSirMsgQ msg;
991 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
992
993 // Prepare and post message to LIM Message Queue
994
995 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
996 msg.bodyval = 0;
997 msg.bodyptr = NULL;
998
999 limPostMsgApi(pMac, &msg);
1000} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -07001001
1002/**
1003 * limDeactivateAndChangeTimer()
1004 *
1005 *FUNCTION:
1006 * This function is called to deactivate and change a timer
1007 * for future re-activation
1008 *
1009 *LOGIC:
1010 *
1011 *ASSUMPTIONS:
1012 * NA
1013 *
1014 *NOTE:
1015 * NA
1016 *
1017 * @param pMac - Pointer to Global MAC structure
1018 * @param timerId - enum of timer to be deactivated and changed
1019 * This enum is defined in limUtils.h file
1020 *
1021 * @return None
1022 */
1023
1024void
1025limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1026{
1027 tANI_U32 val=0, val1=0;
Sushant Kaushik9e923872015-04-02 17:09:31 +05301028 tpPESession psessionEntry;
Jeff Johnson295189b2012-06-20 16:38:30 -07001029
Jeff Johnson295189b2012-06-20 16:38:30 -07001030 switch (timerId)
1031 {
1032 case eLIM_ADDTS_RSP_TIMER:
1033 pMac->lim.gLimAddtsRspTimerCount++;
1034 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1035 {
1036 // Could not deactivate AddtsRsp Timer
1037 // Log error
1038 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001039 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001040 }
1041 break;
1042
1043 case eLIM_MIN_CHANNEL_TIMER:
1044 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1045 != TX_SUCCESS)
1046 {
1047 // Could not deactivate min channel timer.
1048 // Log error
1049 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001050 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001051 }
1052
Jeff Johnsone7245742012-09-05 17:12:55 -07001053#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001054 // If a background was triggered via Quiet BSS,
1055 // then we need to adjust the MIN and MAX channel
1056 // timer's accordingly to the Quiet duration that
1057 // was specified
1058 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1059 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1060 {
1061 // gLimQuietDuration is already cached in units of
1062 // system ticks. No conversion is reqd...
1063 val = pMac->lim.gLimSpecMgmt.quietDuration;
1064 }
1065 else
1066 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001067#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001068 if(pMac->lim.gpLimMlmScanReq)
1069 {
1070 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301071 if (pMac->btc.btc_scan_compromise_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001072 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301073 if (pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001074 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301075 val = SYS_MS_TO_TICKS(
1076 pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001077 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1078 }
1079 else
1080 {
1081 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1082 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301083 } else if (pMac->btc.btc_scan_compromise_sco &&
1084 pMac->roam.configParam.min_chntime_btc_sco) {
1085 val = SYS_MS_TO_TICKS(
1086 pMac->roam.configParam.min_chntime_btc_sco);
1087 limLog(pMac, LOG1,
1088 FL("Using BTC SCO Min Active Scan time %d"), val);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001089 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001090 }
1091 else
1092 {
1093 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1094 //No need to change min timer. This is not a scan
1095 break;
1096 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001097#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001098 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001099#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001100
1101 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1102 val, 0) != TX_SUCCESS)
1103 {
1104 // Could not change min channel timer.
1105 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001106 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001107 }
1108
1109 break;
1110
1111 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1112 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1113 != TX_SUCCESS)
1114 {
1115 // Could not deactivate min channel timer.
1116 // Log error
1117 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001118 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001119 }
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301120 if(pMac->lim.gpLimMlmScanReq)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001121 {
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301122 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301123 if (pMac->btc.btc_scan_compromise_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301124 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301125 if (pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301126 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301127 val = SYS_MS_TO_TICKS(
1128 pMac->lim.gpLimMlmScanReq->min_chntime_btc_esco)/2;
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301129 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1130 }
1131 else
1132 {
1133 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1134 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301135 } else if (pMac->btc.btc_scan_compromise_sco &&
1136 pMac->roam.configParam.min_chntime_btc_sco) {
1137 val = SYS_MS_TO_TICKS(
1138 pMac->roam.configParam.min_chntime_btc_sco / 2);
1139 limLog(pMac, LOG1,
1140 FL("Using BTC SCO Min Active Scan time %d"), val);
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301141 }
1142 }
1143 /*If val is 0 it means min Channel timer is 0 so take the value from maxChannelTimer*/
1144 if (!val)
1145 {
1146
1147 if(pMac->lim.gpLimMlmScanReq)
1148 {
1149 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime)/2;
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301150 if (pMac->btc.btc_scan_compromise_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301151 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301152 if (pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301153 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301154 val = SYS_MS_TO_TICKS(
1155 pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)/2;
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301156 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1157 }
1158 else
1159 {
1160 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1161 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301162 } else if (pMac->btc.btc_scan_compromise_sco &&
1163 pMac->roam.configParam.max_chntime_btc_sco) {
1164 val = SYS_MS_TO_TICKS(
1165 pMac->roam.configParam.max_chntime_btc_sco / 2);
1166 limLog(pMac, LOG1,
1167 FL("Using BTC SCO Max Active Scan time %d"), val);
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301168 }
1169 }
1170 else
1171 {
1172 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1173 //No need to change max timer. This is not a scan
1174 break;
1175 }
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001176 }
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301177 if (val)
Jeff Johnson295189b2012-06-20 16:38:30 -07001178 {
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301179 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1180 val, 0) != TX_SUCCESS)
1181 {
1182 // Could not change min channel timer.
1183 // Log error
1184 limLog(pMac, LOGE, FL("Unable to change periodic timer"));
1185 }
1186 }
1187 else
1188 {
1189 limLog(pMac, LOGE, FL("Do not change gLimPeriodicProbeReqTimer values,"
1190 "value = %d minchannel time = %d"
1191 "maxchannel time = %d"), val,
1192 pMac->lim.gpLimMlmScanReq->minChannelTime,
1193 pMac->lim.gpLimMlmScanReq->maxChannelTime);
Jeff Johnson295189b2012-06-20 16:38:30 -07001194 }
1195
1196 break;
1197
1198 case eLIM_MAX_CHANNEL_TIMER:
1199 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1200 != TX_SUCCESS)
1201 {
1202 // Could not deactivate max channel timer.
1203 // Log error
1204 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001205 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001206 }
1207
Jeff Johnson295189b2012-06-20 16:38:30 -07001208 // If a background was triggered via Quiet BSS,
1209 // then we need to adjust the MIN and MAX channel
1210 // timer's accordingly to the Quiet duration that
1211 // was specified
1212 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1213 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001214#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001215
1216 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1217 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1218 {
1219 // gLimQuietDuration is already cached in units of
1220 // system ticks. No conversion is reqd...
1221 val = pMac->lim.gLimSpecMgmt.quietDuration;
1222 }
1223 else
1224 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001225#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001226 if(pMac->lim.gpLimMlmScanReq)
1227 {
1228 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301229 if (pMac->btc.btc_scan_compromise_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001230 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301231 if (pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001232 {
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301233 val = SYS_MS_TO_TICKS(
1234 pMac->lim.gpLimMlmScanReq->max_chntime_btc_esco);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001235 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1236 }
1237 else
1238 {
1239 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1240 }
Abhishek Singh3a93ee42016-09-29 17:00:03 +05301241 } else if (pMac->btc.btc_scan_compromise_sco &&
1242 pMac->roam.configParam.max_chntime_btc_sco) {
1243 val = SYS_MS_TO_TICKS(
1244 pMac->roam.configParam.max_chntime_btc_sco);
1245 limLog(pMac, LOG1,
1246 FL("Using BTC SCO Max Active Scan time %d"), val);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001247 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001248 }
1249 else
1250 {
1251 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1252 //No need to change max timer. This is not a scan
1253 break;
1254 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001255#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001256 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001257#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001258 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001259
1260 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1261 val, 0) != TX_SUCCESS)
1262 {
1263 // Could not change max channel timer.
1264 // Log error
1265 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001266 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001267 }
1268
1269 break;
1270
1271 case eLIM_JOIN_FAIL_TIMER:
1272 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1273 != TX_SUCCESS)
1274 {
1275 /**
1276 * Could not deactivate Join Failure
1277 * timer. Log error.
1278 */
1279 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001280 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001281 }
1282
1283 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1284 &val) != eSIR_SUCCESS)
1285 {
1286 /**
1287 * Could not get JoinFailureTimeout value
1288 * from CFG. Log error.
1289 */
1290 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001291 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001292 }
1293 val = SYS_MS_TO_TICKS(val);
1294
1295 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1296 val, 0) != TX_SUCCESS)
1297 {
1298 /**
1299 * Could not change Join Failure
1300 * timer. Log error.
1301 */
1302 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001303 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001304 }
1305
1306 break;
1307
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001308 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1309 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1310 != TX_SUCCESS)
1311 {
1312 // Could not deactivate periodic join req Times.
1313 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001314 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001315 }
1316
1317 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1318 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1319 val, 0) != TX_SUCCESS)
1320 {
1321 // Could not change periodic join req times.
1322 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001323 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001324 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001325
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001326 break;
1327
Jeff Johnson295189b2012-06-20 16:38:30 -07001328 case eLIM_AUTH_FAIL_TIMER:
1329 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1330 != TX_SUCCESS)
1331 {
1332 // Could not deactivate Auth failure timer.
1333 // Log error
1334 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001335 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001336 }
1337
1338 // Change timer to reactivate it in future
1339 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1340 &val) != eSIR_SUCCESS)
1341 {
1342 /**
1343 * Could not get AuthFailureTimeout value
1344 * from CFG. Log error.
1345 */
1346 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001347 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001348 }
1349 val = SYS_MS_TO_TICKS(val);
1350
1351 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1352 val, 0) != TX_SUCCESS)
1353 {
1354 // Could not change Authentication failure timer.
1355 // Log error
1356 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001357 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001358 }
1359
1360 break;
1361
Sushant Kaushik9e923872015-04-02 17:09:31 +05301362 case eLIM_AUTH_RETRY_TIMER:
1363
1364 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer)
1365 != TX_SUCCESS)
1366 {
1367 // Could not deactivate Auth Retry Timer.
1368 limLog(pMac, LOGP,
1369 FL("Unable to deactivate Auth Retry timer"));
1370 }
1371 if ((psessionEntry = peFindSessionBySessionId(pMac,
1372 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId))
1373 == NULL)
1374 {
1375 limLog(pMac, LOGP,
1376 FL("session does not exist for given SessionId : %d"),
1377 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId);
1378 break;
1379 }
1380 /* 3/5 of the beacon interval*/
1381 val = psessionEntry->beaconParams.beaconInterval * 3/5;
1382 val = SYS_MS_TO_TICKS(val);
1383 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
1384 val, 0) != TX_SUCCESS)
1385 {
1386 // Could not change Auth Retry timer.
1387 // Log error
1388 limLog(pMac, LOGP, FL("Unable to change Auth Retry timer"));
1389 }
1390
1391 break;
1392
Jeff Johnson295189b2012-06-20 16:38:30 -07001393 case eLIM_ASSOC_FAIL_TIMER:
1394 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1395 TX_SUCCESS)
1396 {
1397 // Could not deactivate Association failure timer.
1398 // Log error
1399 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001400 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001401 }
1402
1403 // Change timer to reactivate it in future
1404 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1405 &val) != eSIR_SUCCESS)
1406 {
1407 /**
1408 * Could not get AssocFailureTimeout value
1409 * from CFG. Log error.
1410 */
1411 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001412 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001413 }
1414 val = SYS_MS_TO_TICKS(val);
1415
1416 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1417 val, 0) != TX_SUCCESS)
1418 {
1419 // Could not change Association failure timer.
1420 // Log error
1421 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001422 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001423 }
1424
1425 break;
1426
1427 case eLIM_REASSOC_FAIL_TIMER:
1428 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1429 TX_SUCCESS)
1430 {
1431 // Could not deactivate Reassociation failure timer.
1432 // Log error
1433 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001434 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001435 }
1436
1437 // Change timer to reactivate it in future
1438 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1439 &val) != eSIR_SUCCESS)
1440 {
1441 /**
1442 * Could not get ReassocFailureTimeout value
1443 * from CFG. Log error.
1444 */
1445 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001446 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001447 }
1448 val = SYS_MS_TO_TICKS(val);
1449
1450 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1451 val, 0) != TX_SUCCESS)
1452 {
1453 // Could not change Reassociation failure timer.
1454 // Log error
1455 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001456 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001457 }
1458
1459 break;
1460
1461 case eLIM_HEART_BEAT_TIMER:
1462 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1463 TX_SUCCESS)
1464 {
1465 // Could not deactivate Heartbeat timer.
1466 // Log error
1467 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001468 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001469 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001470 else
1471 {
1472 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1473 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001474
1475 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1476 &val) != eSIR_SUCCESS)
1477 {
1478 /**
1479 * Could not get BEACON_INTERVAL value
1480 * from CFG. Log error.
1481 */
1482 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001483 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001484 }
1485
1486 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1487 eSIR_SUCCESS)
1488 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001489 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001490
1491 // Change timer to reactivate it in future
1492 val = SYS_MS_TO_TICKS(val * val1);
1493
1494 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1495 val, 0) != TX_SUCCESS)
1496 {
1497 // Could not change HeartBeat timer.
1498 // Log error
1499 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001500 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001501 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001502 else
1503 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001504 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001505 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001506 break;
1507
1508 case eLIM_PROBE_AFTER_HB_TIMER:
1509 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1510 TX_SUCCESS)
1511 {
1512 // Could not deactivate Heartbeat timer.
1513 // Log error
1514 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001515 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001516 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001517 else
1518 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301519 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001520 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001521
1522 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1523 &val) != eSIR_SUCCESS)
1524 {
1525 /**
1526 * Could not get PROBE_AFTER_HB_FAILURE
1527 * value from CFG. Log error.
1528 */
1529 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001530 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001531 }
1532
1533 // Change timer to reactivate it in future
1534 val = SYS_MS_TO_TICKS(val);
1535
1536 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1537 val, 0) != TX_SUCCESS)
1538 {
1539 // Could not change HeartBeat timer.
1540 // Log error
1541 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001542 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001543 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001544 else
1545 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001546 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001547 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001548
1549 break;
1550
1551 case eLIM_KEEPALIVE_TIMER:
1552 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1553 != TX_SUCCESS)
1554 {
1555 // Could not deactivate Keepalive timer.
1556 // Log error
1557 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001558 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001559 }
1560
1561 // Change timer to reactivate it in future
1562
1563 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1564 &val) != eSIR_SUCCESS)
1565 {
1566 /**
1567 * Could not get keepalive timeout value
1568 * from CFG. Log error.
1569 */
1570 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001571 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001572 }
1573 if (val == 0)
1574 {
1575 val = 3000;
1576 pMac->sch.keepAlive = 0;
1577 } else
1578 pMac->sch.keepAlive = 1;
1579
1580
1581
1582 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1583
1584 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1585 val, val) != TX_SUCCESS)
1586 {
1587 // Could not change KeepaliveTimer timer.
1588 // Log error
1589 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001590 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001591 }
1592
1593 break;
1594
Jeff Johnson295189b2012-06-20 16:38:30 -07001595 case eLIM_BACKGROUND_SCAN_TIMER:
1596 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1597 != TX_SUCCESS)
1598 {
1599 // Could not deactivate BackgroundScanTimer timer.
1600 // Log error
1601 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001602 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001603 }
1604
1605 // Change timer to reactivate it in future
1606 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1607 &val) != eSIR_SUCCESS)
1608 {
1609 /**
1610 * Could not get Background scan period value
1611 * from CFG. Log error.
1612 */
1613 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001614 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001615 }
1616 if (val == 0)
1617 {
1618 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1619 pMac->lim.gLimBackgroundScanDisable = true;
1620 }
1621 else
1622 pMac->lim.gLimBackgroundScanDisable = false;
1623
1624 val = SYS_MS_TO_TICKS(val);
1625
1626 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1627 val, val) != TX_SUCCESS)
1628 {
1629 // Could not change BackgroundScanTimer timer.
1630 // Log error
1631 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001632 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001633 }
1634
1635 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001636
Jeff Johnsone7245742012-09-05 17:12:55 -07001637#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001638 case eLIM_CHANNEL_SWITCH_TIMER:
1639 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1640 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001641 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001642 return;
1643 }
1644
1645 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1646 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1647 0) != TX_SUCCESS)
1648 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001649 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001650 return;
1651 }
1652 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001653#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001654
1655 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001656 break;
1657
Jeff Johnsone7245742012-09-05 17:12:55 -07001658#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001659 case eLIM_QUIET_BSS_TIMER:
1660 if (TX_SUCCESS !=
1661 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1662 {
1663 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001664 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001665 }
1666
1667 // gLimQuietDuration appears to be in units of ticks
1668 // Use it as is
1669 if (TX_SUCCESS !=
1670 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1671 pMac->lim.gLimSpecMgmt.quietDuration,
1672 0))
1673 {
1674 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001675 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001676 }
1677 break;
1678
1679 case eLIM_QUIET_TIMER:
1680 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1681 {
1682 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001683 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001684 }
1685
1686 // Set the NEW timeout value, in ticks
1687 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1688 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1689 {
1690 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001691 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001692 }
1693 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001694#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001695
Jeff Johnson295189b2012-06-20 16:38:30 -07001696#if 0
1697 case eLIM_WPS_OVERLAP_TIMER:
1698 {
1699 // Restart Learn Interval timer
1700
1701 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1702
1703 if (tx_timer_deactivate(
1704 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1705 {
1706 // Could not deactivate Learn Interval timer.
1707 // Log error
1708 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001709 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001710 }
1711
1712 if (tx_timer_change(
1713 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1714 WPSOverlapTimer, 0) != TX_SUCCESS)
1715 {
1716 // Could not change Learn Interval timer.
1717 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001718 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001719
1720 return;
1721 }
1722
1723 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001724 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001725 WPSOverlapTimer);
1726 }
1727 break;
1728#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001729
1730#ifdef WLAN_FEATURE_VOWIFI_11R
1731 case eLIM_FT_PREAUTH_RSP_TIMER:
1732 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1733 {
1734 /**
1735 ** Could not deactivate Join Failure
1736 ** timer. Log error.
1737 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001738 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001739 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001740 }
1741 val = 1000;
1742 val = SYS_MS_TO_TICKS(val);
1743 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1744 val, 0) != TX_SUCCESS)
1745 {
1746 /**
1747 * Could not change Join Failure
1748 * timer. Log error.
1749 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001750 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001751 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001752 }
1753 break;
1754#endif
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +05301755
1756#ifdef WLAN_FEATURE_LFR_MBB
1757 case eLIM_PREAUTH_MBB_RSP_TIMER:
1758 if (tx_timer_deactivate(&pMac->lim.limTimers.
1759 glim_pre_auth_mbb_rsp_timer) != TX_SUCCESS) {
1760 limLog(pMac, LOGP,
1761 FL("Unable to deactivate preauth response mbb timer"));
1762 return;
1763 }
1764 break;
1765#endif
1766
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001767#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001768 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001769 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001770 != TX_SUCCESS)
1771 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001772 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001773 }
1774 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001775#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301776
1777 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1778 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1779 {
1780 /**
1781 ** Could not deactivate Active to passive channel timer.
1782 ** Log error.
1783 **/
1784 limLog(pMac, LOGP, FL("Unable to Deactivate "
1785 "Active to passive channel timer"));
1786 return;
1787 }
1788 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1789 val = SYS_MS_TO_TICKS(val);
1790 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1791 val, 0) != TX_SUCCESS)
1792 {
1793 /**
1794 * Could not change timer to check scan type for passive channel.
1795 * timer. Log error.
1796 */
1797 limLog(pMac, LOGP, FL("Unable to change timer"));
1798 return;
1799 }
1800 break;
1801
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001802 case eLIM_DISASSOC_ACK_TIMER:
1803 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1804 {
1805 /**
1806 ** Could not deactivate Join Failure
1807 ** timer. Log error.
1808 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001809 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001810 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001811 }
1812 val = 1000;
1813 val = SYS_MS_TO_TICKS(val);
1814 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1815 val, 0) != TX_SUCCESS)
1816 {
1817 /**
1818 * Could not change Join Failure
1819 * timer. Log error.
1820 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001821 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001822 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001823 }
1824 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001825
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001826 case eLIM_DEAUTH_ACK_TIMER:
1827 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1828 {
1829 /**
1830 ** Could not deactivate Join Failure
1831 ** timer. Log error.
1832 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001833 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001834 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001835 }
1836 val = 1000;
1837 val = SYS_MS_TO_TICKS(val);
1838 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1839 val, 0) != TX_SUCCESS)
1840 {
1841 /**
1842 * Could not change Join Failure
1843 * timer. Log error.
1844 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001845 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001846 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001847 }
1848 break;
Viral Modid86bde22012-12-10 13:09:21 -08001849
Viral Modid86bde22012-12-10 13:09:21 -08001850 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1851 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1852 {
1853 /**
1854 ** Could not deactivate SingleShot NOA Insert
1855 ** timer. Log error.
1856 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001857 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001858 return;
1859 }
1860 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1861 val = SYS_MS_TO_TICKS(val);
1862 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1863 val, 0) != TX_SUCCESS)
1864 {
1865 /**
1866 * Could not change Single Shot NOA Insert
1867 * timer. Log error.
1868 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001869 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001870 return;
1871 }
1872 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001873
Jeff Johnson295189b2012-06-20 16:38:30 -07001874 default:
1875 // Invalid timerId. Log error
1876 break;
1877 }
1878} /****** end limDeactivateAndChangeTimer() ******/
1879
1880
1881
1882/**---------------------------------------------------------------
1883\fn limHeartBeatDeactivateAndChangeTimer
1884\brief This function deactivates and changes the heart beat
1885\ timer, eLIM_HEART_BEAT_TIMER.
1886\
1887\param pMac
1888\param psessionEntry
1889\return None
1890------------------------------------------------------------------*/
1891void
1892limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1893{
Ravi Joshid0699502013-07-08 15:48:47 -07001894 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001895
Siddharth Bhal224da542014-05-28 07:07:46 +05301896 if (NULL == psessionEntry)
1897 {
1898 limLog(pMac, LOGE, FL("%s: received session id NULL."
1899 " Heartbeat timer config failed"), __func__);
1900 return;
1901 }
1902
Yathish9f22e662012-12-10 14:21:35 -08001903#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001904 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1905 return;
Yathish9f22e662012-12-10 14:21:35 -08001906#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001907
Ravi Joshid0699502013-07-08 15:48:47 -07001908 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1909 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001910
Ravi Joshid0699502013-07-08 15:48:47 -07001911 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1912 changing. to avoid this problem, HeartBeat interval is made constant, by
1913 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001914
Ravi Joshid0699502013-07-08 15:48:47 -07001915 //val = psessionEntry->beaconParams.beaconInterval;
1916 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001917
Ravi Joshid0699502013-07-08 15:48:47 -07001918 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1919 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001920
Ravi Joshid0699502013-07-08 15:48:47 -07001921 PELOGW(limLog(pMac,LOGW,
1922 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1923 val1, psessionEntry->beaconParams.beaconInterval,
1924 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001925
Ravi Joshid0699502013-07-08 15:48:47 -07001926 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1927 * enough to judge the peer device inactivity when 32 peers are connected.
1928 * Hence increasing the HB timer timeout to
1929 * HBtimeout = (TBTT * num_beacons * num_peers)
1930 */
1931 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1932 pMac->lim.gLimNumIbssPeers > 0)
1933 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001934 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001935 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001936
Ravi Joshid0699502013-07-08 15:48:47 -07001937 // Change timer to reactivate it in future
1938 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001939
Ravi Joshid0699502013-07-08 15:48:47 -07001940 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1941 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001942
1943} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1944
1945
1946/**---------------------------------------------------------------
1947\fn limReactivateHeartBeatTimer
1948\brief This function s called to deactivate, change and
1949\ activate a timer.
1950\
1951\param pMac - Pointer to Global MAC structure
1952\param psessionEntry
1953\return None
1954------------------------------------------------------------------*/
1955void
1956limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1957{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301958 if (NULL == psessionEntry)
1959 {
1960 limLog(pMac, LOGE, FL("%s: received session id NULL."
1961 " Heartbeat timer config failed"), __func__);
1962 return;
1963 }
1964
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001965 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001966
Yathish9f22e662012-12-10 14:21:35 -08001967#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1968 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001969 {
1970 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001971 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001972 }
Yathish9f22e662012-12-10 14:21:35 -08001973#endif
1974
Jeff Johnson295189b2012-06-20 16:38:30 -07001975 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001976
1977 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001978 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1979 {
1980 /*
1981 * There is increasing need to limit the apps wakeup due to WLAN
1982 * activity. During HB monitoring, the beacons from peer are sent to
1983 * the host causing the host to wakeup. Hence, offloading the HB
1984 * monitoring to LMAC
1985 */
1986 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1987 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1988 {
1989 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1990 {
1991 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1992 }
1993 else
1994 {
1995 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1996 }
1997 }
1998 else
1999 {
2000 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
2001 {
2002 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
2003 }
2004 else
2005 {
2006 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
2007 }
2008 }
2009 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07002010 }
2011
2012} /****** end limReactivateHeartBeatTimer() ******/
2013
Jeff Johnson295189b2012-06-20 16:38:30 -07002014
2015/**
2016 * limActivateHearBeatTimer()
2017 *
2018 *
2019 * @brief: This function is called to activate heartbeat timer
2020 *
2021 *LOGIC:
2022 *
2023 *ASSUMPTIONS:
2024 * NA
2025 *
2026 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2027 *
2028 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002029 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07002030 *
2031 * @return TX_SUCCESS - timer is activated
2032 * errors - fail to start the timer
2033 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002034v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002035{
2036 v_UINT_t status = TX_TIMER_ERROR;
2037
Yathish9f22e662012-12-10 14:21:35 -08002038#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2039 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07002040 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08002041#endif
2042
Jeff Johnson295189b2012-06-20 16:38:30 -07002043 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
2044 {
2045 //consider 0 interval a ok case
2046 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
2047 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002048 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
2049 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
2050 {
2051 /* HB offload in IBSS mode */
2052 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2053 if (TX_SUCCESS != status)
2054 {
2055 PELOGE(limLog(pMac, LOGE,
2056 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
2057 status);)
2058 }
2059 else
2060 {
2061 PELOGE(limLog(pMac, LOGE,
2062 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
2063 __func__);)
2064 }
2065
2066 }
2067 else
2068 {
2069 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2070 if ( TX_SUCCESS != status )
2071 {
2072 PELOGE(limLog(pMac, LOGE,
2073 FL("could not activate Heartbeat timer status(%d)"), status);)
2074 }
2075 else
2076 {
2077 PELOGE(limLog(pMac, LOGW,
2078 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2079 }
2080 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002081 }
2082 else
2083 {
2084 status = TX_SUCCESS;
2085 }
2086 }
2087
2088 return (status);
2089}
2090
2091
2092
2093/**
2094 * limDeactivateAndChangePerStaIdTimer()
2095 *
2096 *
2097 * @brief: This function is called to deactivate and change a per STA timer
2098 * for future re-activation
2099 *
2100 *LOGIC:
2101 *
2102 *ASSUMPTIONS:
2103 * NA
2104 *
2105 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2106 *
2107 * @param pMac - Pointer to Global MAC structure
2108 * @param timerId - enum of timer to be deactivated and changed
2109 * This enum is defined in limUtils.h file
2110 * @param staId - staId
2111 *
2112 * @return None
2113 */
2114
2115void
2116limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2117{
2118 tANI_U32 val;
Jeff Johnson295189b2012-06-20 16:38:30 -07002119
2120 switch (timerId)
2121 {
2122 case eLIM_CNF_WAIT_TIMER:
2123
2124 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2125 != TX_SUCCESS)
2126 {
2127 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002128 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002129
2130 }
2131
2132 // Change timer to reactivate it in future
2133
2134 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2135 &val) != eSIR_SUCCESS)
2136 {
2137 /**
2138 * Could not get cnf timeout value
2139 * from CFG. Log error.
2140 */
2141 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002142 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002143 }
2144 val = SYS_MS_TO_TICKS(val);
2145
2146 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2147 val, val) != TX_SUCCESS)
2148 {
2149 // Could not change cnf timer.
2150 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002151 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002152 }
2153
2154 break;
2155
2156 case eLIM_AUTH_RSP_TIMER:
2157 {
2158 tLimPreAuthNode *pAuthNode;
2159
2160 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2161
2162 if (pAuthNode == NULL)
2163 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002164 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002165 break;
2166 }
2167
2168 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2169 {
2170 // Could not deactivate auth response timer.
2171 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002172 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002173 }
2174
2175 // Change timer to reactivate it in future
2176
2177 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2178 {
2179 /**
2180 * Could not get auth rsp timeout value
2181 * from CFG. Log error.
2182 */
2183 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002184 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002185 }
2186
2187 val = SYS_MS_TO_TICKS(val);
2188
2189 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2190 {
2191 // Could not change auth rsp timer.
2192 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002193 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002194 }
2195 }
2196 break;
2197
Jeff Johnson295189b2012-06-20 16:38:30 -07002198
2199 default:
2200 // Invalid timerId. Log error
2201 break;
2202
2203 }
2204}
2205
2206
2207/**
2208 * limActivateCnfTimer()
2209 *
2210 *FUNCTION:
2211 * This function is called to activate a per STA timer
2212 *
2213 *LOGIC:
2214 *
2215 *ASSUMPTIONS:
2216 * NA
2217 *
2218 *NOTE:
2219 * NA
2220 *
2221 * @param pMac - Pointer to Global MAC structure
2222 * @param StaId - staId
2223 *
2224 * @return None
2225 */
2226
2227void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2228{
Jeff Johnson295189b2012-06-20 16:38:30 -07002229 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2230 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2231 != TX_SUCCESS)
2232 {
2233 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002234 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002235 }
2236}
2237
2238/**
2239 * limActivateAuthRspTimer()
2240 *
2241 *FUNCTION:
2242 * This function is called to activate a per STA timer
2243 *
2244 *LOGIC:
2245 *
2246 *ASSUMPTIONS:
2247 * NA
2248 *
2249 *NOTE:
2250 * NA
2251 *
2252 * @param pMac - Pointer to Global MAC structure
2253 * @param id - id
2254 *
2255 * @return None
2256 */
2257
2258void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2259{
Jeff Johnson295189b2012-06-20 16:38:30 -07002260 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2261 {
2262 /// Could not activate auth rsp timer.
2263 // Log error
2264 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002265 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002266 }
2267}
2268
2269
2270/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002271 * limAssocCnfWaitTmerHandler()
2272 *
2273 *FUNCTION:
2274 * This function post a message to send a disassociate frame out.
2275 *
2276 *LOGIC:
2277 *
2278 *ASSUMPTIONS:
2279 *
2280 *NOTE:
2281 * NA
2282 *
2283 * @param
2284 *
2285 * @return None
2286 */
2287
2288void
2289limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2290{
2291 tSirMsgQ msg;
2292 tANI_U32 statusCode;
2293 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2294
2295 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2296 msg.bodyval = (tANI_U32)param;
2297 msg.bodyptr = NULL;
2298
2299 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2300 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002301 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002302
2303}
2304
2305/**
2306 * limKeepaliveTmerHandler()
2307 *
2308 *FUNCTION:
2309 * This function post a message to send a NULL data frame.
2310 *
2311 *LOGIC:
2312 *
2313 *ASSUMPTIONS:
2314 *
2315 *NOTE:
2316 * NA
2317 *
2318 * @param
2319 *
2320 * @return None
2321 */
2322
2323void
2324limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2325{
2326 tSirMsgQ msg;
2327 tANI_U32 statusCode;
2328 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2329
2330 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2331 msg.bodyval = (tANI_U32)param;
2332 msg.bodyptr = NULL;
2333
2334 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2335 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002336 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002337
2338}
2339
2340void
2341limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2342{
2343 tSirMsgQ msg;
2344 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2345
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302346 limLog(pMac, LOG1,
2347 FL("ChannelSwitch Timer expired. Posting msg to LIM "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002348
2349 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2350 msg.bodyval = (tANI_U32)param;
2351 msg.bodyptr = NULL;
2352
2353 limPostMsgApi(pMac, &msg);
2354}
2355
2356void
2357limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2358{
2359 tSirMsgQ msg;
2360 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2361
2362 msg.type = SIR_LIM_QUIET_TIMEOUT;
2363 msg.bodyval = (tANI_U32)param;
2364 msg.bodyptr = NULL;
2365
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302366 limLog(pMac, LOG1,
2367 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002368 limPostMsgApi(pMac, &msg);
2369}
2370
2371void
2372limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2373{
2374 tSirMsgQ msg;
2375 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2376
2377 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2378 msg.bodyval = (tANI_U32)param;
2379 msg.bodyptr = NULL;
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302380 limLog(pMac, LOG1,
2381 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002382 limPostMsgApi(pMac, &msg);
2383}
Jeff Johnson295189b2012-06-20 16:38:30 -07002384#if 0
2385void
2386limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2387{
2388 tSirMsgQ msg;
2389 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2390
2391 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2392 msg.bodyval = (tANI_U32)param;
2393 msg.bodyptr = NULL;
2394 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002395 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002396 limPostMsgApi(pMac, &msg);
2397}
2398#endif
Yathish9f22e662012-12-10 14:21:35 -08002399
2400#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2401/* ACTIVE_MODE_HB_OFFLOAD */
2402/**
2403 * limMissedBeaconInActiveMode()
2404 *
2405 *FUNCTION:
2406 * This function handle beacon miss indication from FW
2407 * in Active mode.
2408 *
2409 *LOGIC:
2410 *
2411 *ASSUMPTIONS:
2412 * NA
2413 *
2414 *NOTE:
2415 * NA
2416 *
2417 * @param param - Msg Type
2418 *
2419 * @return None
2420 */
2421void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002422limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002423{
2424 tANI_U32 statusCode;
2425 tSirMsgQ msg;
2426 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2427
2428 // Prepare and post message to LIM Message Queue
2429 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002430 {
Yathish9f22e662012-12-10 14:21:35 -08002431 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002432 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002433 msg.bodyval = 0;
2434 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002435 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002436 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2437 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002438 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002439 msg.type, statusCode);
2440 }
2441}
2442#endif