blob: f0480a91196e8b2b1f32725b0736553da095a76a [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
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
Jeff Johnson295189b2012-06-20 16:38:30 -070057
58//default beacon interval value used in HB timer interval calculation
59#define LIM_HB_TIMER_BEACON_INTERVAL 100
Gopichand Nakkalad492d202013-05-10 02:50:47 +053060
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053061/* This timer is a periodic timer which expires at every 1 sec to
Gopichand Nakkalad492d202013-05-10 02:50:47 +053062 convert ACTIVE DFS channel to DFS channels */
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053063#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
Gopichand Nakkalad492d202013-05-10 02:50:47 +053064
Jeff Johnson295189b2012-06-20 16:38:30 -070065/**
66 * limCreateTimers()
67 *
68 *FUNCTION:
69 * This function is called upon receiving
70 * 1. SME_START_REQ for STA in ESS role
71 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
72 *
73 *LOGIC:
74 *
75 *ASSUMPTIONS:
76 * NA
77 *
78 *NOTE:
79 * NA
80 *
81 * @param pMac - Pointer to Global MAC structure
82 *
83 * @return None
84 */
85
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070086v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070087limCreateTimers(tpAniSirGlobal pMac)
88{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070089 tANI_U32 cfgValue, i=0;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -080090 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -070091
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070092 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -070093
94 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
95 &cfgValue) != eSIR_SUCCESS)
96 {
97 /**
98 * Could not get MinChannelTimeout value
99 * from CFG. Log error.
100 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700101 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700102 }
103 cfgValue = SYS_MS_TO_TICKS(cfgValue);
104
105 // Create MIN/MAX channel timers and activate them later
106 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
107 "MIN CHANNEL TIMEOUT",
108 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
109 cfgValue, 0,
110 TX_NO_ACTIVATE) != TX_SUCCESS)
111 {
112 /// Could not start min channel timer.
113 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700114 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700115 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700116 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700117 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700118
119 /* Periodic probe request timer value is half of the Min channel
120 * timer. Probe request sends periodically till min/max channel
121 * timer expires
122 */
123
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800124 cfgValue1 = cfgValue/2 ;
125 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700126 {
127 // Create periodic probe request timer and activate them later
128 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
129 "Periodic Probe Request Timer",
130 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800131 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 TX_NO_ACTIVATE) != TX_SUCCESS)
133 {
134 /// Could not start Periodic Probe Req timer.
135 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700136 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700137 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700138 }
139 }
140
141
142 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
143 &cfgValue) != eSIR_SUCCESS)
144 {
145 /**
146 * Could not get MAXChannelTimeout value
147 * from CFG. Log error.
148 */
149 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700150 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700151 }
152 cfgValue = SYS_MS_TO_TICKS(cfgValue);
153
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800154 /* Limiting max numm of probe req for each channel scan */
155 pMac->lim.maxProbe = (cfgValue/cfgValue1);
156
Jeff Johnson295189b2012-06-20 16:38:30 -0700157 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
158 "MAX CHANNEL TIMEOUT",
159 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
160 cfgValue, 0,
161 TX_NO_ACTIVATE) != TX_SUCCESS)
162 {
163 /// Could not start max channel timer.
164 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700165 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700166
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700167 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700168 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700169 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700170
171 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
172 {
173 // Create Channel Switch Timer
174 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
175 "CHANNEL SWITCH TIMER",
176 limChannelSwitchTimerHandler,
177 0, // expiration_input
178 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
179 0, // reschedule_ticks
180 TX_NO_ACTIVATE) != TX_SUCCESS)
181 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700182 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700183 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700184 }
185
186 //
187 // Create Quiet Timer
188 // This is used on the STA to go and shut-off
189 // Tx/Rx "after" the specified quiteInterval
190 //
191 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
192 "QUIET TIMER",
193 limQuietTimerHandler,
194 SIR_LIM_QUIET_TIMEOUT, // expiration_input
195 LIM_QUIET_TIMER_TICKS, // initial_ticks
196 0, // reschedule_ticks
197 TX_NO_ACTIVATE) != TX_SUCCESS)
198 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700199 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700200 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700201 }
202
203 //
204 // Create Quiet BSS Timer
205 // After the specified quiteInterval, determined by
206 // gLimQuietTimer, this timer, gLimQuietBssTimer,
207 // trigger and put the STA to sleep for the specified
208 // gLimQuietDuration
209 //
210 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
211 "QUIET BSS TIMER",
212 limQuietBssTimerHandler,
213 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
214 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
215 0, // reschedule_ticks
216 TX_NO_ACTIVATE) != TX_SUCCESS)
217 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700218 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700219 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700220 }
221
222 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
223 &cfgValue) != eSIR_SUCCESS)
224 {
225 /**
226 * Could not get JoinFailureTimeout value
227 * from CFG. Log error.
228 */
229 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700230 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700231 }
232 cfgValue = SYS_MS_TO_TICKS(cfgValue);
233
234 // Create Join failure timer and activate it later
235 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
236 "JOIN FAILURE TIMEOUT",
237 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
238 cfgValue, 0,
239 TX_NO_ACTIVATE) != TX_SUCCESS)
240 {
241 /// Could not create Join failure timer.
242 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700243 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700244
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700245 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700246 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800247
Jeff Johnson62c27982013-02-27 17:53:55 -0800248 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800249 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
250 "Periodic Join Probe Request Timer",
251 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
252 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
253 TX_NO_ACTIVATE)) != TX_SUCCESS)
254 {
255 /// Could not create Periodic Join Probe Request timer.
256 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700257 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800258 goto err_timer;
259 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700260
261 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
262 &cfgValue) != eSIR_SUCCESS)
263 {
264 /**
265 * Could not get AssocFailureTimeout value
266 * from CFG. Log error.
267 */
268 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700269 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700270 }
271 cfgValue = SYS_MS_TO_TICKS(cfgValue);
272
273 // Create Association failure timer and activate it later
274 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
275 "ASSOC FAILURE TIMEOUT",
276 limAssocFailureTimerHandler, LIM_ASSOC,
277 cfgValue, 0,
278 TX_NO_ACTIVATE) != TX_SUCCESS)
279 {
280 /// Could not create Assoc failure timer.
281 // Log error
282 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700283 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700284
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700285 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700286 }
287 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
288 &cfgValue) != eSIR_SUCCESS)
289 {
290 /**
291 * Could not get ReassocFailureTimeout value
292 * from CFG. Log error.
293 */
294 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700295 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700296 }
297 cfgValue = SYS_MS_TO_TICKS(cfgValue);
298
299 // Create Association failure timer and activate it later
300 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
301 "REASSOC FAILURE TIMEOUT",
302 limAssocFailureTimerHandler, LIM_REASSOC,
303 cfgValue, 0,
304 TX_NO_ACTIVATE) != TX_SUCCESS)
305 {
306 /// Could not create Reassoc failure timer.
307 // Log error
308 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700309 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700310
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700311 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700312 }
313
314 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700315 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700316
317 cfgValue = SYS_MS_TO_TICKS(cfgValue);
318
319 // Create Addts response timer and activate it later
320 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
321 "ADDTS RSP TIMEOUT",
322 limAddtsResponseTimerHandler,
323 SIR_LIM_ADDTS_RSP_TIMEOUT,
324 cfgValue, 0,
325 TX_NO_ACTIVATE) != TX_SUCCESS)
326 {
327 /// Could not create Auth failure timer.
328 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700329 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700330
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700331 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700332 }
333
334 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
335 &cfgValue) != eSIR_SUCCESS)
336 {
337 /**
338 * Could not get AuthFailureTimeout value
339 * from CFG. Log error.
340 */
341 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700342 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700343 }
344 cfgValue = SYS_MS_TO_TICKS(cfgValue);
345
346 // Create Auth failure timer and activate it later
347 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
348 "AUTH FAILURE TIMEOUT",
349 limTimerHandler,
350 SIR_LIM_AUTH_FAIL_TIMEOUT,
351 cfgValue, 0,
352 TX_NO_ACTIVATE) != TX_SUCCESS)
353 {
354 /// Could not create Auth failure timer.
355 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700356 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700357
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700358 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700359 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800360
Jeff Johnson295189b2012-06-20 16:38:30 -0700361 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
362 &cfgValue) != eSIR_SUCCESS)
363 {
364 /**
365 * Could not get BEACON_INTERVAL value
366 * from CFG. Log error.
367 */
368 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700369 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700370 }
371 cfgValue = SYS_MS_TO_TICKS(cfgValue);
372
373 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
374 "Heartbeat TIMEOUT",
375 limTimerHandler,
376 SIR_LIM_HEART_BEAT_TIMEOUT,
377 cfgValue,
378 0,
379 TX_NO_ACTIVATE) != TX_SUCCESS)
380 {
381 /// Could not start Heartbeat timer.
382 // Log error
383 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700384 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700385 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700386 }
387
388 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
389 &cfgValue) != eSIR_SUCCESS)
390 {
391 /**
392 * Could not get PROBE_AFTER_HB_FAILURE
393 * value from CFG. Log error.
394 */
395 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700396 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700397 }
398
399 // Change timer to reactivate it in future
400 cfgValue = SYS_MS_TO_TICKS(cfgValue);
401
402 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
403 "Probe after Heartbeat TIMEOUT",
404 limTimerHandler,
405 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
406 cfgValue,
407 0,
408 TX_NO_ACTIVATE) != TX_SUCCESS)
409 {
410 // Could not creat wt-probe-after-HeartBeat-failure timer.
411 // Log error
412 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700413 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700414 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700415 }
416
Jeff Johnson295189b2012-06-20 16:38:30 -0700417 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
418 &cfgValue) != eSIR_SUCCESS)
419 {
420 /**
421 * Could not get Background scan period value
422 * from CFG. Log error.
423 */
424 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700425 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700426 }
427
428 /*
429 * setting period to zero means disabling background scans when associated
430 * the way we do this is to set a flag indicating this and keeping
431 * the timer running, since it will be used for PDU leak workarounds
432 * as well as background scanning during SME idle states
433 */
434 if (cfgValue == 0)
435 {
436 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
437 pMac->lim.gLimBackgroundScanDisable = true;
438 }
439 else
440 pMac->lim.gLimBackgroundScanDisable = false;
441
442 cfgValue = SYS_MS_TO_TICKS(cfgValue);
443
444 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
445 "Background scan TIMEOUT",
446 limTimerHandler,
447 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
448 cfgValue,
449 cfgValue,
450 TX_NO_ACTIVATE) != TX_SUCCESS)
451 {
452 /// Could not start background scan timer.
453 // Log error
454 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700455 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700456 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700457 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800458#ifdef FEATURE_WLAN_TDLS_INTERNAL
Jeff Johnson62c27982013-02-27 17:53:55 -0800459 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800460 * create TDLS timers..
461 * a) TDLS discovery response timer.
Jeff Johnson62c27982013-02-27 17:53:55 -0800462 */
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800463
464 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
465 &cfgValue) != eSIR_SUCCESS)
466 {
467 /*
468 * Could not get discovery response Timeout value
469 * from CFG. Log error.
470 */
471 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700472 FL("could not retrieve ReassocFailureTimeout value"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800473 }
474 cfgValue = SYS_MS_TO_TICKS(cfgValue);
475
Jeff Johnson62c27982013-02-27 17:53:55 -0800476 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800477 * create TDLS discovery response wait timer and activate it later
478 */
479 if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer,
480 "TDLS discovery response WAIT",
481 limTimerHandler,
482 SIR_LIM_TDLS_DISCOVERY_RSP_WAIT,
483 cfgValue, 0,
484 TX_NO_ACTIVATE) != TX_SUCCESS)
485 {
486 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700487 FL("could not create TDLS discovery response wait timer"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800488 goto err_timer;
489 }
490#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700491 }
492
Jeff Johnson295189b2012-06-20 16:38:30 -0700493 /**
494 * Create keepalive timer and activate it right away for AP role
495 */
496
497 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
498 &cfgValue) != eSIR_SUCCESS)
499 {
500 /**
501 * Could not get keepalive timeout value
502 * from CFG. Log error.
503 */
504 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700505 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700506 }
507
508 // A value of zero implies keep alive should be disabled
509 if (cfgValue == 0)
510 {
511 cfgValue = LIM_KEEPALIVE_TIMER_MS;
512 pMac->sch.keepAlive = 0;
513 } else
514 pMac->sch.keepAlive = 1;
515
516
517 cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1);
518
519 if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer,
520 "KEEPALIVE_TIMEOUT",
521 limKeepaliveTmerHandler,
522 0,
523 cfgValue,
524 cfgValue,
525 (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ?
526 TX_AUTO_ACTIVATE : TX_NO_ACTIVATE)
527 != TX_SUCCESS)
528 {
529 // Cannot create keepalive timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700530 limLog(pMac, LOGP, FL("Cannot create keepalive timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700531 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700532 }
533
534 /**
535 * Create all CNF_WAIT Timers upfront
536 */
537
538 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
539 &cfgValue) != eSIR_SUCCESS)
540 {
541 /**
542 * Could not get CNF_WAIT timeout value
543 * from CFG. Log error.
544 */
545 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700546 FL("could not retrieve CNF timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700547 }
548 cfgValue = SYS_MS_TO_TICKS(cfgValue);
549
550 for (i=0; i<pMac->lim.maxStation; i++)
551 {
552 if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
553 "CNF_MISS_TIMEOUT",
554 limCnfWaitTmerHandler,
555 (tANI_U32)i,
556 cfgValue,
557 0,
558 TX_NO_ACTIVATE) != TX_SUCCESS)
559 {
560 // Cannot create timer. Log error.
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700561 limLog(pMac, LOGP, FL("Cannot create CNF wait timer."));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700562 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700563 }
564 }
565
566 /*
567 ** Alloc and init table for the preAuth timer list
568 **
569 **/
570
571 // get max number of Preauthentication
572 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH,
573 &cfgValue) != eSIR_SUCCESS)
574 {
575 /*
576 ** Could not get max preauth value
577 ** from CFG. Log error.
578 **/
579 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700580 FL("could not retrieve mac preauth value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700581 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700582 pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530583 pMac->lim.gLimPreAuthTimerTable.pTable = vos_mem_malloc(cfgValue*sizeof(tLimPreAuthNode));
584 if(pMac->lim.gLimPreAuthTimerTable.pTable == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700585 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530586 limLog(pMac, LOGP, FL("AllocateMemory failed!"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700587 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700588 }
589
590 limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700591 PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700592
593
Jeff Johnson295189b2012-06-20 16:38:30 -0700594 {
595 /**
596 * Create OLBC cache aging timer
597 */
598 if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT,
599 &cfgValue) != eSIR_SUCCESS)
600 {
601 /**
602 * Could not get OLBC detect timeout value
603 * from CFG. Log error.
604 */
605 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700606 FL("could not retrieve OLBD detect timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700607 }
608
609 cfgValue = SYS_MS_TO_TICKS(cfgValue);
610
611 if (tx_timer_create(
612 &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
613 "OLBC UPDATE CACHE TIMEOUT",
614 limUpdateOlbcCacheTimerHandler,
615 SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT,
616 cfgValue,
617 cfgValue,
Madan Mohan Koyyalamudi788b4ee2012-09-25 10:42:09 -0700618 TX_NO_ACTIVATE) != TX_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700619 {
620 // Cannot create update OLBC cache timer
621 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700622 limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700623 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700624 }
625 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700626#ifdef WLAN_FEATURE_VOWIFI_11R
627 // In future we need to use the auth timer, cause
628 // the pre auth session will be introduced before sending
629 // Auth frame.
630 // We need to go off channel and come back to home channel
631 cfgValue = 1000;
632 cfgValue = SYS_MS_TO_TICKS(cfgValue);
633
634 if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
635 "FT PREAUTH RSP TIMEOUT",
636 limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
637 cfgValue, 0,
638 TX_NO_ACTIVATE) != TX_SUCCESS)
639 {
640 // Could not create Join failure timer.
641 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700642 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700643 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700644 }
645#endif
646
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800647#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700648 cfgValue = 5000;
649 cfgValue = SYS_MS_TO_TICKS(cfgValue);
650
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800651 if (tx_timer_create(&pMac->lim.limTimers.gLimEseTsmTimer,
652 "ESE TSM Stats TIMEOUT",
653 limTimerHandler, SIR_LIM_ESE_TSM_TIMEOUT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700654 cfgValue, 0,
655 TX_NO_ACTIVATE) != TX_SUCCESS)
656 {
657 // Could not create Join failure timer.
658 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700659 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700660 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700661 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800662#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700663
Jeff Johnson295189b2012-06-20 16:38:30 -0700664 cfgValue = 1000;
665 cfgValue = SYS_MS_TO_TICKS(cfgValue);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800666 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
667 "DISASSOC ACK TIMEOUT",
668 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
669 cfgValue, 0,
670 TX_NO_ACTIVATE) != TX_SUCCESS)
671 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700672 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800673 goto err_timer;
674 }
675
676 cfgValue = 1000;
677 cfgValue = SYS_MS_TO_TICKS(cfgValue);
678 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
679 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800680 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800681 cfgValue, 0,
682 TX_NO_ACTIVATE) != TX_SUCCESS)
683 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700684 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800685 goto err_timer;
686 }
Viral Modid86bde22012-12-10 13:09:21 -0800687
Viral Modid86bde22012-12-10 13:09:21 -0800688 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)
689 cfgValue = SYS_MS_TO_TICKS(cfgValue);
690 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
691 "Single Shot NOA Insert timeout",
692 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
693 cfgValue, 0,
694 TX_NO_ACTIVATE) != TX_SUCCESS)
695 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700696 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800697 goto err_timer;
698 }
Viral Modid86bde22012-12-10 13:09:21 -0800699
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530700 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
701 cfgValue = SYS_MS_TO_TICKS(cfgValue);
702 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
703 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
704 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
705 TX_NO_ACTIVATE) != TX_SUCCESS)
706 {
707 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
708 goto err_timer;
709 }
710
711
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700712 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700713
714 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800715 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800716 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800717#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
718 tx_timer_delete(&pMac->lim.limTimers.gLimEseTsmTimer);
719#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700720 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
721 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
722 while(((tANI_S32)--i) >= 0)
723 {
724 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
725 }
726 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700727 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
728 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
729 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
730 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
731 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
732 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
733 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800734 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800735 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700736 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
737 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
738 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
739 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
740 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
741 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800742 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530743 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700744
745 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800746 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530747 vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800748 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
749 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700750
751 return TX_TIMER_ERROR;
752
Jeff Johnson295189b2012-06-20 16:38:30 -0700753} /****** end limCreateTimers() ******/
754
755
756
757/**
758 * limTimerHandler()
759 *
760 *FUNCTION:
761 * This function is called upon
762 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
763 * 2. JOIN_FAILURE timer expiration while joining a BSS
764 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
765 * 4. Heartbeat timer expiration on STA
766 * 5. Background scan timer expiration on STA
767 * 6. AID release, Pre-auth cleanup and Link monitoring timer
768 * expiration on AP
769 *
770 *LOGIC:
771 *
772 *ASSUMPTIONS:
773 * NA
774 *
775 *NOTE:
776 * NA
777 *
778 * @param param - Message corresponding to the timer that expired
779 *
780 * @return None
781 */
782
783void
784limTimerHandler(void *pMacGlobal, tANI_U32 param)
785{
786 tANI_U32 statusCode;
787 tSirMsgQ msg;
788 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
789
790 // Prepare and post message to LIM Message Queue
791
792 msg.type = (tANI_U16) param;
793 msg.bodyptr = NULL;
794 msg.bodyval = 0;
795
796 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
797 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700798 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700799 msg.type, statusCode);
800} /****** end limTimerHandler() ******/
801
802
803/**
804 * limAddtsResponseTimerHandler()
805 *
806 *FUNCTION:
807 * This function is called upon Addts response timer expiration on sta
808 *
809 *LOGIC:
810 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
811 * when this function is executed.
812 *
813 *ASSUMPTIONS:
814 * NA
815 *
816 *NOTE:
817 * NA
818 *
819 * @param param - pointer to pre-auth node
820 *
821 * @return None
822 */
823
824void
825limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
826{
827 tSirMsgQ msg;
828 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
829
830 // Prepare and post message to LIM Message Queue
831
832 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
833 msg.bodyval = param;
834 msg.bodyptr = NULL;
835
836 limPostMsgApi(pMac, &msg);
837} /****** end limAuthResponseTimerHandler() ******/
838
839
840/**
841 * limAuthResponseTimerHandler()
842 *
843 *FUNCTION:
844 * This function is called upon Auth response timer expiration on AP
845 *
846 *LOGIC:
847 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
848 * when this function is executed.
849 *
850 *ASSUMPTIONS:
851 * NA
852 *
853 *NOTE:
854 * NA
855 *
856 * @param param - pointer to pre-auth node
857 *
858 * @return None
859 */
860
861void
862limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
863{
864 tSirMsgQ msg;
865 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
866
867 // Prepare and post message to LIM Message Queue
868
869 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
870 msg.bodyptr = NULL;
871 msg.bodyval = (tANI_U32)param;
872
873 limPostMsgApi(pMac, &msg);
874} /****** end limAuthResponseTimerHandler() ******/
875
876
877
878/**
879 * limAssocFailureTimerHandler()
880 *
881 *FUNCTION:
882 * This function is called upon Re/Assoc failure timer expiration
883 * on STA
884 *
885 *LOGIC:
886 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
887 * when this function is executed.
888 *
889 *ASSUMPTIONS:
890 * NA
891 *
892 *NOTE:
893 * NA
894 *
895 * @param param - Indicates whether this is assoc or reassoc
896 * failure timeout
897 * @return None
898 */
899
900void
901limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
902{
903 tSirMsgQ msg;
904 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
905
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800906#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700907 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530908 (NULL != pMac->lim.pSessionEntry) &&
909 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700910 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700911 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Sachin Ahuja07a43012015-01-30 17:04:38 +0530912#ifdef FEATURE_WLAN_ESE
913 if (((pMac->lim.pSessionEntry->isESEconnection) &&
914 (pMac->lim.reAssocRetryAttempt <
915 (LIM_MAX_REASSOC_RETRY_LIMIT - 1)))||
916 ((!pMac->lim.pSessionEntry->isESEconnection) &&
917 (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT))
918 )
919#else
920 if (pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
921#endif
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700922 {
923 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
924 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700925 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700926 return;
927 }
928 else
929 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700930 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700931 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
932 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530933 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700934 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
935 }
936 }
937 }
938#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700939 // Prepare and post message to LIM Message Queue
940
941 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
942 msg.bodyval = (tANI_U32)param;
943 msg.bodyptr = NULL;
944
945 limPostMsgApi(pMac, &msg);
946} /****** end limAssocFailureTimerHandler() ******/
947
948
949/**
950 * limUpdateOlbcCacheTimerHandler()
951 *
952 *FUNCTION:
953 * This function is called upon update olbc cache timer expiration
954 * on STA
955 *
956 *LOGIC:
957 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
958 * when this function is executed.
959 *
960 *ASSUMPTIONS:
961 * NA
962 *
963 *NOTE:
964 * NA
965 *
966 * @param
967 *
968 * @return None
969 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700970void
971limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
972{
973 tSirMsgQ msg;
974 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
975
976 // Prepare and post message to LIM Message Queue
977
978 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
979 msg.bodyval = 0;
980 msg.bodyptr = NULL;
981
982 limPostMsgApi(pMac, &msg);
983} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -0700984
985/**
986 * limDeactivateAndChangeTimer()
987 *
988 *FUNCTION:
989 * This function is called to deactivate and change a timer
990 * for future re-activation
991 *
992 *LOGIC:
993 *
994 *ASSUMPTIONS:
995 * NA
996 *
997 *NOTE:
998 * NA
999 *
1000 * @param pMac - Pointer to Global MAC structure
1001 * @param timerId - enum of timer to be deactivated and changed
1002 * This enum is defined in limUtils.h file
1003 *
1004 * @return None
1005 */
1006
1007void
1008limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1009{
1010 tANI_U32 val=0, val1=0;
1011
Jeff Johnsone7245742012-09-05 17:12:55 -07001012 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001013
1014 switch (timerId)
1015 {
1016 case eLIM_ADDTS_RSP_TIMER:
1017 pMac->lim.gLimAddtsRspTimerCount++;
1018 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1019 {
1020 // Could not deactivate AddtsRsp Timer
1021 // Log error
1022 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001023 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001024 }
1025 break;
1026
1027 case eLIM_MIN_CHANNEL_TIMER:
1028 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1029 != TX_SUCCESS)
1030 {
1031 // Could not deactivate min channel timer.
1032 // Log error
1033 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001034 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001035 }
1036
Jeff Johnsone7245742012-09-05 17:12:55 -07001037#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001038 // If a background was triggered via Quiet BSS,
1039 // then we need to adjust the MIN and MAX channel
1040 // timer's accordingly to the Quiet duration that
1041 // was specified
1042 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1043 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1044 {
1045 // gLimQuietDuration is already cached in units of
1046 // system ticks. No conversion is reqd...
1047 val = pMac->lim.gLimSpecMgmt.quietDuration;
1048 }
1049 else
1050 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001051#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001052 if(pMac->lim.gpLimMlmScanReq)
1053 {
1054 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001055 if (pMac->btc.btcScanCompromise)
1056 {
1057 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1058 {
1059 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1060 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1061 }
1062 else
1063 {
1064 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1065 }
1066 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001067 }
1068 else
1069 {
1070 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1071 //No need to change min timer. This is not a scan
1072 break;
1073 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001074#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001075 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001076#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001077
1078 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1079 val, 0) != TX_SUCCESS)
1080 {
1081 // Could not change min channel timer.
1082 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001083 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001084 }
1085
1086 break;
1087
1088 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1089 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1090 != TX_SUCCESS)
1091 {
1092 // Could not deactivate min channel timer.
1093 // Log error
1094 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001095 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001096 }
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301097 if(pMac->lim.gpLimMlmScanReq)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001098 {
Sachin Ahuja49dedd72014-11-24 16:35:24 +05301099 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
1100 if (pMac->btc.btcScanCompromise)
1101 {
1102 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1103 {
1104 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1105 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1106 }
1107 else
1108 {
1109 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1110 }
1111 }
1112 }
1113 /*If val is 0 it means min Channel timer is 0 so take the value from maxChannelTimer*/
1114 if (!val)
1115 {
1116
1117 if(pMac->lim.gpLimMlmScanReq)
1118 {
1119 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime)/2;
1120 if (pMac->btc.btcScanCompromise)
1121 {
1122 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1123 {
1124 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)/2;
1125 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1126 }
1127 else
1128 {
1129 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1130 }
1131 }
1132 }
1133 else
1134 {
1135 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1136 //No need to change max timer. This is not a scan
1137 break;
1138 }
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001139 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001140 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1141 val, 0) != TX_SUCCESS)
1142 {
1143 // Could not change min channel timer.
1144 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001145 limLog(pMac, LOGP, FL("Unable to change periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001146 }
1147
1148 break;
1149
1150 case eLIM_MAX_CHANNEL_TIMER:
1151 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1152 != TX_SUCCESS)
1153 {
1154 // Could not deactivate max channel timer.
1155 // Log error
1156 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001157 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001158 }
1159
Jeff Johnson295189b2012-06-20 16:38:30 -07001160 // If a background was triggered via Quiet BSS,
1161 // then we need to adjust the MIN and MAX channel
1162 // timer's accordingly to the Quiet duration that
1163 // was specified
1164 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1165 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001166#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001167
1168 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1169 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1170 {
1171 // gLimQuietDuration is already cached in units of
1172 // system ticks. No conversion is reqd...
1173 val = pMac->lim.gLimSpecMgmt.quietDuration;
1174 }
1175 else
1176 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001177#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001178 if(pMac->lim.gpLimMlmScanReq)
1179 {
1180 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001181 if (pMac->btc.btcScanCompromise)
1182 {
1183 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1184 {
1185 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1186 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1187 }
1188 else
1189 {
1190 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1191 }
1192 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001193 }
1194 else
1195 {
1196 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1197 //No need to change max timer. This is not a scan
1198 break;
1199 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001200#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001201 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001202#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001203 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001204
1205 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1206 val, 0) != TX_SUCCESS)
1207 {
1208 // Could not change max channel timer.
1209 // Log error
1210 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001211 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001212 }
1213
1214 break;
1215
1216 case eLIM_JOIN_FAIL_TIMER:
1217 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1218 != TX_SUCCESS)
1219 {
1220 /**
1221 * Could not deactivate Join Failure
1222 * timer. Log error.
1223 */
1224 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001225 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001226 }
1227
1228 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1229 &val) != eSIR_SUCCESS)
1230 {
1231 /**
1232 * Could not get JoinFailureTimeout value
1233 * from CFG. Log error.
1234 */
1235 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001236 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001237 }
1238 val = SYS_MS_TO_TICKS(val);
1239
1240 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1241 val, 0) != TX_SUCCESS)
1242 {
1243 /**
1244 * Could not change Join Failure
1245 * timer. Log error.
1246 */
1247 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001248 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001249 }
1250
1251 break;
1252
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001253 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1254 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1255 != TX_SUCCESS)
1256 {
1257 // Could not deactivate periodic join req Times.
1258 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001259 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001260 }
1261
1262 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1263 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1264 val, 0) != TX_SUCCESS)
1265 {
1266 // Could not change periodic join req times.
1267 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001268 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001269 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001270
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001271 break;
1272
Jeff Johnson295189b2012-06-20 16:38:30 -07001273 case eLIM_AUTH_FAIL_TIMER:
1274 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1275 != TX_SUCCESS)
1276 {
1277 // Could not deactivate Auth failure timer.
1278 // Log error
1279 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001280 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001281 }
1282
1283 // Change timer to reactivate it in future
1284 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1285 &val) != eSIR_SUCCESS)
1286 {
1287 /**
1288 * Could not get AuthFailureTimeout value
1289 * from CFG. Log error.
1290 */
1291 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001292 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001293 }
1294 val = SYS_MS_TO_TICKS(val);
1295
1296 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1297 val, 0) != TX_SUCCESS)
1298 {
1299 // Could not change Authentication failure timer.
1300 // Log error
1301 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001302 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001303 }
1304
1305 break;
1306
1307 case eLIM_ASSOC_FAIL_TIMER:
1308 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1309 TX_SUCCESS)
1310 {
1311 // Could not deactivate Association failure timer.
1312 // Log error
1313 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001314 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001315 }
1316
1317 // Change timer to reactivate it in future
1318 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1319 &val) != eSIR_SUCCESS)
1320 {
1321 /**
1322 * Could not get AssocFailureTimeout value
1323 * from CFG. Log error.
1324 */
1325 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001326 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001327 }
1328 val = SYS_MS_TO_TICKS(val);
1329
1330 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1331 val, 0) != TX_SUCCESS)
1332 {
1333 // Could not change Association failure timer.
1334 // Log error
1335 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001336 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001337 }
1338
1339 break;
1340
1341 case eLIM_REASSOC_FAIL_TIMER:
1342 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1343 TX_SUCCESS)
1344 {
1345 // Could not deactivate Reassociation failure timer.
1346 // Log error
1347 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001348 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001349 }
1350
1351 // Change timer to reactivate it in future
1352 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1353 &val) != eSIR_SUCCESS)
1354 {
1355 /**
1356 * Could not get ReassocFailureTimeout value
1357 * from CFG. Log error.
1358 */
1359 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001360 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001361 }
1362 val = SYS_MS_TO_TICKS(val);
1363
1364 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1365 val, 0) != TX_SUCCESS)
1366 {
1367 // Could not change Reassociation failure timer.
1368 // Log error
1369 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001370 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001371 }
1372
1373 break;
1374
1375 case eLIM_HEART_BEAT_TIMER:
1376 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1377 TX_SUCCESS)
1378 {
1379 // Could not deactivate Heartbeat timer.
1380 // Log error
1381 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001382 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001383 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001384 else
1385 {
1386 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1387 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001388
1389 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1390 &val) != eSIR_SUCCESS)
1391 {
1392 /**
1393 * Could not get BEACON_INTERVAL value
1394 * from CFG. Log error.
1395 */
1396 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001397 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001398 }
1399
1400 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1401 eSIR_SUCCESS)
1402 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001403 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001404
1405 // Change timer to reactivate it in future
1406 val = SYS_MS_TO_TICKS(val * val1);
1407
1408 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1409 val, 0) != TX_SUCCESS)
1410 {
1411 // Could not change HeartBeat timer.
1412 // Log error
1413 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001414 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001415 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001416 else
1417 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001418 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001419 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001420 break;
1421
1422 case eLIM_PROBE_AFTER_HB_TIMER:
1423 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1424 TX_SUCCESS)
1425 {
1426 // Could not deactivate Heartbeat timer.
1427 // Log error
1428 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001429 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001430 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001431 else
1432 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301433 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001434 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001435
1436 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1437 &val) != eSIR_SUCCESS)
1438 {
1439 /**
1440 * Could not get PROBE_AFTER_HB_FAILURE
1441 * value from CFG. Log error.
1442 */
1443 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001444 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001445 }
1446
1447 // Change timer to reactivate it in future
1448 val = SYS_MS_TO_TICKS(val);
1449
1450 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1451 val, 0) != TX_SUCCESS)
1452 {
1453 // Could not change HeartBeat timer.
1454 // Log error
1455 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001456 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001457 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001458 else
1459 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001460 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001461 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001462
1463 break;
1464
1465 case eLIM_KEEPALIVE_TIMER:
1466 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1467 != TX_SUCCESS)
1468 {
1469 // Could not deactivate Keepalive timer.
1470 // Log error
1471 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001472 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001473 }
1474
1475 // Change timer to reactivate it in future
1476
1477 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1478 &val) != eSIR_SUCCESS)
1479 {
1480 /**
1481 * Could not get keepalive timeout value
1482 * from CFG. Log error.
1483 */
1484 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001485 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001486 }
1487 if (val == 0)
1488 {
1489 val = 3000;
1490 pMac->sch.keepAlive = 0;
1491 } else
1492 pMac->sch.keepAlive = 1;
1493
1494
1495
1496 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1497
1498 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1499 val, val) != TX_SUCCESS)
1500 {
1501 // Could not change KeepaliveTimer timer.
1502 // Log error
1503 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001504 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001505 }
1506
1507 break;
1508
Jeff Johnson295189b2012-06-20 16:38:30 -07001509 case eLIM_BACKGROUND_SCAN_TIMER:
1510 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1511 != TX_SUCCESS)
1512 {
1513 // Could not deactivate BackgroundScanTimer timer.
1514 // Log error
1515 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001516 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001517 }
1518
1519 // Change timer to reactivate it in future
1520 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1521 &val) != eSIR_SUCCESS)
1522 {
1523 /**
1524 * Could not get Background scan period value
1525 * from CFG. Log error.
1526 */
1527 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001528 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001529 }
1530 if (val == 0)
1531 {
1532 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1533 pMac->lim.gLimBackgroundScanDisable = true;
1534 }
1535 else
1536 pMac->lim.gLimBackgroundScanDisable = false;
1537
1538 val = SYS_MS_TO_TICKS(val);
1539
1540 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1541 val, val) != TX_SUCCESS)
1542 {
1543 // Could not change BackgroundScanTimer timer.
1544 // Log error
1545 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001546 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001547 }
1548
1549 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001550
Jeff Johnsone7245742012-09-05 17:12:55 -07001551#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001552 case eLIM_CHANNEL_SWITCH_TIMER:
1553 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1554 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001555 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001556 return;
1557 }
1558
1559 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1560 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1561 0) != TX_SUCCESS)
1562 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001563 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001564 return;
1565 }
1566 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001567#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001568
1569 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001570 break;
1571
Jeff Johnsone7245742012-09-05 17:12:55 -07001572#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001573 case eLIM_QUIET_BSS_TIMER:
1574 if (TX_SUCCESS !=
1575 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1576 {
1577 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001578 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001579 }
1580
1581 // gLimQuietDuration appears to be in units of ticks
1582 // Use it as is
1583 if (TX_SUCCESS !=
1584 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1585 pMac->lim.gLimSpecMgmt.quietDuration,
1586 0))
1587 {
1588 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001589 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001590 }
1591 break;
1592
1593 case eLIM_QUIET_TIMER:
1594 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1595 {
1596 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001597 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001598 }
1599
1600 // Set the NEW timeout value, in ticks
1601 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1602 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1603 {
1604 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001605 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001606 }
1607 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001608#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001609
Jeff Johnson295189b2012-06-20 16:38:30 -07001610#if 0
1611 case eLIM_WPS_OVERLAP_TIMER:
1612 {
1613 // Restart Learn Interval timer
1614
1615 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1616
1617 if (tx_timer_deactivate(
1618 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1619 {
1620 // Could not deactivate Learn Interval timer.
1621 // Log error
1622 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001623 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001624 }
1625
1626 if (tx_timer_change(
1627 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1628 WPSOverlapTimer, 0) != TX_SUCCESS)
1629 {
1630 // Could not change Learn Interval timer.
1631 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001632 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001633
1634 return;
1635 }
1636
1637 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001638 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001639 WPSOverlapTimer);
1640 }
1641 break;
1642#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001643
1644#ifdef WLAN_FEATURE_VOWIFI_11R
1645 case eLIM_FT_PREAUTH_RSP_TIMER:
1646 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1647 {
1648 /**
1649 ** Could not deactivate Join Failure
1650 ** timer. Log error.
1651 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001652 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001653 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001654 }
1655 val = 1000;
1656 val = SYS_MS_TO_TICKS(val);
1657 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1658 val, 0) != TX_SUCCESS)
1659 {
1660 /**
1661 * Could not change Join Failure
1662 * timer. Log error.
1663 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001664 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001665 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001666 }
1667 break;
1668#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001669#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001670 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001671 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001672 != TX_SUCCESS)
1673 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001674 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001675 }
1676 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001677#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301678
1679 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1680 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1681 {
1682 /**
1683 ** Could not deactivate Active to passive channel timer.
1684 ** Log error.
1685 **/
1686 limLog(pMac, LOGP, FL("Unable to Deactivate "
1687 "Active to passive channel timer"));
1688 return;
1689 }
1690 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1691 val = SYS_MS_TO_TICKS(val);
1692 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1693 val, 0) != TX_SUCCESS)
1694 {
1695 /**
1696 * Could not change timer to check scan type for passive channel.
1697 * timer. Log error.
1698 */
1699 limLog(pMac, LOGP, FL("Unable to change timer"));
1700 return;
1701 }
1702 break;
1703
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001704 case eLIM_DISASSOC_ACK_TIMER:
1705 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1706 {
1707 /**
1708 ** Could not deactivate Join Failure
1709 ** timer. Log error.
1710 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001711 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001712 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001713 }
1714 val = 1000;
1715 val = SYS_MS_TO_TICKS(val);
1716 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1717 val, 0) != TX_SUCCESS)
1718 {
1719 /**
1720 * Could not change Join Failure
1721 * timer. Log error.
1722 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001723 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001724 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001725 }
1726 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001727
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001728 case eLIM_DEAUTH_ACK_TIMER:
1729 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1730 {
1731 /**
1732 ** Could not deactivate Join Failure
1733 ** timer. Log error.
1734 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001735 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001736 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001737 }
1738 val = 1000;
1739 val = SYS_MS_TO_TICKS(val);
1740 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1741 val, 0) != TX_SUCCESS)
1742 {
1743 /**
1744 * Could not change Join Failure
1745 * timer. Log error.
1746 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001747 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001748 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001749 }
1750 break;
Viral Modid86bde22012-12-10 13:09:21 -08001751
Viral Modid86bde22012-12-10 13:09:21 -08001752 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1753 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1754 {
1755 /**
1756 ** Could not deactivate SingleShot NOA Insert
1757 ** timer. Log error.
1758 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001759 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001760 return;
1761 }
1762 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1763 val = SYS_MS_TO_TICKS(val);
1764 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1765 val, 0) != TX_SUCCESS)
1766 {
1767 /**
1768 * Could not change Single Shot NOA Insert
1769 * timer. Log error.
1770 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001771 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001772 return;
1773 }
1774 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001775
Jeff Johnson295189b2012-06-20 16:38:30 -07001776 default:
1777 // Invalid timerId. Log error
1778 break;
1779 }
1780} /****** end limDeactivateAndChangeTimer() ******/
1781
1782
1783
1784/**---------------------------------------------------------------
1785\fn limHeartBeatDeactivateAndChangeTimer
1786\brief This function deactivates and changes the heart beat
1787\ timer, eLIM_HEART_BEAT_TIMER.
1788\
1789\param pMac
1790\param psessionEntry
1791\return None
1792------------------------------------------------------------------*/
1793void
1794limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1795{
Ravi Joshid0699502013-07-08 15:48:47 -07001796 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001797
Siddharth Bhal224da542014-05-28 07:07:46 +05301798 if (NULL == psessionEntry)
1799 {
1800 limLog(pMac, LOGE, FL("%s: received session id NULL."
1801 " Heartbeat timer config failed"), __func__);
1802 return;
1803 }
1804
Ravi Joshid0699502013-07-08 15:48:47 -07001805 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001806#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001807 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1808 return;
Yathish9f22e662012-12-10 14:21:35 -08001809#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001810
Ravi Joshid0699502013-07-08 15:48:47 -07001811 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1812 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001813
Ravi Joshid0699502013-07-08 15:48:47 -07001814 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1815 changing. to avoid this problem, HeartBeat interval is made constant, by
1816 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001817
Ravi Joshid0699502013-07-08 15:48:47 -07001818 //val = psessionEntry->beaconParams.beaconInterval;
1819 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001820
Ravi Joshid0699502013-07-08 15:48:47 -07001821 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1822 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001823
Ravi Joshid0699502013-07-08 15:48:47 -07001824 PELOGW(limLog(pMac,LOGW,
1825 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1826 val1, psessionEntry->beaconParams.beaconInterval,
1827 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001828
Ravi Joshid0699502013-07-08 15:48:47 -07001829 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1830 * enough to judge the peer device inactivity when 32 peers are connected.
1831 * Hence increasing the HB timer timeout to
1832 * HBtimeout = (TBTT * num_beacons * num_peers)
1833 */
1834 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1835 pMac->lim.gLimNumIbssPeers > 0)
1836 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001837 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001838 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001839
Ravi Joshid0699502013-07-08 15:48:47 -07001840 // Change timer to reactivate it in future
1841 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001842
Ravi Joshid0699502013-07-08 15:48:47 -07001843 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1844 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001845
1846} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1847
1848
1849/**---------------------------------------------------------------
1850\fn limReactivateHeartBeatTimer
1851\brief This function s called to deactivate, change and
1852\ activate a timer.
1853\
1854\param pMac - Pointer to Global MAC structure
1855\param psessionEntry
1856\return None
1857------------------------------------------------------------------*/
1858void
1859limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1860{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301861 if (NULL == psessionEntry)
1862 {
1863 limLog(pMac, LOGE, FL("%s: received session id NULL."
1864 " Heartbeat timer config failed"), __func__);
1865 return;
1866 }
1867
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001868 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001869
Yathish9f22e662012-12-10 14:21:35 -08001870#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1871 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001872 {
1873 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001874 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001875 }
Yathish9f22e662012-12-10 14:21:35 -08001876#endif
1877
Jeff Johnson295189b2012-06-20 16:38:30 -07001878 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001879 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001880
1881 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001882 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1883 {
1884 /*
1885 * There is increasing need to limit the apps wakeup due to WLAN
1886 * activity. During HB monitoring, the beacons from peer are sent to
1887 * the host causing the host to wakeup. Hence, offloading the HB
1888 * monitoring to LMAC
1889 */
1890 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1891 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1892 {
1893 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1894 {
1895 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1896 }
1897 else
1898 {
1899 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1900 }
1901 }
1902 else
1903 {
1904 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1905 {
1906 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1907 }
1908 else
1909 {
1910 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1911 }
1912 }
1913 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001914 }
1915
1916} /****** end limReactivateHeartBeatTimer() ******/
1917
Jeff Johnson295189b2012-06-20 16:38:30 -07001918
1919/**
1920 * limActivateHearBeatTimer()
1921 *
1922 *
1923 * @brief: This function is called to activate heartbeat timer
1924 *
1925 *LOGIC:
1926 *
1927 *ASSUMPTIONS:
1928 * NA
1929 *
1930 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1931 *
1932 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001933 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001934 *
1935 * @return TX_SUCCESS - timer is activated
1936 * errors - fail to start the timer
1937 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001938v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001939{
1940 v_UINT_t status = TX_TIMER_ERROR;
1941
Yathish9f22e662012-12-10 14:21:35 -08001942#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1943 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001944 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001945#endif
1946
Jeff Johnson295189b2012-06-20 16:38:30 -07001947 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1948 {
1949 //consider 0 interval a ok case
1950 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1951 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001952 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1953 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1954 {
1955 /* HB offload in IBSS mode */
1956 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1957 if (TX_SUCCESS != status)
1958 {
1959 PELOGE(limLog(pMac, LOGE,
1960 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1961 status);)
1962 }
1963 else
1964 {
1965 PELOGE(limLog(pMac, LOGE,
1966 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
1967 __func__);)
1968 }
1969
1970 }
1971 else
1972 {
1973 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1974 if ( TX_SUCCESS != status )
1975 {
1976 PELOGE(limLog(pMac, LOGE,
1977 FL("could not activate Heartbeat timer status(%d)"), status);)
1978 }
1979 else
1980 {
1981 PELOGE(limLog(pMac, LOGW,
1982 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
1983 }
1984 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001985 }
1986 else
1987 {
1988 status = TX_SUCCESS;
1989 }
1990 }
1991
1992 return (status);
1993}
1994
1995
1996
1997/**
1998 * limDeactivateAndChangePerStaIdTimer()
1999 *
2000 *
2001 * @brief: This function is called to deactivate and change a per STA timer
2002 * for future re-activation
2003 *
2004 *LOGIC:
2005 *
2006 *ASSUMPTIONS:
2007 * NA
2008 *
2009 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
2010 *
2011 * @param pMac - Pointer to Global MAC structure
2012 * @param timerId - enum of timer to be deactivated and changed
2013 * This enum is defined in limUtils.h file
2014 * @param staId - staId
2015 *
2016 * @return None
2017 */
2018
2019void
2020limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2021{
2022 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07002023 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07002024
2025 switch (timerId)
2026 {
2027 case eLIM_CNF_WAIT_TIMER:
2028
2029 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2030 != TX_SUCCESS)
2031 {
2032 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002033 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002034
2035 }
2036
2037 // Change timer to reactivate it in future
2038
2039 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2040 &val) != eSIR_SUCCESS)
2041 {
2042 /**
2043 * Could not get cnf timeout value
2044 * from CFG. Log error.
2045 */
2046 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002047 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002048 }
2049 val = SYS_MS_TO_TICKS(val);
2050
2051 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2052 val, val) != TX_SUCCESS)
2053 {
2054 // Could not change cnf timer.
2055 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002056 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002057 }
2058
2059 break;
2060
2061 case eLIM_AUTH_RSP_TIMER:
2062 {
2063 tLimPreAuthNode *pAuthNode;
2064
2065 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2066
2067 if (pAuthNode == NULL)
2068 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002069 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002070 break;
2071 }
2072
2073 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2074 {
2075 // Could not deactivate auth response timer.
2076 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002077 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002078 }
2079
2080 // Change timer to reactivate it in future
2081
2082 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2083 {
2084 /**
2085 * Could not get auth rsp timeout value
2086 * from CFG. Log error.
2087 */
2088 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002089 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002090 }
2091
2092 val = SYS_MS_TO_TICKS(val);
2093
2094 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2095 {
2096 // Could not change auth rsp timer.
2097 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002098 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002099 }
2100 }
2101 break;
2102
Jeff Johnson295189b2012-06-20 16:38:30 -07002103
2104 default:
2105 // Invalid timerId. Log error
2106 break;
2107
2108 }
2109}
2110
2111
2112/**
2113 * limActivateCnfTimer()
2114 *
2115 *FUNCTION:
2116 * This function is called to activate a per STA timer
2117 *
2118 *LOGIC:
2119 *
2120 *ASSUMPTIONS:
2121 * NA
2122 *
2123 *NOTE:
2124 * NA
2125 *
2126 * @param pMac - Pointer to Global MAC structure
2127 * @param StaId - staId
2128 *
2129 * @return None
2130 */
2131
2132void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2133{
Jeff Johnsone7245742012-09-05 17:12:55 -07002134 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002135 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2136 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2137 != TX_SUCCESS)
2138 {
2139 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002140 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002141 }
2142}
2143
2144/**
2145 * limActivateAuthRspTimer()
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 id - id
2160 *
2161 * @return None
2162 */
2163
2164void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2165{
Jeff Johnsone7245742012-09-05 17:12:55 -07002166 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002167 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2168 {
2169 /// Could not activate auth rsp timer.
2170 // Log error
2171 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002172 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002173 }
2174}
2175
2176
2177/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002178 * limAssocCnfWaitTmerHandler()
2179 *
2180 *FUNCTION:
2181 * This function post a message to send a disassociate frame out.
2182 *
2183 *LOGIC:
2184 *
2185 *ASSUMPTIONS:
2186 *
2187 *NOTE:
2188 * NA
2189 *
2190 * @param
2191 *
2192 * @return None
2193 */
2194
2195void
2196limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2197{
2198 tSirMsgQ msg;
2199 tANI_U32 statusCode;
2200 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2201
2202 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2203 msg.bodyval = (tANI_U32)param;
2204 msg.bodyptr = NULL;
2205
2206 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2207 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002208 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002209
2210}
2211
2212/**
2213 * limKeepaliveTmerHandler()
2214 *
2215 *FUNCTION:
2216 * This function post a message to send a NULL data frame.
2217 *
2218 *LOGIC:
2219 *
2220 *ASSUMPTIONS:
2221 *
2222 *NOTE:
2223 * NA
2224 *
2225 * @param
2226 *
2227 * @return None
2228 */
2229
2230void
2231limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2232{
2233 tSirMsgQ msg;
2234 tANI_U32 statusCode;
2235 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2236
2237 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2238 msg.bodyval = (tANI_U32)param;
2239 msg.bodyptr = NULL;
2240
2241 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2242 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002243 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002244
2245}
2246
2247void
2248limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2249{
2250 tSirMsgQ msg;
2251 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2252
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302253 limLog(pMac, LOG1,
2254 FL("ChannelSwitch Timer expired. Posting msg to LIM "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002255
2256 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2257 msg.bodyval = (tANI_U32)param;
2258 msg.bodyptr = NULL;
2259
2260 limPostMsgApi(pMac, &msg);
2261}
2262
2263void
2264limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2265{
2266 tSirMsgQ msg;
2267 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2268
2269 msg.type = SIR_LIM_QUIET_TIMEOUT;
2270 msg.bodyval = (tANI_U32)param;
2271 msg.bodyptr = NULL;
2272
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302273 limLog(pMac, LOG1,
2274 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002275 limPostMsgApi(pMac, &msg);
2276}
2277
2278void
2279limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2280{
2281 tSirMsgQ msg;
2282 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2283
2284 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2285 msg.bodyval = (tANI_U32)param;
2286 msg.bodyptr = NULL;
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302287 limLog(pMac, LOG1,
2288 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002289 limPostMsgApi(pMac, &msg);
2290}
Jeff Johnson295189b2012-06-20 16:38:30 -07002291#if 0
2292void
2293limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2294{
2295 tSirMsgQ msg;
2296 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2297
2298 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2299 msg.bodyval = (tANI_U32)param;
2300 msg.bodyptr = NULL;
2301 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002302 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002303 limPostMsgApi(pMac, &msg);
2304}
2305#endif
Yathish9f22e662012-12-10 14:21:35 -08002306
2307#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2308/* ACTIVE_MODE_HB_OFFLOAD */
2309/**
2310 * limMissedBeaconInActiveMode()
2311 *
2312 *FUNCTION:
2313 * This function handle beacon miss indication from FW
2314 * in Active mode.
2315 *
2316 *LOGIC:
2317 *
2318 *ASSUMPTIONS:
2319 * NA
2320 *
2321 *NOTE:
2322 * NA
2323 *
2324 * @param param - Msg Type
2325 *
2326 * @return None
2327 */
2328void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002329limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002330{
2331 tANI_U32 statusCode;
2332 tSirMsgQ msg;
2333 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2334
2335 // Prepare and post message to LIM Message Queue
2336 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002337 {
Yathish9f22e662012-12-10 14:21:35 -08002338 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002339 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002340 msg.bodyval = 0;
2341 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002342 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002343 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2344 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002345 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002346 msg.type, statusCode);
2347 }
2348}
2349#endif