blob: f4bed14ca1644b509af494a379259cb028a8fa0f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Sushant Kaushik9e923872015-04-02 17:09:31 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
Jeff Johnson295189b2012-06-20 16:38:30 -070020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
Jeff Johnson295189b2012-06-20 16:38:30 -070022/*
Kiet Lam842dad02014-02-18 18:44:02 -080023 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 * This file limTimerUtils.cc contains the utility functions
30 * LIM uses for handling various timers.
31 * Author: Chandra Modumudi
32 * Date: 02/13/02
33 * History:-
34 * Date Modified by Modification Information
35 * --------------------------------------------------------------------
36 */
37
38#include "limTypes.h"
39#include "limUtils.h"
40#include "limAssocUtils.h"
41#include "limSecurityUtils.h"
42#include "pmmApi.h"
43
44
45// default value 5000 ms for background scan period when it is disabled
46#define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000
47// channel Switch Timer in ticks
48#define LIM_CHANNEL_SWITCH_TIMER_TICKS 1
49// Lim Quite timer in ticks
50#define LIM_QUIET_TIMER_TICKS 100
Jeff Johnsonfeddb2d2012-12-10 14:41:22 -080051// Lim Quite BSS timer interval in ticks
Jeff Johnson295189b2012-06-20 16:38:30 -070052#define LIM_QUIET_BSS_TIMER_TICK 100
53// Lim KeepAlive timer default (3000)ms
54#define LIM_KEEPALIVE_TIMER_MS 3000
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -080055// Lim JoinProbeRequest Retry timer default (200)ms
56#define LIM_JOIN_PROBE_REQ_TIMER_MS 200
Sushant Kaushik9e923872015-04-02 17:09:31 +053057#define LIM_AUTH_RETRY_TIMER_MS 60
58
Jeff Johnson295189b2012-06-20 16:38:30 -070059
60//default beacon interval value used in HB timer interval calculation
61#define LIM_HB_TIMER_BEACON_INTERVAL 100
Gopichand Nakkalad492d202013-05-10 02:50:47 +053062
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053063/* This timer is a periodic timer which expires at every 1 sec to
Gopichand Nakkalad492d202013-05-10 02:50:47 +053064 convert ACTIVE DFS channel to DFS channels */
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053065#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
Gopichand Nakkalad492d202013-05-10 02:50:47 +053066
Jeff Johnson295189b2012-06-20 16:38:30 -070067/**
68 * limCreateTimers()
69 *
70 *FUNCTION:
71 * This function is called upon receiving
72 * 1. SME_START_REQ for STA in ESS role
73 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
74 *
75 *LOGIC:
76 *
77 *ASSUMPTIONS:
78 * NA
79 *
80 *NOTE:
81 * NA
82 *
83 * @param pMac - Pointer to Global MAC structure
84 *
85 * @return None
86 */
87
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070088v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070089limCreateTimers(tpAniSirGlobal pMac)
90{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070091 tANI_U32 cfgValue, i=0;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -080092 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -070093
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070094 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -070095
96 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
97 &cfgValue) != eSIR_SUCCESS)
98 {
99 /**
100 * Could not get MinChannelTimeout value
101 * from CFG. Log error.
102 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700103 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700104 }
105 cfgValue = SYS_MS_TO_TICKS(cfgValue);
106
107 // Create MIN/MAX channel timers and activate them later
108 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
109 "MIN CHANNEL TIMEOUT",
110 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
111 cfgValue, 0,
112 TX_NO_ACTIVATE) != TX_SUCCESS)
113 {
114 /// Could not start min channel timer.
115 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700116 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700117 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700118 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700119 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700120
121 /* Periodic probe request timer value is half of the Min channel
122 * timer. Probe request sends periodically till min/max channel
123 * timer expires
124 */
125
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800126 cfgValue1 = cfgValue/2 ;
127 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 {
129 // Create periodic probe request timer and activate them later
130 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
131 "Periodic Probe Request Timer",
132 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800133 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700134 TX_NO_ACTIVATE) != TX_SUCCESS)
135 {
136 /// Could not start Periodic Probe Req timer.
137 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700138 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700139 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 }
141 }
142
143
144 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
145 &cfgValue) != eSIR_SUCCESS)
146 {
147 /**
148 * Could not get MAXChannelTimeout value
149 * from CFG. Log error.
150 */
151 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700152 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700153 }
154 cfgValue = SYS_MS_TO_TICKS(cfgValue);
155
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800156 /* Limiting max numm of probe req for each channel scan */
157 pMac->lim.maxProbe = (cfgValue/cfgValue1);
158
Jeff Johnson295189b2012-06-20 16:38:30 -0700159 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
160 "MAX CHANNEL TIMEOUT",
161 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
162 cfgValue, 0,
163 TX_NO_ACTIVATE) != TX_SUCCESS)
164 {
165 /// Could not start max channel timer.
166 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700167 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700168
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700169 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700170 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700171 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700172
173 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
174 {
175 // Create Channel Switch Timer
176 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
177 "CHANNEL SWITCH TIMER",
178 limChannelSwitchTimerHandler,
179 0, // expiration_input
180 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
181 0, // reschedule_ticks
182 TX_NO_ACTIVATE) != TX_SUCCESS)
183 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700184 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700185 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700186 }
187
188 //
189 // Create Quiet Timer
190 // This is used on the STA to go and shut-off
191 // Tx/Rx "after" the specified quiteInterval
192 //
193 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
194 "QUIET TIMER",
195 limQuietTimerHandler,
196 SIR_LIM_QUIET_TIMEOUT, // expiration_input
197 LIM_QUIET_TIMER_TICKS, // initial_ticks
198 0, // reschedule_ticks
199 TX_NO_ACTIVATE) != TX_SUCCESS)
200 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700201 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700202 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700203 }
204
205 //
206 // Create Quiet BSS Timer
207 // After the specified quiteInterval, determined by
208 // gLimQuietTimer, this timer, gLimQuietBssTimer,
209 // trigger and put the STA to sleep for the specified
210 // gLimQuietDuration
211 //
212 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
213 "QUIET BSS TIMER",
214 limQuietBssTimerHandler,
215 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
216 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
217 0, // reschedule_ticks
218 TX_NO_ACTIVATE) != TX_SUCCESS)
219 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700220 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700221 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700222 }
223
224 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
225 &cfgValue) != eSIR_SUCCESS)
226 {
227 /**
228 * Could not get JoinFailureTimeout value
229 * from CFG. Log error.
230 */
231 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700232 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700233 }
234 cfgValue = SYS_MS_TO_TICKS(cfgValue);
235
236 // Create Join failure timer and activate it later
237 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
238 "JOIN FAILURE TIMEOUT",
239 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
240 cfgValue, 0,
241 TX_NO_ACTIVATE) != TX_SUCCESS)
242 {
243 /// Could not create Join failure timer.
244 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700245 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700246
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700247 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700248 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800249
Jeff Johnson62c27982013-02-27 17:53:55 -0800250 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800251 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
252 "Periodic Join Probe Request Timer",
253 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
254 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
255 TX_NO_ACTIVATE)) != TX_SUCCESS)
256 {
257 /// Could not create Periodic Join Probe Request timer.
258 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700259 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800260 goto err_timer;
261 }
Sushant Kaushik9e923872015-04-02 17:09:31 +0530262 //Send Auth frame every 60 ms
263 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
264 "Periodic AUTH Timer",
265 limTimerHandler, SIR_LIM_AUTH_RETRY_TIMEOUT,
266 SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0,
267 TX_NO_ACTIVATE)) != TX_SUCCESS)
268 {
269 /// Could not create Periodic Join Probe Request timer.
270 // Log error
271 limLog(pMac, LOGP, FL("could not create Periodic AUTH Timer timer"));
272 goto err_timer;
273 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700274 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
275 &cfgValue) != eSIR_SUCCESS)
276 {
277 /**
278 * Could not get AssocFailureTimeout value
279 * from CFG. Log error.
280 */
281 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700282 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700283 }
284 cfgValue = SYS_MS_TO_TICKS(cfgValue);
285
286 // Create Association failure timer and activate it later
287 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
288 "ASSOC FAILURE TIMEOUT",
289 limAssocFailureTimerHandler, LIM_ASSOC,
290 cfgValue, 0,
291 TX_NO_ACTIVATE) != TX_SUCCESS)
292 {
293 /// Could not create Assoc failure timer.
294 // Log error
295 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700296 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700297
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700298 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700299 }
300 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
301 &cfgValue) != eSIR_SUCCESS)
302 {
303 /**
304 * Could not get ReassocFailureTimeout value
305 * from CFG. Log error.
306 */
307 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700308 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700309 }
310 cfgValue = SYS_MS_TO_TICKS(cfgValue);
311
312 // Create Association failure timer and activate it later
313 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
314 "REASSOC FAILURE TIMEOUT",
315 limAssocFailureTimerHandler, LIM_REASSOC,
316 cfgValue, 0,
317 TX_NO_ACTIVATE) != TX_SUCCESS)
318 {
319 /// Could not create Reassoc failure timer.
320 // Log error
321 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700322 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700323
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700324 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700325 }
326
327 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700328 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700329
330 cfgValue = SYS_MS_TO_TICKS(cfgValue);
331
332 // Create Addts response timer and activate it later
333 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
334 "ADDTS RSP TIMEOUT",
335 limAddtsResponseTimerHandler,
336 SIR_LIM_ADDTS_RSP_TIMEOUT,
337 cfgValue, 0,
338 TX_NO_ACTIVATE) != TX_SUCCESS)
339 {
340 /// Could not create Auth failure timer.
341 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700342 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700343
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700344 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700345 }
346
347 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
348 &cfgValue) != eSIR_SUCCESS)
349 {
350 /**
351 * Could not get AuthFailureTimeout value
352 * from CFG. Log error.
353 */
354 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700355 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700356 }
357 cfgValue = SYS_MS_TO_TICKS(cfgValue);
358
359 // Create Auth failure timer and activate it later
360 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
361 "AUTH FAILURE TIMEOUT",
362 limTimerHandler,
363 SIR_LIM_AUTH_FAIL_TIMEOUT,
364 cfgValue, 0,
365 TX_NO_ACTIVATE) != TX_SUCCESS)
366 {
367 /// Could not create Auth failure timer.
368 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700369 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700370
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700371 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800373
Jeff Johnson295189b2012-06-20 16:38:30 -0700374 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
375 &cfgValue) != eSIR_SUCCESS)
376 {
377 /**
378 * Could not get BEACON_INTERVAL value
379 * from CFG. Log error.
380 */
381 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700382 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700383 }
384 cfgValue = SYS_MS_TO_TICKS(cfgValue);
385
386 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
387 "Heartbeat TIMEOUT",
388 limTimerHandler,
389 SIR_LIM_HEART_BEAT_TIMEOUT,
390 cfgValue,
391 0,
392 TX_NO_ACTIVATE) != TX_SUCCESS)
393 {
394 /// Could not start Heartbeat timer.
395 // Log error
396 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700397 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700398 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700399 }
400
401 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
402 &cfgValue) != eSIR_SUCCESS)
403 {
404 /**
405 * Could not get PROBE_AFTER_HB_FAILURE
406 * value from CFG. Log error.
407 */
408 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700409 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700410 }
411
412 // Change timer to reactivate it in future
413 cfgValue = SYS_MS_TO_TICKS(cfgValue);
414
415 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
416 "Probe after Heartbeat TIMEOUT",
417 limTimerHandler,
418 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
419 cfgValue,
420 0,
421 TX_NO_ACTIVATE) != TX_SUCCESS)
422 {
423 // Could not creat wt-probe-after-HeartBeat-failure timer.
424 // Log error
425 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700426 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700427 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700428 }
429
Jeff Johnson295189b2012-06-20 16:38:30 -0700430 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
431 &cfgValue) != eSIR_SUCCESS)
432 {
433 /**
434 * Could not get Background scan period value
435 * from CFG. Log error.
436 */
437 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700438 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700439 }
440
441 /*
442 * setting period to zero means disabling background scans when associated
443 * the way we do this is to set a flag indicating this and keeping
444 * the timer running, since it will be used for PDU leak workarounds
445 * as well as background scanning during SME idle states
446 */
447 if (cfgValue == 0)
448 {
449 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
450 pMac->lim.gLimBackgroundScanDisable = true;
451 }
452 else
453 pMac->lim.gLimBackgroundScanDisable = false;
454
455 cfgValue = SYS_MS_TO_TICKS(cfgValue);
456
457 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
458 "Background scan TIMEOUT",
459 limTimerHandler,
460 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
461 cfgValue,
462 cfgValue,
463 TX_NO_ACTIVATE) != TX_SUCCESS)
464 {
465 /// Could not start background scan timer.
466 // Log error
467 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700468 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700469 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700470 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700471 }
472
Jeff Johnson295189b2012-06-20 16:38:30 -0700473 /**
474 * Create keepalive timer and activate it right away for AP role
475 */
476
477 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
478 &cfgValue) != eSIR_SUCCESS)
479 {
480 /**
481 * Could not get keepalive timeout value
482 * from CFG. Log error.
483 */
484 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700485 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700486 }
487
488 // A value of zero implies keep alive should be disabled
489 if (cfgValue == 0)
490 {
491 cfgValue = LIM_KEEPALIVE_TIMER_MS;
492 pMac->sch.keepAlive = 0;
493 } else
494 pMac->sch.keepAlive = 1;
495
496
497 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
498
499 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
500 "KEEPALIVE_TIMEOUT",
501 limKeepaliveTmerHandler,
502 0,
503 cfgValue,
504 cfgValue,
505 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
506 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
507 != TX_SUCCESS)
508 {
509 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700510 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700511 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700512 }
513
514 /**
515 * Create all CNF_WAIT Timers upfront
516 */
517
518 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
519 &cfgValue) != eSIR_SUCCESS)
520 {
521 /**
522 * Could not get CNF_WAIT timeout value
523 * from CFG. Log error.
524 */
525 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700526 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700527 }
528 cfgValue = SYS_MS_TO_TICKS(cfgValue);
529
530 for (i=0; i<pMac->lim.maxStation; i++)
531 {
532 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
533 "CNF_MISS_TIMEOUT",
534 limCnfWaitTmerHandler,
535 (tANI_U32)i,
536 cfgValue,
537 0,
538 TX_NO_ACTIVATE) != TX_SUCCESS)
539 {
540 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700541 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700542 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700543 }
544 }
545
546 /*
547 ** Alloc and init table for the preAuth timer list
548 **
549 **/
550
551 // get max number of Preauthentication
552 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
553 &cfgValue) != eSIR_SUCCESS)
554 {
555 /*
556 ** Could not get max preauth value
557 ** from CFG. Log error.
558 **/
559 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700560 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700561 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530563 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_vmalloc(cfgValue*sizeof(tLimPreAuthNode));
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530564 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700565 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530566 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700567 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700568 }
569
570 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700571 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700572
573
Jeff Johnson295189b2012-06-20 16:38:30 -0700574 {
575 /**
576 * Create OLBC cache aging timer
577 */
578 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
579 &cfgValue) != eSIR_SUCCESS)
580 {
581 /**
582 * Could not get OLBC detect timeout value
583 * from CFG. Log error.
584 */
585 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700586 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700587 }
588
589 cfgValue = SYS_MS_TO_TICKS(cfgValue);
590
591 if (tx_timer_create(
592 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
593 "OLBC UPDATE CACHE TIMEOUT",
594 limUpdateOlbcCacheTimerHandler,
595 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
596 cfgValue,
597 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700598 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700599 {
600 // Cannot create update OLBC cache timer
601 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700602 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700603 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700604 }
605 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700606#ifdef WLAN_FEATURE_VOWIFI_11R
607 // In future we need to use the auth timer, cause
608 // the pre auth session will be introduced before sending
609 // Auth frame.
610 // We need to go off channel and come back to home channel
611 cfgValue = 1000;
612 cfgValue = SYS_MS_TO_TICKS(cfgValue);
613
614 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
615 "FT PREAUTH RSP TIMEOUT",
616 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
617 cfgValue, 0,
618 TX_NO_ACTIVATE) != TX_SUCCESS)
619 {
620 // Could not create Join failure timer.
621 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700622 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700623 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700624 }
625#endif
626
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800627#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700628 cfgValue = 5000;
629 cfgValue = SYS_MS_TO_TICKS(cfgValue);
630
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800631 if (tx_timer_create(&pMac->lim.limTimers.gLimEseTsmTimer,
632 "ESE TSM Stats TIMEOUT",
633 limTimerHandler, SIR_LIM_ESE_TSM_TIMEOUT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700634 cfgValue, 0,
635 TX_NO_ACTIVATE) != TX_SUCCESS)
636 {
637 // Could not create Join failure timer.
638 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700639 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700640 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700641 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800642#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700643
Jeff Johnson295189b2012-06-20 16:38:30 -0700644 cfgValue = 1000;
645 cfgValue = SYS_MS_TO_TICKS(cfgValue);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800646 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
647 "DISASSOC ACK TIMEOUT",
648 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
649 cfgValue, 0,
650 TX_NO_ACTIVATE) != TX_SUCCESS)
651 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700652 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800653 goto err_timer;
654 }
655
656 cfgValue = 1000;
657 cfgValue = SYS_MS_TO_TICKS(cfgValue);
658 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
659 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800660 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800661 cfgValue, 0,
662 TX_NO_ACTIVATE) != TX_SUCCESS)
663 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700664 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800665 goto err_timer;
666 }
Viral Modid86bde22012-12-10 13:09:21 -0800667
Viral Modid86bde22012-12-10 13:09:21 -0800668 cfgValue = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE; // (> no of BI* no of TUs per BI * 1TU in msec + p2p start time offset*1 TU in msec = 2*100*1.024 + 5*1.024 = 204.8 + 5.12 = 209.20)
669 cfgValue = SYS_MS_TO_TICKS(cfgValue);
670 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
671 "Single Shot NOA Insert timeout",
672 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
673 cfgValue, 0,
674 TX_NO_ACTIVATE) != TX_SUCCESS)
675 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700676 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800677 goto err_timer;
678 }
Viral Modid86bde22012-12-10 13:09:21 -0800679
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530680 if (eSIR_SUCCESS == wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_PASSIVE_CON,
681 &cfgValue))
682 {
683 limLog(pMac, LOGP,
684 FL("could not retrieve WNI_CFG_ACTIVE_PASSIVE_CON"));
685 }
686 if (cfgValue)
687 {
688 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
689 cfgValue = SYS_MS_TO_TICKS(cfgValue);
690 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530691 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
692 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
693 TX_NO_ACTIVATE) != TX_SUCCESS)
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530694 {
695 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
696 goto err_timer;
697 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530698 }
Hanumantha Reddy Pothula802d31d2015-09-29 17:39:11 +0530699 else
700 {
701 limLog(pMac, LOG1,
702 FL("gLimActiveToPassiveChannelTimer not created %d"), cfgValue);
703 }
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530704
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700705 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700706
707 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800708 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800709 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800710#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
711 tx_timer_delete(&pMac->lim.limTimers.gLimEseTsmTimer);
712#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700713 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
714 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
715 while(((tANI_S32)--i) >= 0)
716 {
717 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
718 }
719 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700720 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
721 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
722 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
723 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
724 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
725 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
726 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800727 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800728 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Sushant Kaushik9e923872015-04-02 17:09:31 +0530729 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700730 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
731 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
732 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
733 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
734 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
735 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800736 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530737 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700738
739 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800740 {
Sushant Kaushikf4a27972015-04-16 16:48:00 +0530741 vos_mem_vfree(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800742 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
743 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700744
745 return TX_TIMER_ERROR;
746
Jeff Johnson295189b2012-06-20 16:38:30 -0700747} /****** end limCreateTimers() ******/
748
749
750
751/**
752 * limTimerHandler()
753 *
754 *FUNCTION:
755 * This function is called upon
756 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
757 * 2. JOIN_FAILURE timer expiration while joining a BSS
758 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
759 * 4. Heartbeat timer expiration on STA
760 * 5. Background scan timer expiration on STA
761 * 6. AID release, Pre-auth cleanup and Link monitoring timer
762 * expiration on AP
763 *
764 *LOGIC:
765 *
766 *ASSUMPTIONS:
767 * NA
768 *
769 *NOTE:
770 * NA
771 *
772 * @param param - Message corresponding to the timer that expired
773 *
774 * @return None
775 */
776
777void
778limTimerHandler(void *pMacGlobal, tANI_U32 param)
779{
780 tANI_U32 statusCode;
781 tSirMsgQ msg;
782 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
783
784 // Prepare and post message to LIM Message Queue
785
786 msg.type = (tANI_U16) param;
787 msg.bodyptr = NULL;
788 msg.bodyval = 0;
789
790 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
791 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700792 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700793 msg.type, statusCode);
794} /****** end limTimerHandler() ******/
795
796
797/**
798 * limAddtsResponseTimerHandler()
799 *
800 *FUNCTION:
801 * This function is called upon Addts response timer expiration on sta
802 *
803 *LOGIC:
804 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
805 * when this function is executed.
806 *
807 *ASSUMPTIONS:
808 * NA
809 *
810 *NOTE:
811 * NA
812 *
813 * @param param - pointer to pre-auth node
814 *
815 * @return None
816 */
817
818void
819limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
820{
821 tSirMsgQ msg;
822 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
823
824 // Prepare and post message to LIM Message Queue
825
826 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
827 msg.bodyval = param;
828 msg.bodyptr = NULL;
829
830 limPostMsgApi(pMac, &msg);
831} /****** end limAuthResponseTimerHandler() ******/
832
833
834/**
835 * limAuthResponseTimerHandler()
836 *
837 *FUNCTION:
838 * This function is called upon Auth response timer expiration on AP
839 *
840 *LOGIC:
841 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
842 * when this function is executed.
843 *
844 *ASSUMPTIONS:
845 * NA
846 *
847 *NOTE:
848 * NA
849 *
850 * @param param - pointer to pre-auth node
851 *
852 * @return None
853 */
854
855void
856limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
857{
858 tSirMsgQ msg;
859 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
860
861 // Prepare and post message to LIM Message Queue
862
863 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
864 msg.bodyptr = NULL;
865 msg.bodyval = (tANI_U32)param;
866
867 limPostMsgApi(pMac, &msg);
868} /****** end limAuthResponseTimerHandler() ******/
869
870
871
872/**
873 * limAssocFailureTimerHandler()
874 *
875 *FUNCTION:
876 * This function is called upon Re/Assoc failure timer expiration
877 * on STA
878 *
879 *LOGIC:
880 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
881 * when this function is executed.
882 *
883 *ASSUMPTIONS:
884 * NA
885 *
886 *NOTE:
887 * NA
888 *
889 * @param param - Indicates whether this is assoc or reassoc
890 * failure timeout
891 * @return None
892 */
893
894void
895limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
896{
897 tSirMsgQ msg;
898 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
899
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800900#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700901 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530902 (NULL != pMac->lim.pSessionEntry) &&
903 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700904 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700905 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Sachin Ahuja07a43012015-01-30 17:04:38 +0530906#ifdef FEATURE_WLAN_ESE
907 if (((pMac->lim.pSessionEntry->isESEconnection) &&
908 (pMac->lim.reAssocRetryAttempt <
909 (LIM_MAX_REASSOC_RETRY_LIMIT - 1)))||
910 ((!pMac->lim.pSessionEntry->isESEconnection) &&
911 (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT))
912 )
913#else
914 if (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
915#endif
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700916 {
917 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
918 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700919 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700920 return;
921 }
922 else
923 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700924 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700925 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
926 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530927 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700928 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
929 }
930 }
931 }
932#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700933 // Prepare and post message to LIM Message Queue
934
935 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
936 msg.bodyval = (tANI_U32)param;
937 msg.bodyptr = NULL;
938
939 limPostMsgApi(pMac, &msg);
940} /****** end limAssocFailureTimerHandler() ******/
941
942
943/**
944 * limUpdateOlbcCacheTimerHandler()
945 *
946 *FUNCTION:
947 * This function is called upon update olbc cache timer expiration
948 * on STA
949 *
950 *LOGIC:
951 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
952 * when this function is executed.
953 *
954 *ASSUMPTIONS:
955 * NA
956 *
957 *NOTE:
958 * NA
959 *
960 * @param
961 *
962 * @return None
963 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700964void
965limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
966{
967 tSirMsgQ msg;
968 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
969
970 // Prepare and post message to LIM Message Queue
971
972 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
973 msg.bodyval = 0;
974 msg.bodyptr = NULL;
975
976 limPostMsgApi(pMac, &msg);
977} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -0700978
979/**
980 * limDeactivateAndChangeTimer()
981 *
982 *FUNCTION:
983 * This function is called to deactivate and change a timer
984 * for future re-activation
985 *
986 *LOGIC:
987 *
988 *ASSUMPTIONS:
989 * NA
990 *
991 *NOTE:
992 * NA
993 *
994 * @param pMac - Pointer to Global MAC structure
995 * @param timerId - enum of timer to be deactivated and changed
996 * This enum is defined in limUtils.h file
997 *
998 * @return None
999 */
1000
1001void
1002limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1003{
1004 tANI_U32 val=0, val1=0;
Sushant Kaushik9e923872015-04-02 17:09:31 +05301005 tpPESession psessionEntry;
Jeff Johnson295189b2012-06-20 16:38:30 -07001006
Jeff Johnson295189b2012-06-20 16:38:30 -07001007 switch (timerId)
1008 {
1009 case eLIM_ADDTS_RSP_TIMER:
1010 pMac->lim.gLimAddtsRspTimerCount++;
1011 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1012 {
1013 // Could not deactivate AddtsRsp Timer
1014 // Log error
1015 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001016 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001017 }
1018 break;
1019
1020 case eLIM_MIN_CHANNEL_TIMER:
1021 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1022 != TX_SUCCESS)
1023 {
1024 // Could not deactivate min channel timer.
1025 // Log error
1026 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001027 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001028 }
1029
Jeff Johnsone7245742012-09-05 17:12:55 -07001030#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001031 // If a background was triggered via Quiet BSS,
1032 // then we need to adjust the MIN and MAX channel
1033 // timer's accordingly to the Quiet duration that
1034 // was specified
1035 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1036 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1037 {
1038 // gLimQuietDuration is already cached in units of
1039 // system ticks. No conversion is reqd...
1040 val = pMac->lim.gLimSpecMgmt.quietDuration;
1041 }
1042 else
1043 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001044#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001045 if(pMac->lim.gpLimMlmScanReq)
1046 {
1047 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001048 if (pMac->btc.btcScanCompromise)
1049 {
1050 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1051 {
1052 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1053 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1054 }
1055 else
1056 {
1057 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1058 }
1059 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001060 }
1061 else
1062 {
1063 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1064 //No need to change min timer. This is not a scan
1065 break;
1066 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001067#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001068 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001069#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001070
1071 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1072 val, 0) != TX_SUCCESS)
1073 {
1074 // Could not change min channel timer.
1075 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001076 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001077 }
1078
1079 break;
1080
1081 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1082 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1083 != TX_SUCCESS)
1084 {
1085 // Could not deactivate min channel timer.
1086 // Log error
1087 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001088 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001089 }
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301090 if(pMac->lim.gpLimMlmScanReq)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001091 {
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301092 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
1093 if (pMac->btc.btcScanCompromise)
1094 {
1095 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1096 {
1097 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1098 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1099 }
1100 else
1101 {
1102 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1103 }
1104 }
1105 }
1106 /*If val is 0 it means min Channel timer is 0 so take the value from maxChannelTimer*/
1107 if (!val)
1108 {
1109
1110 if(pMac->lim.gpLimMlmScanReq)
1111 {
1112 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime)/2;
1113 if (pMac->btc.btcScanCompromise)
1114 {
1115 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1116 {
1117 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)/2;
1118 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1119 }
1120 else
1121 {
1122 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1123 }
1124 }
1125 }
1126 else
1127 {
1128 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1129 //No need to change max timer. This is not a scan
1130 break;
1131 }
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001132 }
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301133 if (val)
Jeff Johnson295189b2012-06-20 16:38:30 -07001134 {
Mahesh A Saptasagarbfcdcc32015-09-24 17:41:51 +05301135 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1136 val, 0) != TX_SUCCESS)
1137 {
1138 // Could not change min channel timer.
1139 // Log error
1140 limLog(pMac, LOGE, FL("Unable to change periodic timer"));
1141 }
1142 }
1143 else
1144 {
1145 limLog(pMac, LOGE, FL("Do not change gLimPeriodicProbeReqTimer values,"
1146 "value = %d minchannel time = %d"
1147 "maxchannel time = %d"), val,
1148 pMac->lim.gpLimMlmScanReq->minChannelTime,
1149 pMac->lim.gpLimMlmScanReq->maxChannelTime);
Jeff Johnson295189b2012-06-20 16:38:30 -07001150 }
1151
1152 break;
1153
1154 case eLIM_MAX_CHANNEL_TIMER:
1155 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1156 != TX_SUCCESS)
1157 {
1158 // Could not deactivate max channel timer.
1159 // Log error
1160 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001161 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001162 }
1163
Jeff Johnson295189b2012-06-20 16:38:30 -07001164 // If a background was triggered via Quiet BSS,
1165 // then we need to adjust the MIN and MAX channel
1166 // timer's accordingly to the Quiet duration that
1167 // was specified
1168 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1169 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001170#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001171
1172 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1173 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1174 {
1175 // gLimQuietDuration is already cached in units of
1176 // system ticks. No conversion is reqd...
1177 val = pMac->lim.gLimSpecMgmt.quietDuration;
1178 }
1179 else
1180 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001181#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001182 if(pMac->lim.gpLimMlmScanReq)
1183 {
1184 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001185 if (pMac->btc.btcScanCompromise)
1186 {
1187 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1188 {
1189 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1190 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1191 }
1192 else
1193 {
1194 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1195 }
1196 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001197 }
1198 else
1199 {
1200 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1201 //No need to change max timer. This is not a scan
1202 break;
1203 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001204#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001205 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001206#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001207 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001208
1209 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1210 val, 0) != TX_SUCCESS)
1211 {
1212 // Could not change max channel timer.
1213 // Log error
1214 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001215 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001216 }
1217
1218 break;
1219
1220 case eLIM_JOIN_FAIL_TIMER:
1221 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1222 != TX_SUCCESS)
1223 {
1224 /**
1225 * Could not deactivate Join Failure
1226 * timer. Log error.
1227 */
1228 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001229 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001230 }
1231
1232 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1233 &val) != eSIR_SUCCESS)
1234 {
1235 /**
1236 * Could not get JoinFailureTimeout value
1237 * from CFG. Log error.
1238 */
1239 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001240 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001241 }
1242 val = SYS_MS_TO_TICKS(val);
1243
1244 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1245 val, 0) != TX_SUCCESS)
1246 {
1247 /**
1248 * Could not change Join Failure
1249 * timer. Log error.
1250 */
1251 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001252 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001253 }
1254
1255 break;
1256
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001257 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1258 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1259 != TX_SUCCESS)
1260 {
1261 // Could not deactivate periodic join req Times.
1262 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001263 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001264 }
1265
1266 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1267 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1268 val, 0) != TX_SUCCESS)
1269 {
1270 // Could not change periodic join req times.
1271 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001272 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001273 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001274
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001275 break;
1276
Jeff Johnson295189b2012-06-20 16:38:30 -07001277 case eLIM_AUTH_FAIL_TIMER:
1278 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1279 != TX_SUCCESS)
1280 {
1281 // Could not deactivate Auth failure timer.
1282 // Log error
1283 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001284 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001285 }
1286
1287 // Change timer to reactivate it in future
1288 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1289 &val) != eSIR_SUCCESS)
1290 {
1291 /**
1292 * Could not get AuthFailureTimeout value
1293 * from CFG. Log error.
1294 */
1295 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001296 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001297 }
1298 val = SYS_MS_TO_TICKS(val);
1299
1300 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1301 val, 0) != TX_SUCCESS)
1302 {
1303 // Could not change Authentication failure timer.
1304 // Log error
1305 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001306 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001307 }
1308
1309 break;
1310
Sushant Kaushik9e923872015-04-02 17:09:31 +05301311 case eLIM_AUTH_RETRY_TIMER:
1312
1313 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer)
1314 != TX_SUCCESS)
1315 {
1316 // Could not deactivate Auth Retry Timer.
1317 limLog(pMac, LOGP,
1318 FL("Unable to deactivate Auth Retry timer"));
1319 }
1320 if ((psessionEntry = peFindSessionBySessionId(pMac,
1321 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId))
1322 == NULL)
1323 {
1324 limLog(pMac, LOGP,
1325 FL("session does not exist for given SessionId : %d"),
1326 pMac->lim.limTimers.gLimPeriodicAuthRetryTimer.sessionId);
1327 break;
1328 }
1329 /* 3/5 of the beacon interval*/
1330 val = psessionEntry->beaconParams.beaconInterval * 3/5;
1331 val = SYS_MS_TO_TICKS(val);
1332 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer,
1333 val, 0) != TX_SUCCESS)
1334 {
1335 // Could not change Auth Retry timer.
1336 // Log error
1337 limLog(pMac, LOGP, FL("Unable to change Auth Retry timer"));
1338 }
1339
1340 break;
1341
Jeff Johnson295189b2012-06-20 16:38:30 -07001342 case eLIM_ASSOC_FAIL_TIMER:
1343 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1344 TX_SUCCESS)
1345 {
1346 // Could not deactivate Association failure timer.
1347 // Log error
1348 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001349 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 }
1351
1352 // Change timer to reactivate it in future
1353 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1354 &val) != eSIR_SUCCESS)
1355 {
1356 /**
1357 * Could not get AssocFailureTimeout value
1358 * from CFG. Log error.
1359 */
1360 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001361 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001362 }
1363 val = SYS_MS_TO_TICKS(val);
1364
1365 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1366 val, 0) != TX_SUCCESS)
1367 {
1368 // Could not change Association failure timer.
1369 // Log error
1370 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001371 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001372 }
1373
1374 break;
1375
1376 case eLIM_REASSOC_FAIL_TIMER:
1377 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1378 TX_SUCCESS)
1379 {
1380 // Could not deactivate Reassociation failure timer.
1381 // Log error
1382 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001383 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001384 }
1385
1386 // Change timer to reactivate it in future
1387 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1388 &val) != eSIR_SUCCESS)
1389 {
1390 /**
1391 * Could not get ReassocFailureTimeout value
1392 * from CFG. Log error.
1393 */
1394 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001395 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001396 }
1397 val = SYS_MS_TO_TICKS(val);
1398
1399 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1400 val, 0) != TX_SUCCESS)
1401 {
1402 // Could not change Reassociation failure timer.
1403 // Log error
1404 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001405 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 }
1407
1408 break;
1409
1410 case eLIM_HEART_BEAT_TIMER:
1411 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1412 TX_SUCCESS)
1413 {
1414 // Could not deactivate Heartbeat timer.
1415 // Log error
1416 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001417 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001418 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001419 else
1420 {
1421 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1422 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001423
1424 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1425 &val) != eSIR_SUCCESS)
1426 {
1427 /**
1428 * Could not get BEACON_INTERVAL value
1429 * from CFG. Log error.
1430 */
1431 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001432 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001433 }
1434
1435 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1436 eSIR_SUCCESS)
1437 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001438 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001439
1440 // Change timer to reactivate it in future
1441 val = SYS_MS_TO_TICKS(val * val1);
1442
1443 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1444 val, 0) != TX_SUCCESS)
1445 {
1446 // Could not change HeartBeat timer.
1447 // Log error
1448 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001449 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001450 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001451 else
1452 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001453 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001454 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001455 break;
1456
1457 case eLIM_PROBE_AFTER_HB_TIMER:
1458 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1459 TX_SUCCESS)
1460 {
1461 // Could not deactivate Heartbeat timer.
1462 // Log error
1463 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001464 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001465 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001466 else
1467 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301468 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001469 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001470
1471 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1472 &val) != eSIR_SUCCESS)
1473 {
1474 /**
1475 * Could not get PROBE_AFTER_HB_FAILURE
1476 * value from CFG. Log error.
1477 */
1478 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001479 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001480 }
1481
1482 // Change timer to reactivate it in future
1483 val = SYS_MS_TO_TICKS(val);
1484
1485 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1486 val, 0) != TX_SUCCESS)
1487 {
1488 // Could not change HeartBeat timer.
1489 // Log error
1490 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001491 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001492 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001493 else
1494 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001495 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001496 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001497
1498 break;
1499
1500 case eLIM_KEEPALIVE_TIMER:
1501 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1502 != TX_SUCCESS)
1503 {
1504 // Could not deactivate Keepalive timer.
1505 // Log error
1506 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001507 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001508 }
1509
1510 // Change timer to reactivate it in future
1511
1512 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1513 &val) != eSIR_SUCCESS)
1514 {
1515 /**
1516 * Could not get keepalive timeout value
1517 * from CFG. Log error.
1518 */
1519 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001520 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001521 }
1522 if (val == 0)
1523 {
1524 val = 3000;
1525 pMac->sch.keepAlive = 0;
1526 } else
1527 pMac->sch.keepAlive = 1;
1528
1529
1530
1531 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1532
1533 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1534 val, val) != TX_SUCCESS)
1535 {
1536 // Could not change KeepaliveTimer timer.
1537 // Log error
1538 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001539 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001540 }
1541
1542 break;
1543
Jeff Johnson295189b2012-06-20 16:38:30 -07001544 case eLIM_BACKGROUND_SCAN_TIMER:
1545 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1546 != TX_SUCCESS)
1547 {
1548 // Could not deactivate BackgroundScanTimer timer.
1549 // Log error
1550 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001551 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001552 }
1553
1554 // Change timer to reactivate it in future
1555 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1556 &val) != eSIR_SUCCESS)
1557 {
1558 /**
1559 * Could not get Background scan period value
1560 * from CFG. Log error.
1561 */
1562 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001563 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001564 }
1565 if (val == 0)
1566 {
1567 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1568 pMac->lim.gLimBackgroundScanDisable = true;
1569 }
1570 else
1571 pMac->lim.gLimBackgroundScanDisable = false;
1572
1573 val = SYS_MS_TO_TICKS(val);
1574
1575 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1576 val, val) != TX_SUCCESS)
1577 {
1578 // Could not change BackgroundScanTimer timer.
1579 // Log error
1580 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001581 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001582 }
1583
1584 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001585
Jeff Johnsone7245742012-09-05 17:12:55 -07001586#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001587 case eLIM_CHANNEL_SWITCH_TIMER:
1588 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1589 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001590 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001591 return;
1592 }
1593
1594 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1595 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1596 0) != TX_SUCCESS)
1597 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001598 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001599 return;
1600 }
1601 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001602#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001603
1604 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001605 break;
1606
Jeff Johnsone7245742012-09-05 17:12:55 -07001607#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001608 case eLIM_QUIET_BSS_TIMER:
1609 if (TX_SUCCESS !=
1610 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1611 {
1612 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001613 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001614 }
1615
1616 // gLimQuietDuration appears to be in units of ticks
1617 // Use it as is
1618 if (TX_SUCCESS !=
1619 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1620 pMac->lim.gLimSpecMgmt.quietDuration,
1621 0))
1622 {
1623 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001624 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001625 }
1626 break;
1627
1628 case eLIM_QUIET_TIMER:
1629 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1630 {
1631 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001632 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001633 }
1634
1635 // Set the NEW timeout value, in ticks
1636 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1637 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1638 {
1639 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001640 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001641 }
1642 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001643#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001644
Jeff Johnson295189b2012-06-20 16:38:30 -07001645#if 0
1646 case eLIM_WPS_OVERLAP_TIMER:
1647 {
1648 // Restart Learn Interval timer
1649
1650 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1651
1652 if (tx_timer_deactivate(
1653 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1654 {
1655 // Could not deactivate Learn Interval timer.
1656 // Log error
1657 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001658 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001659 }
1660
1661 if (tx_timer_change(
1662 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1663 WPSOverlapTimer, 0) != TX_SUCCESS)
1664 {
1665 // Could not change Learn Interval timer.
1666 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001667 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001668
1669 return;
1670 }
1671
1672 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001673 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001674 WPSOverlapTimer);
1675 }
1676 break;
1677#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001678
1679#ifdef WLAN_FEATURE_VOWIFI_11R
1680 case eLIM_FT_PREAUTH_RSP_TIMER:
1681 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1682 {
1683 /**
1684 ** Could not deactivate Join Failure
1685 ** timer. Log error.
1686 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001687 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001688 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001689 }
1690 val = 1000;
1691 val = SYS_MS_TO_TICKS(val);
1692 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1693 val, 0) != TX_SUCCESS)
1694 {
1695 /**
1696 * Could not change Join Failure
1697 * timer. Log error.
1698 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001699 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001700 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001701 }
1702 break;
1703#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001704#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001705 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001706 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001707 != TX_SUCCESS)
1708 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001709 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001710 }
1711 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001712#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301713
1714 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1715 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1716 {
1717 /**
1718 ** Could not deactivate Active to passive channel timer.
1719 ** Log error.
1720 **/
1721 limLog(pMac, LOGP, FL("Unable to Deactivate "
1722 "Active to passive channel timer"));
1723 return;
1724 }
1725 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1726 val = SYS_MS_TO_TICKS(val);
1727 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1728 val, 0) != TX_SUCCESS)
1729 {
1730 /**
1731 * Could not change timer to check scan type for passive channel.
1732 * timer. Log error.
1733 */
1734 limLog(pMac, LOGP, FL("Unable to change timer"));
1735 return;
1736 }
1737 break;
1738
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001739 case eLIM_DISASSOC_ACK_TIMER:
1740 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1741 {
1742 /**
1743 ** Could not deactivate Join Failure
1744 ** timer. Log error.
1745 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001746 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001747 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001748 }
1749 val = 1000;
1750 val = SYS_MS_TO_TICKS(val);
1751 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1752 val, 0) != TX_SUCCESS)
1753 {
1754 /**
1755 * Could not change Join Failure
1756 * timer. Log error.
1757 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001758 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001759 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001760 }
1761 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001762
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001763 case eLIM_DEAUTH_ACK_TIMER:
1764 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1765 {
1766 /**
1767 ** Could not deactivate Join Failure
1768 ** timer. Log error.
1769 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001770 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001771 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001772 }
1773 val = 1000;
1774 val = SYS_MS_TO_TICKS(val);
1775 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1776 val, 0) != TX_SUCCESS)
1777 {
1778 /**
1779 * Could not change Join Failure
1780 * timer. Log error.
1781 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001782 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001783 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001784 }
1785 break;
Viral Modid86bde22012-12-10 13:09:21 -08001786
Viral Modid86bde22012-12-10 13:09:21 -08001787 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1788 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1789 {
1790 /**
1791 ** Could not deactivate SingleShot NOA Insert
1792 ** timer. Log error.
1793 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001794 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001795 return;
1796 }
1797 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1798 val = SYS_MS_TO_TICKS(val);
1799 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1800 val, 0) != TX_SUCCESS)
1801 {
1802 /**
1803 * Could not change Single Shot NOA Insert
1804 * timer. Log error.
1805 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001806 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001807 return;
1808 }
1809 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001810
Jeff Johnson295189b2012-06-20 16:38:30 -07001811 default:
1812 // Invalid timerId. Log error
1813 break;
1814 }
1815} /****** end limDeactivateAndChangeTimer() ******/
1816
1817
1818
1819/**---------------------------------------------------------------
1820\fn limHeartBeatDeactivateAndChangeTimer
1821\brief This function deactivates and changes the heart beat
1822\ timer, eLIM_HEART_BEAT_TIMER.
1823\
1824\param pMac
1825\param psessionEntry
1826\return None
1827------------------------------------------------------------------*/
1828void
1829limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1830{
Ravi Joshid0699502013-07-08 15:48:47 -07001831 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001832
Siddharth Bhal224da542014-05-28 07:07:46 +05301833 if (NULL == psessionEntry)
1834 {
1835 limLog(pMac, LOGE, FL("%s: received session id NULL."
1836 " Heartbeat timer config failed"), __func__);
1837 return;
1838 }
1839
Yathish9f22e662012-12-10 14:21:35 -08001840#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001841 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1842 return;
Yathish9f22e662012-12-10 14:21:35 -08001843#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001844
Ravi Joshid0699502013-07-08 15:48:47 -07001845 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1846 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001847
Ravi Joshid0699502013-07-08 15:48:47 -07001848 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1849 changing. to avoid this problem, HeartBeat interval is made constant, by
1850 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001851
Ravi Joshid0699502013-07-08 15:48:47 -07001852 //val = psessionEntry->beaconParams.beaconInterval;
1853 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001854
Ravi Joshid0699502013-07-08 15:48:47 -07001855 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1856 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001857
Ravi Joshid0699502013-07-08 15:48:47 -07001858 PELOGW(limLog(pMac,LOGW,
1859 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1860 val1, psessionEntry->beaconParams.beaconInterval,
1861 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001862
Ravi Joshid0699502013-07-08 15:48:47 -07001863 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1864 * enough to judge the peer device inactivity when 32 peers are connected.
1865 * Hence increasing the HB timer timeout to
1866 * HBtimeout = (TBTT * num_beacons * num_peers)
1867 */
1868 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1869 pMac->lim.gLimNumIbssPeers > 0)
1870 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001871 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001872 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001873
Ravi Joshid0699502013-07-08 15:48:47 -07001874 // Change timer to reactivate it in future
1875 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001876
Ravi Joshid0699502013-07-08 15:48:47 -07001877 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1878 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001879
1880} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1881
1882
1883/**---------------------------------------------------------------
1884\fn limReactivateHeartBeatTimer
1885\brief This function s called to deactivate, change and
1886\ activate a timer.
1887\
1888\param pMac - Pointer to Global MAC structure
1889\param psessionEntry
1890\return None
1891------------------------------------------------------------------*/
1892void
1893limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1894{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301895 if (NULL == psessionEntry)
1896 {
1897 limLog(pMac, LOGE, FL("%s: received session id NULL."
1898 " Heartbeat timer config failed"), __func__);
1899 return;
1900 }
1901
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001902 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001903
Yathish9f22e662012-12-10 14:21:35 -08001904#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1905 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001906 {
1907 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001908 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001909 }
Yathish9f22e662012-12-10 14:21:35 -08001910#endif
1911
Jeff Johnson295189b2012-06-20 16:38:30 -07001912 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001913
1914 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001915 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1916 {
1917 /*
1918 * There is increasing need to limit the apps wakeup due to WLAN
1919 * activity. During HB monitoring, the beacons from peer are sent to
1920 * the host causing the host to wakeup. Hence, offloading the HB
1921 * monitoring to LMAC
1922 */
1923 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1924 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1925 {
1926 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1927 {
1928 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1929 }
1930 else
1931 {
1932 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1933 }
1934 }
1935 else
1936 {
1937 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1938 {
1939 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1940 }
1941 else
1942 {
1943 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1944 }
1945 }
1946 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001947 }
1948
1949} /****** end limReactivateHeartBeatTimer() ******/
1950
Jeff Johnson295189b2012-06-20 16:38:30 -07001951
1952/**
1953 * limActivateHearBeatTimer()
1954 *
1955 *
1956 * @brief: This function is called to activate heartbeat timer
1957 *
1958 *LOGIC:
1959 *
1960 *ASSUMPTIONS:
1961 * NA
1962 *
1963 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1964 *
1965 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001966 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001967 *
1968 * @return TX_SUCCESS - timer is activated
1969 * errors - fail to start the timer
1970 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001971v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001972{
1973 v_UINT_t status = TX_TIMER_ERROR;
1974
Yathish9f22e662012-12-10 14:21:35 -08001975#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1976 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001977 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001978#endif
1979
Jeff Johnson295189b2012-06-20 16:38:30 -07001980 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1981 {
1982 //consider 0 interval a ok case
1983 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1984 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001985 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1986 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1987 {
1988 /* HB offload in IBSS mode */
1989 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1990 if (TX_SUCCESS != status)
1991 {
1992 PELOGE(limLog(pMac, LOGE,
1993 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1994 status);)
1995 }
1996 else
1997 {
1998 PELOGE(limLog(pMac, LOGE,
1999 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
2000 __func__);)
2001 }
2002
2003 }
2004 else
2005 {
2006 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
2007 if ( TX_SUCCESS != status )
2008 {
2009 PELOGE(limLog(pMac, LOGE,
2010 FL("could not activate Heartbeat timer status(%d)"), status);)
2011 }
2012 else
2013 {
2014 PELOGE(limLog(pMac, LOGW,
2015 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
2016 }
2017 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002018 }
2019 else
2020 {
2021 status = TX_SUCCESS;
2022 }
2023 }
2024
2025 return (status);
2026}
2027
2028
2029
2030/**
2031 * limDeactivateAndChangePerStaIdTimer()
2032 *
2033 *
2034 * @brief: This function is called to deactivate and change a per STA timer
2035 * for future re-activation
2036 *
2037 *LOGIC:
2038 *
2039 *ASSUMPTIONS:
2040 * NA
2041 *
2042 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2043 *
2044 * @param pMac - Pointer to Global MAC structure
2045 * @param timerId - enum of timer to be deactivated and changed
2046 * This enum is defined in limUtils.h file
2047 * @param staId - staId
2048 *
2049 * @return None
2050 */
2051
2052void
2053limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2054{
2055 tANI_U32 val;
Jeff Johnson295189b2012-06-20 16:38:30 -07002056
2057 switch (timerId)
2058 {
2059 case eLIM_CNF_WAIT_TIMER:
2060
2061 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2062 != TX_SUCCESS)
2063 {
2064 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002065 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002066
2067 }
2068
2069 // Change timer to reactivate it in future
2070
2071 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2072 &val) != eSIR_SUCCESS)
2073 {
2074 /**
2075 * Could not get cnf timeout value
2076 * from CFG. Log error.
2077 */
2078 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002079 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002080 }
2081 val = SYS_MS_TO_TICKS(val);
2082
2083 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2084 val, val) != TX_SUCCESS)
2085 {
2086 // Could not change cnf timer.
2087 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002088 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002089 }
2090
2091 break;
2092
2093 case eLIM_AUTH_RSP_TIMER:
2094 {
2095 tLimPreAuthNode *pAuthNode;
2096
2097 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2098
2099 if (pAuthNode == NULL)
2100 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002101 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002102 break;
2103 }
2104
2105 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2106 {
2107 // Could not deactivate auth response timer.
2108 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002109 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002110 }
2111
2112 // Change timer to reactivate it in future
2113
2114 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2115 {
2116 /**
2117 * Could not get auth rsp timeout value
2118 * from CFG. Log error.
2119 */
2120 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002121 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002122 }
2123
2124 val = SYS_MS_TO_TICKS(val);
2125
2126 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2127 {
2128 // Could not change auth rsp timer.
2129 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002130 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002131 }
2132 }
2133 break;
2134
Jeff Johnson295189b2012-06-20 16:38:30 -07002135
2136 default:
2137 // Invalid timerId. Log error
2138 break;
2139
2140 }
2141}
2142
2143
2144/**
2145 * limActivateCnfTimer()
2146 *
2147 *FUNCTION:
2148 * This function is called to activate a per STA timer
2149 *
2150 *LOGIC:
2151 *
2152 *ASSUMPTIONS:
2153 * NA
2154 *
2155 *NOTE:
2156 * NA
2157 *
2158 * @param pMac - Pointer to Global MAC structure
2159 * @param StaId - staId
2160 *
2161 * @return None
2162 */
2163
2164void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2165{
Jeff Johnson295189b2012-06-20 16:38:30 -07002166 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2167 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2168 != TX_SUCCESS)
2169 {
2170 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002171 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002172 }
2173}
2174
2175/**
2176 * limActivateAuthRspTimer()
2177 *
2178 *FUNCTION:
2179 * This function is called to activate a per STA timer
2180 *
2181 *LOGIC:
2182 *
2183 *ASSUMPTIONS:
2184 * NA
2185 *
2186 *NOTE:
2187 * NA
2188 *
2189 * @param pMac - Pointer to Global MAC structure
2190 * @param id - id
2191 *
2192 * @return None
2193 */
2194
2195void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2196{
Jeff Johnson295189b2012-06-20 16:38:30 -07002197 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2198 {
2199 /// Could not activate auth rsp timer.
2200 // Log error
2201 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002202 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002203 }
2204}
2205
2206
2207/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002208 * limAssocCnfWaitTmerHandler()
2209 *
2210 *FUNCTION:
2211 * This function post a message to send a disassociate frame out.
2212 *
2213 *LOGIC:
2214 *
2215 *ASSUMPTIONS:
2216 *
2217 *NOTE:
2218 * NA
2219 *
2220 * @param
2221 *
2222 * @return None
2223 */
2224
2225void
2226limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2227{
2228 tSirMsgQ msg;
2229 tANI_U32 statusCode;
2230 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2231
2232 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2233 msg.bodyval = (tANI_U32)param;
2234 msg.bodyptr = NULL;
2235
2236 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2237 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002238 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002239
2240}
2241
2242/**
2243 * limKeepaliveTmerHandler()
2244 *
2245 *FUNCTION:
2246 * This function post a message to send a NULL data frame.
2247 *
2248 *LOGIC:
2249 *
2250 *ASSUMPTIONS:
2251 *
2252 *NOTE:
2253 * NA
2254 *
2255 * @param
2256 *
2257 * @return None
2258 */
2259
2260void
2261limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2262{
2263 tSirMsgQ msg;
2264 tANI_U32 statusCode;
2265 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2266
2267 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2268 msg.bodyval = (tANI_U32)param;
2269 msg.bodyptr = NULL;
2270
2271 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2272 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002273 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002274
2275}
2276
2277void
2278limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2279{
2280 tSirMsgQ msg;
2281 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2282
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302283 limLog(pMac, LOG1,
2284 FL("ChannelSwitch Timer expired. Posting msg to LIM "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002285
2286 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2287 msg.bodyval = (tANI_U32)param;
2288 msg.bodyptr = NULL;
2289
2290 limPostMsgApi(pMac, &msg);
2291}
2292
2293void
2294limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2295{
2296 tSirMsgQ msg;
2297 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2298
2299 msg.type = SIR_LIM_QUIET_TIMEOUT;
2300 msg.bodyval = (tANI_U32)param;
2301 msg.bodyptr = NULL;
2302
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302303 limLog(pMac, LOG1,
2304 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002305 limPostMsgApi(pMac, &msg);
2306}
2307
2308void
2309limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2310{
2311 tSirMsgQ msg;
2312 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2313
2314 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2315 msg.bodyval = (tANI_U32)param;
2316 msg.bodyptr = NULL;
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302317 limLog(pMac, LOG1,
2318 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002319 limPostMsgApi(pMac, &msg);
2320}
Jeff Johnson295189b2012-06-20 16:38:30 -07002321#if 0
2322void
2323limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2324{
2325 tSirMsgQ msg;
2326 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2327
2328 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2329 msg.bodyval = (tANI_U32)param;
2330 msg.bodyptr = NULL;
2331 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002332 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002333 limPostMsgApi(pMac, &msg);
2334}
2335#endif
Yathish9f22e662012-12-10 14:21:35 -08002336
2337#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2338/* ACTIVE_MODE_HB_OFFLOAD */
2339/**
2340 * limMissedBeaconInActiveMode()
2341 *
2342 *FUNCTION:
2343 * This function handle beacon miss indication from FW
2344 * in Active mode.
2345 *
2346 *LOGIC:
2347 *
2348 *ASSUMPTIONS:
2349 * NA
2350 *
2351 *NOTE:
2352 * NA
2353 *
2354 * @param param - Msg Type
2355 *
2356 * @return None
2357 */
2358void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002359limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002360{
2361 tANI_U32 statusCode;
2362 tSirMsgQ msg;
2363 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2364
2365 // Prepare and post message to LIM Message Queue
2366 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002367 {
Yathish9f22e662012-12-10 14:21:35 -08002368 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002369 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002370 msg.bodyval = 0;
2371 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002372 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002373 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2374 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002375 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002376 msg.type, statusCode);
2377 }
2378}
2379#endif