blob: 23c87b5ff5e18f20da2bcbbd0f2d77f688629ac3 [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"));
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700912 if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
913 {
914 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
915 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700916 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700917 return;
918 }
919 else
920 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700921 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700922 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
923 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530924 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700925 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
926 }
927 }
928 }
929#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700930 // Prepare and post message to LIM Message Queue
931
932 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
933 msg.bodyval = (tANI_U32)param;
934 msg.bodyptr = NULL;
935
936 limPostMsgApi(pMac, &msg);
937} /****** end limAssocFailureTimerHandler() ******/
938
939
940/**
941 * limUpdateOlbcCacheTimerHandler()
942 *
943 *FUNCTION:
944 * This function is called upon update olbc cache timer expiration
945 * on STA
946 *
947 *LOGIC:
948 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
949 * when this function is executed.
950 *
951 *ASSUMPTIONS:
952 * NA
953 *
954 *NOTE:
955 * NA
956 *
957 * @param
958 *
959 * @return None
960 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700961void
962limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
963{
964 tSirMsgQ msg;
965 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
966
967 // Prepare and post message to LIM Message Queue
968
969 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
970 msg.bodyval = 0;
971 msg.bodyptr = NULL;
972
973 limPostMsgApi(pMac, &msg);
974} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -0700975
976/**
977 * limDeactivateAndChangeTimer()
978 *
979 *FUNCTION:
980 * This function is called to deactivate and change a timer
981 * for future re-activation
982 *
983 *LOGIC:
984 *
985 *ASSUMPTIONS:
986 * NA
987 *
988 *NOTE:
989 * NA
990 *
991 * @param pMac - Pointer to Global MAC structure
992 * @param timerId - enum of timer to be deactivated and changed
993 * This enum is defined in limUtils.h file
994 *
995 * @return None
996 */
997
998void
999limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1000{
1001 tANI_U32 val=0, val1=0;
1002
Jeff Johnsone7245742012-09-05 17:12:55 -07001003 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001004
1005 switch (timerId)
1006 {
1007 case eLIM_ADDTS_RSP_TIMER:
1008 pMac->lim.gLimAddtsRspTimerCount++;
1009 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1010 {
1011 // Could not deactivate AddtsRsp Timer
1012 // Log error
1013 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001014 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001015 }
1016 break;
1017
1018 case eLIM_MIN_CHANNEL_TIMER:
1019 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1020 != TX_SUCCESS)
1021 {
1022 // Could not deactivate min channel timer.
1023 // Log error
1024 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001025 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001026 }
1027
Jeff Johnsone7245742012-09-05 17:12:55 -07001028#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001029 // If a background was triggered via Quiet BSS,
1030 // then we need to adjust the MIN and MAX channel
1031 // timer's accordingly to the Quiet duration that
1032 // was specified
1033 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1034 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1035 {
1036 // gLimQuietDuration is already cached in units of
1037 // system ticks. No conversion is reqd...
1038 val = pMac->lim.gLimSpecMgmt.quietDuration;
1039 }
1040 else
1041 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001042#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001043 if(pMac->lim.gpLimMlmScanReq)
1044 {
1045 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001046 if (pMac->btc.btcScanCompromise)
1047 {
1048 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1049 {
1050 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1051 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1052 }
1053 else
1054 {
1055 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1056 }
1057 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001058 }
1059 else
1060 {
1061 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1062 //No need to change min timer. This is not a scan
1063 break;
1064 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001065#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001066 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001067#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001068
1069 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1070 val, 0) != TX_SUCCESS)
1071 {
1072 // Could not change min channel timer.
1073 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001074 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001075 }
1076
1077 break;
1078
1079 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1080 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1081 != TX_SUCCESS)
1082 {
1083 // Could not deactivate min channel timer.
1084 // Log error
1085 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001086 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001087 }
1088
1089 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001090 if (pMac->btc.btcScanCompromise)
1091 {
1092 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1093 {
1094 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1095 }
1096 else
1097 {
1098 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1099 }
1100 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001101 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1102 val, 0) != TX_SUCCESS)
1103 {
1104 // Could not change min channel timer.
1105 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001106 limLog(pMac, LOGP, FL("Unable to change periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001107 }
1108
1109 break;
1110
1111 case eLIM_MAX_CHANNEL_TIMER:
1112 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1113 != TX_SUCCESS)
1114 {
1115 // Could not deactivate max channel timer.
1116 // Log error
1117 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001118 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001119 }
1120
Jeff Johnson295189b2012-06-20 16:38:30 -07001121 // If a background was triggered via Quiet BSS,
1122 // then we need to adjust the MIN and MAX channel
1123 // timer's accordingly to the Quiet duration that
1124 // was specified
1125 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1126 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001127#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001128
1129 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1130 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1131 {
1132 // gLimQuietDuration is already cached in units of
1133 // system ticks. No conversion is reqd...
1134 val = pMac->lim.gLimSpecMgmt.quietDuration;
1135 }
1136 else
1137 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001138#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001139 if(pMac->lim.gpLimMlmScanReq)
1140 {
1141 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001142 if (pMac->btc.btcScanCompromise)
1143 {
1144 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1145 {
1146 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1147 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1148 }
1149 else
1150 {
1151 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1152 }
1153 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001154 }
1155 else
1156 {
1157 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1158 //No need to change max timer. This is not a scan
1159 break;
1160 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001161#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001162 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001163#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001164 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001165
1166 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1167 val, 0) != TX_SUCCESS)
1168 {
1169 // Could not change max channel timer.
1170 // Log error
1171 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001172 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001173 }
1174
1175 break;
1176
1177 case eLIM_JOIN_FAIL_TIMER:
1178 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1179 != TX_SUCCESS)
1180 {
1181 /**
1182 * Could not deactivate Join Failure
1183 * timer. Log error.
1184 */
1185 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001186 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001187 }
1188
1189 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1190 &val) != eSIR_SUCCESS)
1191 {
1192 /**
1193 * Could not get JoinFailureTimeout value
1194 * from CFG. Log error.
1195 */
1196 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001197 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001198 }
1199 val = SYS_MS_TO_TICKS(val);
1200
1201 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1202 val, 0) != TX_SUCCESS)
1203 {
1204 /**
1205 * Could not change Join Failure
1206 * timer. Log error.
1207 */
1208 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001209 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001210 }
1211
1212 break;
1213
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001214 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1215 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1216 != TX_SUCCESS)
1217 {
1218 // Could not deactivate periodic join req Times.
1219 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001220 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001221 }
1222
1223 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1224 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1225 val, 0) != TX_SUCCESS)
1226 {
1227 // Could not change periodic join req times.
1228 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001229 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001230 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001231
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001232 break;
1233
Jeff Johnson295189b2012-06-20 16:38:30 -07001234 case eLIM_AUTH_FAIL_TIMER:
1235 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1236 != TX_SUCCESS)
1237 {
1238 // Could not deactivate Auth failure timer.
1239 // Log error
1240 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001241 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001242 }
1243
1244 // Change timer to reactivate it in future
1245 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1246 &val) != eSIR_SUCCESS)
1247 {
1248 /**
1249 * Could not get AuthFailureTimeout value
1250 * from CFG. Log error.
1251 */
1252 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001253 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 }
1255 val = SYS_MS_TO_TICKS(val);
1256
1257 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1258 val, 0) != TX_SUCCESS)
1259 {
1260 // Could not change Authentication failure timer.
1261 // Log error
1262 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001263 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001264 }
1265
1266 break;
1267
1268 case eLIM_ASSOC_FAIL_TIMER:
1269 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1270 TX_SUCCESS)
1271 {
1272 // Could not deactivate Association failure timer.
1273 // Log error
1274 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001275 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001276 }
1277
1278 // Change timer to reactivate it in future
1279 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1280 &val) != eSIR_SUCCESS)
1281 {
1282 /**
1283 * Could not get AssocFailureTimeout value
1284 * from CFG. Log error.
1285 */
1286 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001287 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001288 }
1289 val = SYS_MS_TO_TICKS(val);
1290
1291 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1292 val, 0) != TX_SUCCESS)
1293 {
1294 // Could not change Association failure timer.
1295 // Log error
1296 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001297 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001298 }
1299
1300 break;
1301
1302 case eLIM_REASSOC_FAIL_TIMER:
1303 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1304 TX_SUCCESS)
1305 {
1306 // Could not deactivate Reassociation failure timer.
1307 // Log error
1308 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001309 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001310 }
1311
1312 // Change timer to reactivate it in future
1313 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1314 &val) != eSIR_SUCCESS)
1315 {
1316 /**
1317 * Could not get ReassocFailureTimeout value
1318 * from CFG. Log error.
1319 */
1320 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001321 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001322 }
1323 val = SYS_MS_TO_TICKS(val);
1324
1325 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1326 val, 0) != TX_SUCCESS)
1327 {
1328 // Could not change Reassociation failure timer.
1329 // Log error
1330 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001331 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001332 }
1333
1334 break;
1335
1336 case eLIM_HEART_BEAT_TIMER:
1337 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1338 TX_SUCCESS)
1339 {
1340 // Could not deactivate Heartbeat timer.
1341 // Log error
1342 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001343 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001344 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001345 else
1346 {
1347 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1348 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001349
1350 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1351 &val) != eSIR_SUCCESS)
1352 {
1353 /**
1354 * Could not get BEACON_INTERVAL value
1355 * from CFG. Log error.
1356 */
1357 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001358 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001359 }
1360
1361 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1362 eSIR_SUCCESS)
1363 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001364 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001365
1366 // Change timer to reactivate it in future
1367 val = SYS_MS_TO_TICKS(val * val1);
1368
1369 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1370 val, 0) != TX_SUCCESS)
1371 {
1372 // Could not change HeartBeat timer.
1373 // Log error
1374 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001375 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001377 else
1378 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001379 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001380 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001381 break;
1382
1383 case eLIM_PROBE_AFTER_HB_TIMER:
1384 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1385 TX_SUCCESS)
1386 {
1387 // Could not deactivate Heartbeat timer.
1388 // Log error
1389 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001390 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001391 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001392 else
1393 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301394 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001395 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001396
1397 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1398 &val) != eSIR_SUCCESS)
1399 {
1400 /**
1401 * Could not get PROBE_AFTER_HB_FAILURE
1402 * value from CFG. Log error.
1403 */
1404 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001405 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 }
1407
1408 // Change timer to reactivate it in future
1409 val = SYS_MS_TO_TICKS(val);
1410
1411 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1412 val, 0) != TX_SUCCESS)
1413 {
1414 // Could not change HeartBeat timer.
1415 // Log error
1416 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001417 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001418 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001419 else
1420 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001421 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001422 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001423
1424 break;
1425
1426 case eLIM_KEEPALIVE_TIMER:
1427 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1428 != TX_SUCCESS)
1429 {
1430 // Could not deactivate Keepalive timer.
1431 // Log error
1432 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001433 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001434 }
1435
1436 // Change timer to reactivate it in future
1437
1438 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1439 &val) != eSIR_SUCCESS)
1440 {
1441 /**
1442 * Could not get keepalive timeout value
1443 * from CFG. Log error.
1444 */
1445 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001446 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001447 }
1448 if (val == 0)
1449 {
1450 val = 3000;
1451 pMac->sch.keepAlive = 0;
1452 } else
1453 pMac->sch.keepAlive = 1;
1454
1455
1456
1457 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1458
1459 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1460 val, val) != TX_SUCCESS)
1461 {
1462 // Could not change KeepaliveTimer timer.
1463 // Log error
1464 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001465 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001466 }
1467
1468 break;
1469
Jeff Johnson295189b2012-06-20 16:38:30 -07001470 case eLIM_BACKGROUND_SCAN_TIMER:
1471 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1472 != TX_SUCCESS)
1473 {
1474 // Could not deactivate BackgroundScanTimer timer.
1475 // Log error
1476 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001477 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001478 }
1479
1480 // Change timer to reactivate it in future
1481 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1482 &val) != eSIR_SUCCESS)
1483 {
1484 /**
1485 * Could not get Background scan period value
1486 * from CFG. Log error.
1487 */
1488 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001489 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001490 }
1491 if (val == 0)
1492 {
1493 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1494 pMac->lim.gLimBackgroundScanDisable = true;
1495 }
1496 else
1497 pMac->lim.gLimBackgroundScanDisable = false;
1498
1499 val = SYS_MS_TO_TICKS(val);
1500
1501 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1502 val, val) != TX_SUCCESS)
1503 {
1504 // Could not change BackgroundScanTimer timer.
1505 // Log error
1506 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001507 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001508 }
1509
1510 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001511
Jeff Johnsone7245742012-09-05 17:12:55 -07001512#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001513 case eLIM_CHANNEL_SWITCH_TIMER:
1514 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1515 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001516 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001517 return;
1518 }
1519
1520 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1521 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1522 0) != TX_SUCCESS)
1523 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001524 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001525 return;
1526 }
1527 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001528#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001529
1530 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001531 break;
1532
Jeff Johnsone7245742012-09-05 17:12:55 -07001533#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001534 case eLIM_QUIET_BSS_TIMER:
1535 if (TX_SUCCESS !=
1536 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1537 {
1538 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001539 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001540 }
1541
1542 // gLimQuietDuration appears to be in units of ticks
1543 // Use it as is
1544 if (TX_SUCCESS !=
1545 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1546 pMac->lim.gLimSpecMgmt.quietDuration,
1547 0))
1548 {
1549 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001550 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001551 }
1552 break;
1553
1554 case eLIM_QUIET_TIMER:
1555 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1556 {
1557 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001558 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001559 }
1560
1561 // Set the NEW timeout value, in ticks
1562 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1563 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1564 {
1565 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001566 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001567 }
1568 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001569#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001570
Jeff Johnson295189b2012-06-20 16:38:30 -07001571#if 0
1572 case eLIM_WPS_OVERLAP_TIMER:
1573 {
1574 // Restart Learn Interval timer
1575
1576 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1577
1578 if (tx_timer_deactivate(
1579 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1580 {
1581 // Could not deactivate Learn Interval timer.
1582 // Log error
1583 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001584 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001585 }
1586
1587 if (tx_timer_change(
1588 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1589 WPSOverlapTimer, 0) != TX_SUCCESS)
1590 {
1591 // Could not change Learn Interval timer.
1592 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001593 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001594
1595 return;
1596 }
1597
1598 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001599 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001600 WPSOverlapTimer);
1601 }
1602 break;
1603#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001604
1605#ifdef WLAN_FEATURE_VOWIFI_11R
1606 case eLIM_FT_PREAUTH_RSP_TIMER:
1607 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1608 {
1609 /**
1610 ** Could not deactivate Join Failure
1611 ** timer. Log error.
1612 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001613 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001614 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001615 }
1616 val = 1000;
1617 val = SYS_MS_TO_TICKS(val);
1618 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1619 val, 0) != TX_SUCCESS)
1620 {
1621 /**
1622 * Could not change Join Failure
1623 * timer. Log error.
1624 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001625 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001626 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001627 }
1628 break;
1629#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001630#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001631 case eLIM_TSM_TIMER:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001632 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer)
Jeff Johnson295189b2012-06-20 16:38:30 -07001633 != TX_SUCCESS)
1634 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001635 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001636 }
1637 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001638#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301639
1640 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1641 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1642 {
1643 /**
1644 ** Could not deactivate Active to passive channel timer.
1645 ** Log error.
1646 **/
1647 limLog(pMac, LOGP, FL("Unable to Deactivate "
1648 "Active to passive channel timer"));
1649 return;
1650 }
1651 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1652 val = SYS_MS_TO_TICKS(val);
1653 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1654 val, 0) != TX_SUCCESS)
1655 {
1656 /**
1657 * Could not change timer to check scan type for passive channel.
1658 * timer. Log error.
1659 */
1660 limLog(pMac, LOGP, FL("Unable to change timer"));
1661 return;
1662 }
1663 break;
1664
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001665 case eLIM_DISASSOC_ACK_TIMER:
1666 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1667 {
1668 /**
1669 ** Could not deactivate Join Failure
1670 ** timer. Log error.
1671 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001672 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001673 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001674 }
1675 val = 1000;
1676 val = SYS_MS_TO_TICKS(val);
1677 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1678 val, 0) != TX_SUCCESS)
1679 {
1680 /**
1681 * Could not change Join Failure
1682 * timer. Log error.
1683 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001684 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001685 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001686 }
1687 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001688
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001689 case eLIM_DEAUTH_ACK_TIMER:
1690 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1691 {
1692 /**
1693 ** Could not deactivate Join Failure
1694 ** timer. Log error.
1695 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001696 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001697 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001698 }
1699 val = 1000;
1700 val = SYS_MS_TO_TICKS(val);
1701 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1702 val, 0) != TX_SUCCESS)
1703 {
1704 /**
1705 * Could not change Join Failure
1706 * timer. Log error.
1707 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001708 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001709 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001710 }
1711 break;
Viral Modid86bde22012-12-10 13:09:21 -08001712
Viral Modid86bde22012-12-10 13:09:21 -08001713 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1714 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1715 {
1716 /**
1717 ** Could not deactivate SingleShot NOA Insert
1718 ** timer. Log error.
1719 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001720 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001721 return;
1722 }
1723 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1724 val = SYS_MS_TO_TICKS(val);
1725 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1726 val, 0) != TX_SUCCESS)
1727 {
1728 /**
1729 * Could not change Single Shot NOA Insert
1730 * timer. Log error.
1731 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001732 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001733 return;
1734 }
1735 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001736
Jeff Johnson295189b2012-06-20 16:38:30 -07001737 default:
1738 // Invalid timerId. Log error
1739 break;
1740 }
1741} /****** end limDeactivateAndChangeTimer() ******/
1742
1743
1744
1745/**---------------------------------------------------------------
1746\fn limHeartBeatDeactivateAndChangeTimer
1747\brief This function deactivates and changes the heart beat
1748\ timer, eLIM_HEART_BEAT_TIMER.
1749\
1750\param pMac
1751\param psessionEntry
1752\return None
1753------------------------------------------------------------------*/
1754void
1755limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1756{
Ravi Joshid0699502013-07-08 15:48:47 -07001757 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001758
Siddharth Bhal224da542014-05-28 07:07:46 +05301759 if (NULL == psessionEntry)
1760 {
1761 limLog(pMac, LOGE, FL("%s: received session id NULL."
1762 " Heartbeat timer config failed"), __func__);
1763 return;
1764 }
1765
Ravi Joshid0699502013-07-08 15:48:47 -07001766 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001767#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001768 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1769 return;
Yathish9f22e662012-12-10 14:21:35 -08001770#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001771
Ravi Joshid0699502013-07-08 15:48:47 -07001772 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1773 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001774
Ravi Joshid0699502013-07-08 15:48:47 -07001775 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1776 changing. to avoid this problem, HeartBeat interval is made constant, by
1777 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001778
Ravi Joshid0699502013-07-08 15:48:47 -07001779 //val = psessionEntry->beaconParams.beaconInterval;
1780 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001781
Ravi Joshid0699502013-07-08 15:48:47 -07001782 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1783 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001784
Ravi Joshid0699502013-07-08 15:48:47 -07001785 PELOGW(limLog(pMac,LOGW,
1786 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1787 val1, psessionEntry->beaconParams.beaconInterval,
1788 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001789
Ravi Joshid0699502013-07-08 15:48:47 -07001790 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1791 * enough to judge the peer device inactivity when 32 peers are connected.
1792 * Hence increasing the HB timer timeout to
1793 * HBtimeout = (TBTT * num_beacons * num_peers)
1794 */
1795 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1796 pMac->lim.gLimNumIbssPeers > 0)
1797 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001798 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001799 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001800
Ravi Joshid0699502013-07-08 15:48:47 -07001801 // Change timer to reactivate it in future
1802 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001803
Ravi Joshid0699502013-07-08 15:48:47 -07001804 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1805 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001806
1807} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1808
1809
1810/**---------------------------------------------------------------
1811\fn limReactivateHeartBeatTimer
1812\brief This function s called to deactivate, change and
1813\ activate a timer.
1814\
1815\param pMac - Pointer to Global MAC structure
1816\param psessionEntry
1817\return None
1818------------------------------------------------------------------*/
1819void
1820limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1821{
Siddharth Bhald31c1252014-05-05 19:34:14 +05301822 if (NULL == psessionEntry)
1823 {
1824 limLog(pMac, LOGE, FL("%s: received session id NULL."
1825 " Heartbeat timer config failed"), __func__);
1826 return;
1827 }
1828
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001829 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001830
Yathish9f22e662012-12-10 14:21:35 -08001831#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1832 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001833 {
1834 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001835 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001836 }
Yathish9f22e662012-12-10 14:21:35 -08001837#endif
1838
Jeff Johnson295189b2012-06-20 16:38:30 -07001839 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001840 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001841
1842 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001843 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1844 {
1845 /*
1846 * There is increasing need to limit the apps wakeup due to WLAN
1847 * activity. During HB monitoring, the beacons from peer are sent to
1848 * the host causing the host to wakeup. Hence, offloading the HB
1849 * monitoring to LMAC
1850 */
1851 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1852 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1853 {
1854 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1855 {
1856 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1857 }
1858 else
1859 {
1860 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1861 }
1862 }
1863 else
1864 {
1865 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1866 {
1867 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1868 }
1869 else
1870 {
1871 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1872 }
1873 }
1874 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001875 }
1876
1877} /****** end limReactivateHeartBeatTimer() ******/
1878
Jeff Johnson295189b2012-06-20 16:38:30 -07001879
1880/**
1881 * limActivateHearBeatTimer()
1882 *
1883 *
1884 * @brief: This function is called to activate heartbeat timer
1885 *
1886 *LOGIC:
1887 *
1888 *ASSUMPTIONS:
1889 * NA
1890 *
1891 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1892 *
1893 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001894 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001895 *
1896 * @return TX_SUCCESS - timer is activated
1897 * errors - fail to start the timer
1898 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001899v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001900{
1901 v_UINT_t status = TX_TIMER_ERROR;
1902
Yathish9f22e662012-12-10 14:21:35 -08001903#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1904 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001905 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001906#endif
1907
Jeff Johnson295189b2012-06-20 16:38:30 -07001908 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1909 {
1910 //consider 0 interval a ok case
1911 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1912 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001913 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1914 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1915 {
1916 /* HB offload in IBSS mode */
1917 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1918 if (TX_SUCCESS != status)
1919 {
1920 PELOGE(limLog(pMac, LOGE,
1921 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1922 status);)
1923 }
1924 else
1925 {
1926 PELOGE(limLog(pMac, LOGE,
1927 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
1928 __func__);)
1929 }
1930
1931 }
1932 else
1933 {
1934 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1935 if ( TX_SUCCESS != status )
1936 {
1937 PELOGE(limLog(pMac, LOGE,
1938 FL("could not activate Heartbeat timer status(%d)"), status);)
1939 }
1940 else
1941 {
1942 PELOGE(limLog(pMac, LOGW,
1943 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
1944 }
1945 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001946 }
1947 else
1948 {
1949 status = TX_SUCCESS;
1950 }
1951 }
1952
1953 return (status);
1954}
1955
1956
1957
1958/**
1959 * limDeactivateAndChangePerStaIdTimer()
1960 *
1961 *
1962 * @brief: This function is called to deactivate and change a per STA timer
1963 * for future re-activation
1964 *
1965 *LOGIC:
1966 *
1967 *ASSUMPTIONS:
1968 * NA
1969 *
1970 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1971 *
1972 * @param pMac - Pointer to Global MAC structure
1973 * @param timerId - enum of timer to be deactivated and changed
1974 * This enum is defined in limUtils.h file
1975 * @param staId - staId
1976 *
1977 * @return None
1978 */
1979
1980void
1981limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
1982{
1983 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07001984 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001985
1986 switch (timerId)
1987 {
1988 case eLIM_CNF_WAIT_TIMER:
1989
1990 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
1991 != TX_SUCCESS)
1992 {
1993 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001994 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001995
1996 }
1997
1998 // Change timer to reactivate it in future
1999
2000 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2001 &val) != eSIR_SUCCESS)
2002 {
2003 /**
2004 * Could not get cnf timeout value
2005 * from CFG. Log error.
2006 */
2007 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002008 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002009 }
2010 val = SYS_MS_TO_TICKS(val);
2011
2012 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2013 val, val) != TX_SUCCESS)
2014 {
2015 // Could not change cnf timer.
2016 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002017 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002018 }
2019
2020 break;
2021
2022 case eLIM_AUTH_RSP_TIMER:
2023 {
2024 tLimPreAuthNode *pAuthNode;
2025
2026 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2027
2028 if (pAuthNode == NULL)
2029 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002030 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002031 break;
2032 }
2033
2034 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2035 {
2036 // Could not deactivate auth response timer.
2037 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002038 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002039 }
2040
2041 // Change timer to reactivate it in future
2042
2043 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2044 {
2045 /**
2046 * Could not get auth rsp timeout value
2047 * from CFG. Log error.
2048 */
2049 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002050 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 }
2052
2053 val = SYS_MS_TO_TICKS(val);
2054
2055 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2056 {
2057 // Could not change auth rsp timer.
2058 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002059 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002060 }
2061 }
2062 break;
2063
Jeff Johnson295189b2012-06-20 16:38:30 -07002064
2065 default:
2066 // Invalid timerId. Log error
2067 break;
2068
2069 }
2070}
2071
2072
2073/**
2074 * limActivateCnfTimer()
2075 *
2076 *FUNCTION:
2077 * This function is called to activate a per STA timer
2078 *
2079 *LOGIC:
2080 *
2081 *ASSUMPTIONS:
2082 * NA
2083 *
2084 *NOTE:
2085 * NA
2086 *
2087 * @param pMac - Pointer to Global MAC structure
2088 * @param StaId - staId
2089 *
2090 * @return None
2091 */
2092
2093void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2094{
Jeff Johnsone7245742012-09-05 17:12:55 -07002095 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002096 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2097 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2098 != TX_SUCCESS)
2099 {
2100 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002101 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002102 }
2103}
2104
2105/**
2106 * limActivateAuthRspTimer()
2107 *
2108 *FUNCTION:
2109 * This function is called to activate a per STA timer
2110 *
2111 *LOGIC:
2112 *
2113 *ASSUMPTIONS:
2114 * NA
2115 *
2116 *NOTE:
2117 * NA
2118 *
2119 * @param pMac - Pointer to Global MAC structure
2120 * @param id - id
2121 *
2122 * @return None
2123 */
2124
2125void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2126{
Jeff Johnsone7245742012-09-05 17:12:55 -07002127 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002128 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2129 {
2130 /// Could not activate auth rsp timer.
2131 // Log error
2132 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002133 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002134 }
2135}
2136
2137
2138/**
Jeff Johnson295189b2012-06-20 16:38:30 -07002139 * limAssocCnfWaitTmerHandler()
2140 *
2141 *FUNCTION:
2142 * This function post a message to send a disassociate frame out.
2143 *
2144 *LOGIC:
2145 *
2146 *ASSUMPTIONS:
2147 *
2148 *NOTE:
2149 * NA
2150 *
2151 * @param
2152 *
2153 * @return None
2154 */
2155
2156void
2157limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2158{
2159 tSirMsgQ msg;
2160 tANI_U32 statusCode;
2161 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2162
2163 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2164 msg.bodyval = (tANI_U32)param;
2165 msg.bodyptr = NULL;
2166
2167 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2168 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002169 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002170
2171}
2172
2173/**
2174 * limKeepaliveTmerHandler()
2175 *
2176 *FUNCTION:
2177 * This function post a message to send a NULL data frame.
2178 *
2179 *LOGIC:
2180 *
2181 *ASSUMPTIONS:
2182 *
2183 *NOTE:
2184 * NA
2185 *
2186 * @param
2187 *
2188 * @return None
2189 */
2190
2191void
2192limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2193{
2194 tSirMsgQ msg;
2195 tANI_U32 statusCode;
2196 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2197
2198 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2199 msg.bodyval = (tANI_U32)param;
2200 msg.bodyptr = NULL;
2201
2202 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2203 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002204 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002205
2206}
2207
2208void
2209limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2210{
2211 tSirMsgQ msg;
2212 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2213
2214 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002215 FL("ChannelSwitch Timer expired. Posting msg to LIM "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002216
2217 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2218 msg.bodyval = (tANI_U32)param;
2219 msg.bodyptr = NULL;
2220
2221 limPostMsgApi(pMac, &msg);
2222}
2223
2224void
2225limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2226{
2227 tSirMsgQ msg;
2228 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2229
2230 msg.type = SIR_LIM_QUIET_TIMEOUT;
2231 msg.bodyval = (tANI_U32)param;
2232 msg.bodyptr = NULL;
2233
2234 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002235 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002236 limPostMsgApi(pMac, &msg);
2237}
2238
2239void
2240limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2241{
2242 tSirMsgQ msg;
2243 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2244
2245 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2246 msg.bodyval = (tANI_U32)param;
2247 msg.bodyptr = NULL;
2248 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002249 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002250 limPostMsgApi(pMac, &msg);
2251}
Jeff Johnson295189b2012-06-20 16:38:30 -07002252#if 0
2253void
2254limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2255{
2256 tSirMsgQ msg;
2257 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2258
2259 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2260 msg.bodyval = (tANI_U32)param;
2261 msg.bodyptr = NULL;
2262 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002263 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002264 limPostMsgApi(pMac, &msg);
2265}
2266#endif
Yathish9f22e662012-12-10 14:21:35 -08002267
2268#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2269/* ACTIVE_MODE_HB_OFFLOAD */
2270/**
2271 * limMissedBeaconInActiveMode()
2272 *
2273 *FUNCTION:
2274 * This function handle beacon miss indication from FW
2275 * in Active mode.
2276 *
2277 *LOGIC:
2278 *
2279 *ASSUMPTIONS:
2280 * NA
2281 *
2282 *NOTE:
2283 * NA
2284 *
2285 * @param param - Msg Type
2286 *
2287 * @return None
2288 */
2289void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002290limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002291{
2292 tANI_U32 statusCode;
2293 tSirMsgQ msg;
2294 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2295
2296 // Prepare and post message to LIM Message Queue
2297 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002298 {
Yathish9f22e662012-12-10 14:21:35 -08002299 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002300 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002301 msg.bodyval = 0;
2302 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002303 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002304 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2305 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002306 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002307 msg.type, statusCode);
2308 }
2309}
2310#endif