blob: 08ca60cba109dd5a1501a01e6d533d9a6e3c3acf [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2014 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Jeff Johnson295189b2012-06-20 16:38:30 -07005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006/*
7 * Airgo Networks, Inc proprietary. All rights reserved.
8 * This file limTimerUtils.cc contains the utility functions
9 * LIM uses for handling various timers.
10 * Author: Chandra Modumudi
11 * Date: 02/13/02
12 * History:-
13 * Date Modified by Modification Information
14 * --------------------------------------------------------------------
15 */
16
17#include "limTypes.h"
18#include "limUtils.h"
19#include "limAssocUtils.h"
20#include "limSecurityUtils.h"
21#include "pmmApi.h"
22
23
24// default value 5000 ms for background scan period when it is disabled
25#define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000
26// channel Switch Timer in ticks
27#define LIM_CHANNEL_SWITCH_TIMER_TICKS 1
28// Lim Quite timer in ticks
29#define LIM_QUIET_TIMER_TICKS 100
Jeff Johnsonfeddb2d2012-12-10 14:41:22 -080030// Lim Quite BSS timer interval in ticks
Jeff Johnson295189b2012-06-20 16:38:30 -070031#define LIM_QUIET_BSS_TIMER_TICK 100
32// Lim KeepAlive timer default (3000)ms
33#define LIM_KEEPALIVE_TIMER_MS 3000
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -080034// Lim JoinProbeRequest Retry timer default (200)ms
35#define LIM_JOIN_PROBE_REQ_TIMER_MS 200
Jeff Johnson295189b2012-06-20 16:38:30 -070036
37//default beacon interval value used in HB timer interval calculation
38#define LIM_HB_TIMER_BEACON_INTERVAL 100
Gopichand Nakkalad492d202013-05-10 02:50:47 +053039
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053040/* This timer is a periodic timer which expires at every 1 sec to
Gopichand Nakkalad492d202013-05-10 02:50:47 +053041 convert ACTIVE DFS channel to DFS channels */
Madan Mohan Koyyalamudi98b82ce2013-07-11 17:03:55 +053042#define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000
Gopichand Nakkalad492d202013-05-10 02:50:47 +053043
Jeff Johnson295189b2012-06-20 16:38:30 -070044/**
45 * limCreateTimers()
46 *
47 *FUNCTION:
48 * This function is called upon receiving
49 * 1. SME_START_REQ for STA in ESS role
50 * 2. SME_START_BSS_REQ for AP role & STA in IBSS role
51 *
52 *LOGIC:
53 *
54 *ASSUMPTIONS:
55 * NA
56 *
57 *NOTE:
58 * NA
59 *
60 * @param pMac - Pointer to Global MAC structure
61 *
62 * @return None
63 */
64
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070065v_UINT_t
Jeff Johnson295189b2012-06-20 16:38:30 -070066limCreateTimers(tpAniSirGlobal pMac)
67{
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070068 tANI_U32 cfgValue, i=0;
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -080069 tANI_U32 cfgValue1;
Jeff Johnson295189b2012-06-20 16:38:30 -070070
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070071 PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d"), pMac->lim.gLimSystemRole);)
Jeff Johnson295189b2012-06-20 16:38:30 -070072
73 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME,
74 &cfgValue) != eSIR_SUCCESS)
75 {
76 /**
77 * Could not get MinChannelTimeout value
78 * from CFG. Log error.
79 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070080 limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -070081 }
82 cfgValue = SYS_MS_TO_TICKS(cfgValue);
83
84 // Create MIN/MAX channel timers and activate them later
85 if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer,
86 "MIN CHANNEL TIMEOUT",
87 limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT,
88 cfgValue, 0,
89 TX_NO_ACTIVATE) != TX_SUCCESS)
90 {
91 /// Could not start min channel timer.
92 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070093 limLog(pMac, LOGP, FL("could not create MIN channel timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -070094 return TX_TIMER_ERROR;
Jeff Johnson295189b2012-06-20 16:38:30 -070095 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070096 PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -070097
98 /* Periodic probe request timer value is half of the Min channel
99 * timer. Probe request sends periodically till min/max channel
100 * timer expires
101 */
102
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800103 cfgValue1 = cfgValue/2 ;
104 if( cfgValue1 >= 1)
Jeff Johnson295189b2012-06-20 16:38:30 -0700105 {
106 // Create periodic probe request timer and activate them later
107 if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
108 "Periodic Probe Request Timer",
109 limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT,
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800110 cfgValue1, 0,
Jeff Johnson295189b2012-06-20 16:38:30 -0700111 TX_NO_ACTIVATE) != TX_SUCCESS)
112 {
113 /// Could not start Periodic Probe Req timer.
114 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700115 limLog(pMac, LOGP, FL("could not create periodic probe timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700116 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700117 }
118 }
119
120
121 if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
122 &cfgValue) != eSIR_SUCCESS)
123 {
124 /**
125 * Could not get MAXChannelTimeout value
126 * from CFG. Log error.
127 */
128 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700129 FL("could not retrieve MAXChannelTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700130 }
131 cfgValue = SYS_MS_TO_TICKS(cfgValue);
132
Praveen Kumar Sirisilla7ea8dc92013-12-22 16:35:05 -0800133 /* Limiting max numm of probe req for each channel scan */
134 pMac->lim.maxProbe = (cfgValue/cfgValue1);
135
Jeff Johnson295189b2012-06-20 16:38:30 -0700136 if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer,
137 "MAX CHANNEL TIMEOUT",
138 limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT,
139 cfgValue, 0,
140 TX_NO_ACTIVATE) != TX_SUCCESS)
141 {
142 /// Could not start max channel timer.
143 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700144 limLog(pMac, LOGP, FL("could not create MAX channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700145
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700146 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700147 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700148 PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700149
150 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
151 {
152 // Create Channel Switch Timer
153 if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
154 "CHANNEL SWITCH TIMER",
155 limChannelSwitchTimerHandler,
156 0, // expiration_input
157 LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks
158 0, // reschedule_ticks
159 TX_NO_ACTIVATE) != TX_SUCCESS)
160 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700161 limLog(pMac, LOGP, FL("failed to create Channel Switch timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700162 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700163 }
164
165 //
166 // Create Quiet Timer
167 // This is used on the STA to go and shut-off
168 // Tx/Rx "after" the specified quiteInterval
169 //
170 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
171 "QUIET TIMER",
172 limQuietTimerHandler,
173 SIR_LIM_QUIET_TIMEOUT, // expiration_input
174 LIM_QUIET_TIMER_TICKS, // initial_ticks
175 0, // reschedule_ticks
176 TX_NO_ACTIVATE) != TX_SUCCESS)
177 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700178 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700179 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700180 }
181
182 //
183 // Create Quiet BSS Timer
184 // After the specified quiteInterval, determined by
185 // gLimQuietTimer, this timer, gLimQuietBssTimer,
186 // trigger and put the STA to sleep for the specified
187 // gLimQuietDuration
188 //
189 if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
190 "QUIET BSS TIMER",
191 limQuietBssTimerHandler,
192 SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input
193 LIM_QUIET_BSS_TIMER_TICK, // initial_ticks
194 0, // reschedule_ticks
195 TX_NO_ACTIVATE) != TX_SUCCESS)
196 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700197 limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700198 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700199 }
200
201 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
202 &cfgValue) != eSIR_SUCCESS)
203 {
204 /**
205 * Could not get JoinFailureTimeout value
206 * from CFG. Log error.
207 */
208 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700209 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700210 }
211 cfgValue = SYS_MS_TO_TICKS(cfgValue);
212
213 // Create Join failure timer and activate it later
214 if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
215 "JOIN FAILURE TIMEOUT",
216 limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT,
217 cfgValue, 0,
218 TX_NO_ACTIVATE) != TX_SUCCESS)
219 {
220 /// Could not create Join failure timer.
221 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700222 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700223
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700224 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 }
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800226
Jeff Johnson62c27982013-02-27 17:53:55 -0800227 //Send unicast probe req frame every 200 ms
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800228 if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
229 "Periodic Join Probe Request Timer",
230 limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
231 SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
232 TX_NO_ACTIVATE)) != TX_SUCCESS)
233 {
234 /// Could not create Periodic Join Probe Request timer.
235 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700236 limLog(pMac, LOGP, FL("could not create Periodic Join Probe Request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800237 goto err_timer;
238 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700239
240 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
241 &cfgValue) != eSIR_SUCCESS)
242 {
243 /**
244 * Could not get AssocFailureTimeout value
245 * from CFG. Log error.
246 */
247 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700248 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700249 }
250 cfgValue = SYS_MS_TO_TICKS(cfgValue);
251
252 // Create Association failure timer and activate it later
253 if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
254 "ASSOC FAILURE TIMEOUT",
255 limAssocFailureTimerHandler, LIM_ASSOC,
256 cfgValue, 0,
257 TX_NO_ACTIVATE) != TX_SUCCESS)
258 {
259 /// Could not create Assoc failure timer.
260 // Log error
261 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700262 FL("could not create Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700263
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700264 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700265 }
266 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
267 &cfgValue) != eSIR_SUCCESS)
268 {
269 /**
270 * Could not get ReassocFailureTimeout value
271 * from CFG. Log error.
272 */
273 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700274 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700275 }
276 cfgValue = SYS_MS_TO_TICKS(cfgValue);
277
278 // Create Association failure timer and activate it later
279 if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer,
280 "REASSOC FAILURE TIMEOUT",
281 limAssocFailureTimerHandler, LIM_REASSOC,
282 cfgValue, 0,
283 TX_NO_ACTIVATE) != TX_SUCCESS)
284 {
285 /// Could not create Reassoc failure timer.
286 // Log error
287 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700288 FL("could not create Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700289
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700290 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700291 }
292
293 if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700294 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700295
296 cfgValue = SYS_MS_TO_TICKS(cfgValue);
297
298 // Create Addts response timer and activate it later
299 if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
300 "ADDTS RSP TIMEOUT",
301 limAddtsResponseTimerHandler,
302 SIR_LIM_ADDTS_RSP_TIMEOUT,
303 cfgValue, 0,
304 TX_NO_ACTIVATE) != TX_SUCCESS)
305 {
306 /// Could not create Auth failure timer.
307 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700308 limLog(pMac, LOGP, FL("could not create Addts response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700309
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700310 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700311 }
312
313 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
314 &cfgValue) != eSIR_SUCCESS)
315 {
316 /**
317 * Could not get AuthFailureTimeout value
318 * from CFG. Log error.
319 */
320 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700321 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700322 }
323 cfgValue = SYS_MS_TO_TICKS(cfgValue);
324
325 // Create Auth failure timer and activate it later
326 if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
327 "AUTH FAILURE TIMEOUT",
328 limTimerHandler,
329 SIR_LIM_AUTH_FAIL_TIMEOUT,
330 cfgValue, 0,
331 TX_NO_ACTIVATE) != TX_SUCCESS)
332 {
333 /// Could not create Auth failure timer.
334 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700335 limLog(pMac, LOGP, FL("could not create Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700336
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700337 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700338 }
Jeff Johnson41707a42013-02-14 07:54:26 -0800339
Jeff Johnson295189b2012-06-20 16:38:30 -0700340 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
341 &cfgValue) != eSIR_SUCCESS)
342 {
343 /**
344 * Could not get BEACON_INTERVAL value
345 * from CFG. Log error.
346 */
347 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700348 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700349 }
350 cfgValue = SYS_MS_TO_TICKS(cfgValue);
351
352 if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer,
353 "Heartbeat TIMEOUT",
354 limTimerHandler,
355 SIR_LIM_HEART_BEAT_TIMEOUT,
356 cfgValue,
357 0,
358 TX_NO_ACTIVATE) != TX_SUCCESS)
359 {
360 /// Could not start Heartbeat timer.
361 // Log error
362 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700363 FL("call to create heartbeat timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700364 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700365 }
366
367 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
368 &cfgValue) != eSIR_SUCCESS)
369 {
370 /**
371 * Could not get PROBE_AFTER_HB_FAILURE
372 * value from CFG. Log error.
373 */
374 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700375 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700376 }
377
378 // Change timer to reactivate it in future
379 cfgValue = SYS_MS_TO_TICKS(cfgValue);
380
381 if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
382 "Probe after Heartbeat TIMEOUT",
383 limTimerHandler,
384 SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
385 cfgValue,
386 0,
387 TX_NO_ACTIVATE) != TX_SUCCESS)
388 {
389 // Could not creat wt-probe-after-HeartBeat-failure timer.
390 // Log error
391 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700392 FL("unable to create ProbeAfterHBTimer"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700393 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700394 }
395
Jeff Johnson295189b2012-06-20 16:38:30 -0700396 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
397 &cfgValue) != eSIR_SUCCESS)
398 {
399 /**
400 * Could not get Background scan period value
401 * from CFG. Log error.
402 */
403 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700404 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700405 }
406
407 /*
408 * setting period to zero means disabling background scans when associated
409 * the way we do this is to set a flag indicating this and keeping
410 * the timer running, since it will be used for PDU leak workarounds
411 * as well as background scanning during SME idle states
412 */
413 if (cfgValue == 0)
414 {
415 cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
416 pMac->lim.gLimBackgroundScanDisable = true;
417 }
418 else
419 pMac->lim.gLimBackgroundScanDisable = false;
420
421 cfgValue = SYS_MS_TO_TICKS(cfgValue);
422
423 if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer,
424 "Background scan TIMEOUT",
425 limTimerHandler,
426 SIR_LIM_CHANNEL_SCAN_TIMEOUT,
427 cfgValue,
428 cfgValue,
429 TX_NO_ACTIVATE) != TX_SUCCESS)
430 {
431 /// Could not start background scan timer.
432 // Log error
433 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700434 FL("call to create background scan timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700435 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700436 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800437#ifdef FEATURE_WLAN_TDLS_INTERNAL
Jeff Johnson62c27982013-02-27 17:53:55 -0800438 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800439 * create TDLS timers..
440 * a) TDLS discovery response timer.
Jeff Johnson62c27982013-02-27 17:53:55 -0800441 */
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800442
443 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
444 &cfgValue) != eSIR_SUCCESS)
445 {
446 /*
447 * Could not get discovery response Timeout value
448 * from CFG. Log error.
449 */
450 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700451 FL("could not retrieve ReassocFailureTimeout value"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800452 }
453 cfgValue = SYS_MS_TO_TICKS(cfgValue);
454
Jeff Johnson62c27982013-02-27 17:53:55 -0800455 /*
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800456 * create TDLS discovery response wait timer and activate it later
457 */
458 if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer,
459 "TDLS discovery response WAIT",
460 limTimerHandler,
461 SIR_LIM_TDLS_DISCOVERY_RSP_WAIT,
462 cfgValue, 0,
463 TX_NO_ACTIVATE) != TX_SUCCESS)
464 {
465 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700466 FL("could not create TDLS discovery response wait timer"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800467 goto err_timer;
468 }
469#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700470 }
471
472
473 cfgValue = SYS_MS_TO_TICKS(LIM_HASH_MISS_TIMER_MS);
474
475 if (tx_timer_create(
476 &pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer,
477 "Disassoc throttle TIMEOUT",
478 limSendDisassocFrameThresholdHandler,
479 SIR_LIM_HASH_MISS_THRES_TIMEOUT,
480 cfgValue,
481 cfgValue,
482 TX_AUTO_ACTIVATE) != TX_SUCCESS)
483 {
484 /// Could not start Send Disassociate Frame Threshold timer.
485 // Log error
486 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700487 FL("create Disassociate throttle timer failed"));
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700488 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700489 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700490 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700491 FL("Created Disassociate throttle timer "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700492
493 /**
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
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700647#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700648 cfgValue = 5000;
649 cfgValue = SYS_MS_TO_TICKS(cfgValue);
650
651 if (tx_timer_create(&pMac->lim.limTimers.gLimCcxTsmTimer,
652 "CCX TSM Stats TIMEOUT",
653 limTimerHandler, SIR_LIM_CCX_TSM_TIMEOUT,
654 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 }
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700662#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_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);
666 if (tx_timer_create(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
667 "FT PREAUTH RSP TIMEOUT",
668 limTimerHandler, SIR_LIM_REMAIN_CHN_TIMEOUT,
669 cfgValue, 0,
670 TX_NO_ACTIVATE) != TX_SUCCESS)
671 {
672 // Could not create Join failure timer.
673 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700674 limLog(pMac, LOGP, FL("could not create Join failure timer"));
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700675 goto err_timer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700676 }
677
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800678
679 cfgValue = 1000;
680 cfgValue = SYS_MS_TO_TICKS(cfgValue);
681 if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
682 "DISASSOC ACK TIMEOUT",
683 limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
684 cfgValue, 0,
685 TX_NO_ACTIVATE) != TX_SUCCESS)
686 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700687 limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800688 goto err_timer;
689 }
690
691 cfgValue = 1000;
692 cfgValue = SYS_MS_TO_TICKS(cfgValue);
693 if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
694 "DISASSOC ACK TIMEOUT",
Viral Modid86bde22012-12-10 13:09:21 -0800695 limTimerHandler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800696 cfgValue, 0,
697 TX_NO_ACTIVATE) != TX_SUCCESS)
698 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700699 limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer"));
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800700 goto err_timer;
701 }
Viral Modid86bde22012-12-10 13:09:21 -0800702
Viral Modid86bde22012-12-10 13:09:21 -0800703 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)
704 cfgValue = SYS_MS_TO_TICKS(cfgValue);
705 if (tx_timer_create(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
706 "Single Shot NOA Insert timeout",
707 limTimerHandler, SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT,
708 cfgValue, 0,
709 TX_NO_ACTIVATE) != TX_SUCCESS)
710 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700711 limLog(pMac, LOGP, FL("could not create Single Shot NOA Insert Timeout timer"));
Viral Modid86bde22012-12-10 13:09:21 -0800712 goto err_timer;
713 }
Viral Modid86bde22012-12-10 13:09:21 -0800714
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530715 cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
716 cfgValue = SYS_MS_TO_TICKS(cfgValue);
717 if (tx_timer_create(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
718 "ACTIVE TO PASSIVE CHANNEL", limTimerHandler,
719 SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,
720 TX_NO_ACTIVATE) != TX_SUCCESS)
721 {
722 limLog(pMac, LOGW,FL("could not create timer for passive channel to active channel"));
723 goto err_timer;
724 }
725
726
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700727 return TX_SUCCESS;
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700728
729 err_timer:
Viral Modid86bde22012-12-10 13:09:21 -0800730 tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800731 tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer);
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800732 tx_timer_delete(&pMac->lim.limTimers.gLimRemainOnChannelTimer);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700733#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700734 tx_timer_delete(&pMac->lim.limTimers.gLimCcxTsmTimer);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700735#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700736 tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer);
737 tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
738 while(((tANI_S32)--i) >= 0)
739 {
740 tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]);
741 }
742 tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer);
743 tx_timer_delete(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer);
744 tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
745 tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer);
746 tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer);
747 tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer);
748 tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
749 tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
750 tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
Jeff Johnson62c27982013-02-27 17:53:55 -0800751 tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800752 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700753 tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
754 tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
755 tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer);
756 tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer);
757 tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer);
758 tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer);
Venkata Prathyusha Kuntupalli7a87ff02013-01-29 10:45:54 -0800759 tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer);
Gopichand Nakkalad492d202013-05-10 02:50:47 +0530760 tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700761
762 if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable)
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800763 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530764 vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800765 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
766 }
Madan Mohan Koyyalamudi694f8d72012-10-11 16:32:55 -0700767
768 return TX_TIMER_ERROR;
769
Jeff Johnson295189b2012-06-20 16:38:30 -0700770} /****** end limCreateTimers() ******/
771
772
773
774/**
775 * limTimerHandler()
776 *
777 *FUNCTION:
778 * This function is called upon
779 * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning
780 * 2. JOIN_FAILURE timer expiration while joining a BSS
781 * 3. AUTH_FAILURE timer expiration while authenticating with a peer
782 * 4. Heartbeat timer expiration on STA
783 * 5. Background scan timer expiration on STA
784 * 6. AID release, Pre-auth cleanup and Link monitoring timer
785 * expiration on AP
786 *
787 *LOGIC:
788 *
789 *ASSUMPTIONS:
790 * NA
791 *
792 *NOTE:
793 * NA
794 *
795 * @param param - Message corresponding to the timer that expired
796 *
797 * @return None
798 */
799
800void
801limTimerHandler(void *pMacGlobal, tANI_U32 param)
802{
803 tANI_U32 statusCode;
804 tSirMsgQ msg;
805 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
806
807 // Prepare and post message to LIM Message Queue
808
809 msg.type = (tANI_U16) param;
810 msg.bodyptr = NULL;
811 msg.bodyval = 0;
812
813 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
814 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700815 FL("posting message %X to LIM failed, reason=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700816 msg.type, statusCode);
817} /****** end limTimerHandler() ******/
818
819
820/**
821 * limAddtsResponseTimerHandler()
822 *
823 *FUNCTION:
824 * This function is called upon Addts response timer expiration on sta
825 *
826 *LOGIC:
827 * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ
828 * when this function is executed.
829 *
830 *ASSUMPTIONS:
831 * NA
832 *
833 *NOTE:
834 * NA
835 *
836 * @param param - pointer to pre-auth node
837 *
838 * @return None
839 */
840
841void
842limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
843{
844 tSirMsgQ msg;
845 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
846
847 // Prepare and post message to LIM Message Queue
848
849 msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT;
850 msg.bodyval = param;
851 msg.bodyptr = NULL;
852
853 limPostMsgApi(pMac, &msg);
854} /****** end limAuthResponseTimerHandler() ******/
855
856
857/**
858 * limAuthResponseTimerHandler()
859 *
860 *FUNCTION:
861 * This function is called upon Auth response timer expiration on AP
862 *
863 *LOGIC:
864 * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ
865 * when this function is executed.
866 *
867 *ASSUMPTIONS:
868 * NA
869 *
870 *NOTE:
871 * NA
872 *
873 * @param param - pointer to pre-auth node
874 *
875 * @return None
876 */
877
878void
879limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param)
880{
881 tSirMsgQ msg;
882 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
883
884 // Prepare and post message to LIM Message Queue
885
886 msg.type = SIR_LIM_AUTH_RSP_TIMEOUT;
887 msg.bodyptr = NULL;
888 msg.bodyval = (tANI_U32)param;
889
890 limPostMsgApi(pMac, &msg);
891} /****** end limAuthResponseTimerHandler() ******/
892
893
894
895/**
896 * limAssocFailureTimerHandler()
897 *
898 *FUNCTION:
899 * This function is called upon Re/Assoc failure timer expiration
900 * on STA
901 *
902 *LOGIC:
903 * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ
904 * when this function is executed.
905 *
906 *ASSUMPTIONS:
907 * NA
908 *
909 *NOTE:
910 * NA
911 *
912 * @param param - Indicates whether this is assoc or reassoc
913 * failure timeout
914 * @return None
915 */
916
917void
918limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param)
919{
920 tSirMsgQ msg;
921 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
922
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700923#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
924 if((LIM_REASSOC == param) &&
Kanchanapally, Vidyullathab6da2a62014-02-06 12:28:52 +0530925 (NULL != pMac->lim.pSessionEntry) &&
926 (pMac->lim.pSessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700927 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700928 limLog(pMac, LOGE, FL("Reassoc timeout happened"));
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700929 if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT)
930 {
931 limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry);
932 pMac->lim.reAssocRetryAttempt++;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700933 limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times"), pMac->lim.reAssocRetryAttempt);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700934 return;
935 }
936 else
937 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700938 limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached"), LIM_MAX_REASSOC_RETRY_LIMIT);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700939 if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
940 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530941 vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq);
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700942 pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL;
943 }
944 }
945 }
946#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700947 // Prepare and post message to LIM Message Queue
948
949 msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT;
950 msg.bodyval = (tANI_U32)param;
951 msg.bodyptr = NULL;
952
953 limPostMsgApi(pMac, &msg);
954} /****** end limAssocFailureTimerHandler() ******/
955
956
957/**
958 * limUpdateOlbcCacheTimerHandler()
959 *
960 *FUNCTION:
961 * This function is called upon update olbc cache timer expiration
962 * on STA
963 *
964 *LOGIC:
965 * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ
966 * when this function is executed.
967 *
968 *ASSUMPTIONS:
969 * NA
970 *
971 *NOTE:
972 * NA
973 *
974 * @param
975 *
976 * @return None
977 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700978void
979limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param)
980{
981 tSirMsgQ msg;
982 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
983
984 // Prepare and post message to LIM Message Queue
985
986 msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT;
987 msg.bodyval = 0;
988 msg.bodyptr = NULL;
989
990 limPostMsgApi(pMac, &msg);
991} /****** end limUpdateOlbcCacheTimerHandler() ******/
Jeff Johnson295189b2012-06-20 16:38:30 -0700992
993/**
994 * limDeactivateAndChangeTimer()
995 *
996 *FUNCTION:
997 * This function is called to deactivate and change a timer
998 * for future re-activation
999 *
1000 *LOGIC:
1001 *
1002 *ASSUMPTIONS:
1003 * NA
1004 *
1005 *NOTE:
1006 * NA
1007 *
1008 * @param pMac - Pointer to Global MAC structure
1009 * @param timerId - enum of timer to be deactivated and changed
1010 * This enum is defined in limUtils.h file
1011 *
1012 * @return None
1013 */
1014
1015void
1016limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId)
1017{
1018 tANI_U32 val=0, val1=0;
1019
Jeff Johnsone7245742012-09-05 17:12:55 -07001020 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07001021
1022 switch (timerId)
1023 {
1024 case eLIM_ADDTS_RSP_TIMER:
1025 pMac->lim.gLimAddtsRspTimerCount++;
1026 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS)
1027 {
1028 // Could not deactivate AddtsRsp Timer
1029 // Log error
1030 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001031 FL("Unable to deactivate AddtsRsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001032 }
1033 break;
1034
1035 case eLIM_MIN_CHANNEL_TIMER:
1036 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer)
1037 != TX_SUCCESS)
1038 {
1039 // Could not deactivate min channel timer.
1040 // Log error
1041 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001042 FL("Unable to deactivate min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001043 }
1044
Jeff Johnsone7245742012-09-05 17:12:55 -07001045#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001046 // If a background was triggered via Quiet BSS,
1047 // then we need to adjust the MIN and MAX channel
1048 // timer's accordingly to the Quiet duration that
1049 // was specified
1050 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1051 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1052 {
1053 // gLimQuietDuration is already cached in units of
1054 // system ticks. No conversion is reqd...
1055 val = pMac->lim.gLimSpecMgmt.quietDuration;
1056 }
1057 else
1058 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001059#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001060 if(pMac->lim.gpLimMlmScanReq)
1061 {
1062 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001063 if (pMac->btc.btcScanCompromise)
1064 {
1065 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1066 {
1067 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc);
1068 limLog(pMac, LOG1, FL("Using BTC Min Active Scan time"));
1069 }
1070 else
1071 {
1072 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1073 }
1074 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001075 }
1076 else
1077 {
1078 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1079 //No need to change min timer. This is not a scan
1080 break;
1081 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001082#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001083 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001084#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001085
1086 if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer,
1087 val, 0) != TX_SUCCESS)
1088 {
1089 // Could not change min channel timer.
1090 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001091 limLog(pMac, LOGP, FL("Unable to change min channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001092 }
1093
1094 break;
1095
1096 case eLIM_PERIODIC_PROBE_REQ_TIMER:
1097 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer)
1098 != TX_SUCCESS)
1099 {
1100 // Could not deactivate min channel timer.
1101 // Log error
1102 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001103 FL("Unable to deactivate periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001104 }
1105
1106 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001107 if (pMac->btc.btcScanCompromise)
1108 {
1109 if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)
1110 {
1111 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2;
1112 }
1113 else
1114 {
1115 limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set"));
1116 }
1117 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001118 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
1119 val, 0) != TX_SUCCESS)
1120 {
1121 // Could not change min channel timer.
1122 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001123 limLog(pMac, LOGP, FL("Unable to change periodic timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001124 }
1125
1126 break;
1127
1128 case eLIM_MAX_CHANNEL_TIMER:
1129 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer)
1130 != TX_SUCCESS)
1131 {
1132 // Could not deactivate max channel timer.
1133 // Log error
1134 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001135 FL("Unable to deactivate max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001136 }
1137
Jeff Johnson295189b2012-06-20 16:38:30 -07001138 // If a background was triggered via Quiet BSS,
1139 // then we need to adjust the MIN and MAX channel
1140 // timer's accordingly to the Quiet duration that
1141 // was specified
1142 if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE)
1143 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001144#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001145
1146 if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState &&
1147 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss )
1148 {
1149 // gLimQuietDuration is already cached in units of
1150 // system ticks. No conversion is reqd...
1151 val = pMac->lim.gLimSpecMgmt.quietDuration;
1152 }
1153 else
1154 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001155#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001156 if(pMac->lim.gpLimMlmScanReq)
1157 {
1158 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001159 if (pMac->btc.btcScanCompromise)
1160 {
1161 if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc)
1162 {
1163 val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc);
1164 limLog(pMac, LOG1, FL("Using BTC Max Active Scan time"));
1165 }
1166 else
1167 {
1168 limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set"));
1169 }
1170 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001171 }
1172 else
1173 {
1174 limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL "));
1175 //No need to change max timer. This is not a scan
1176 break;
1177 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001178#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001179 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001180#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001181 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001182
1183 if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
1184 val, 0) != TX_SUCCESS)
1185 {
1186 // Could not change max channel timer.
1187 // Log error
1188 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001189 FL("Unable to change max channel timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001190 }
1191
1192 break;
1193
1194 case eLIM_JOIN_FAIL_TIMER:
1195 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer)
1196 != TX_SUCCESS)
1197 {
1198 /**
1199 * Could not deactivate Join Failure
1200 * timer. Log error.
1201 */
1202 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001203 FL("Unable to deactivate Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001204 }
1205
1206 if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
1207 &val) != eSIR_SUCCESS)
1208 {
1209 /**
1210 * Could not get JoinFailureTimeout value
1211 * from CFG. Log error.
1212 */
1213 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001214 FL("could not retrieve JoinFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001215 }
1216 val = SYS_MS_TO_TICKS(val);
1217
1218 if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
1219 val, 0) != TX_SUCCESS)
1220 {
1221 /**
1222 * Could not change Join Failure
1223 * timer. Log error.
1224 */
1225 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001226 FL("Unable to change Join Failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001227 }
1228
1229 break;
1230
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001231 case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER:
1232 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer)
1233 != TX_SUCCESS)
1234 {
1235 // Could not deactivate periodic join req Times.
1236 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001237 FL("Unable to deactivate periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001238 }
1239
1240 val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
1241 if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
1242 val, 0) != TX_SUCCESS)
1243 {
1244 // Could not change periodic join req times.
1245 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001246 limLog(pMac, LOGP, FL("Unable to change periodic join request timer"));
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001247 }
Jeff Johnson62c27982013-02-27 17:53:55 -08001248
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001249 break;
1250
Jeff Johnson295189b2012-06-20 16:38:30 -07001251 case eLIM_AUTH_FAIL_TIMER:
1252 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer)
1253 != TX_SUCCESS)
1254 {
1255 // Could not deactivate Auth failure timer.
1256 // Log error
1257 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001258 FL("Unable to deactivate auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001259 }
1260
1261 // Change timer to reactivate it in future
1262 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
1263 &val) != eSIR_SUCCESS)
1264 {
1265 /**
1266 * Could not get AuthFailureTimeout value
1267 * from CFG. Log error.
1268 */
1269 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001270 FL("could not retrieve AuthFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001271 }
1272 val = SYS_MS_TO_TICKS(val);
1273
1274 if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer,
1275 val, 0) != TX_SUCCESS)
1276 {
1277 // Could not change Authentication failure timer.
1278 // Log error
1279 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001280 FL("unable to change Auth failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001281 }
1282
1283 break;
1284
1285 case eLIM_ASSOC_FAIL_TIMER:
1286 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) !=
1287 TX_SUCCESS)
1288 {
1289 // Could not deactivate Association failure timer.
1290 // Log error
1291 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001292 FL("unable to deactivate Association failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001293 }
1294
1295 // Change timer to reactivate it in future
1296 if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
1297 &val) != eSIR_SUCCESS)
1298 {
1299 /**
1300 * Could not get AssocFailureTimeout value
1301 * from CFG. Log error.
1302 */
1303 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001304 FL("could not retrieve AssocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001305 }
1306 val = SYS_MS_TO_TICKS(val);
1307
1308 if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer,
1309 val, 0) != TX_SUCCESS)
1310 {
1311 // Could not change Association failure timer.
1312 // Log error
1313 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001314 FL("unable to change Assoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001315 }
1316
1317 break;
1318
1319 case eLIM_REASSOC_FAIL_TIMER:
1320 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) !=
1321 TX_SUCCESS)
1322 {
1323 // Could not deactivate Reassociation failure timer.
1324 // Log error
1325 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001326 FL("unable to deactivate Reassoc failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001327 }
1328
1329 // Change timer to reactivate it in future
1330 if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
1331 &val) != eSIR_SUCCESS)
1332 {
1333 /**
1334 * Could not get ReassocFailureTimeout value
1335 * from CFG. Log error.
1336 */
1337 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001338 FL("could not retrieve ReassocFailureTimeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001339 }
1340 val = SYS_MS_TO_TICKS(val);
1341
1342 if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer,
1343 val, 0) != TX_SUCCESS)
1344 {
1345 // Could not change Reassociation failure timer.
1346 // Log error
1347 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001348 FL("unable to change Reassociation failure timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001349 }
1350
1351 break;
1352
1353 case eLIM_HEART_BEAT_TIMER:
1354 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) !=
1355 TX_SUCCESS)
1356 {
1357 // Could not deactivate Heartbeat timer.
1358 // Log error
1359 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001360 FL("unable to deactivate Heartbeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001361 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001362 else
1363 {
1364 limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring"));
1365 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001366
1367 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL,
1368 &val) != eSIR_SUCCESS)
1369 {
1370 /**
1371 * Could not get BEACON_INTERVAL value
1372 * from CFG. Log error.
1373 */
1374 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001375 FL("could not retrieve BEACON_INTERVAL value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 }
1377
1378 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
1379 eSIR_SUCCESS)
1380 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001381 FL("could not retrieve heartbeat failure value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001382
1383 // Change timer to reactivate it in future
1384 val = SYS_MS_TO_TICKS(val * val1);
1385
1386 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer,
1387 val, 0) != TX_SUCCESS)
1388 {
1389 // Could not change HeartBeat timer.
1390 // Log error
1391 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001392 FL("unable to change HeartBeat timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001393 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001394 else
1395 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001396 limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001397 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001398 break;
1399
1400 case eLIM_PROBE_AFTER_HB_TIMER:
1401 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) !=
1402 TX_SUCCESS)
1403 {
1404 // Could not deactivate Heartbeat timer.
1405 // Log error
1406 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001407 FL("unable to deactivate probeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001408 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001409 else
1410 {
Kaushik, Sushant8489f472014-01-27 11:41:22 +05301411 limLog(pMac, LOG1, FL("Deactivated probe after hb timer"));
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001412 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001413
1414 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT,
1415 &val) != eSIR_SUCCESS)
1416 {
1417 /**
1418 * Could not get PROBE_AFTER_HB_FAILURE
1419 * value from CFG. Log error.
1420 */
1421 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001422 FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001423 }
1424
1425 // Change timer to reactivate it in future
1426 val = SYS_MS_TO_TICKS(val);
1427
1428 if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
1429 val, 0) != TX_SUCCESS)
1430 {
1431 // Could not change HeartBeat timer.
1432 // Log error
1433 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001434 FL("unable to change ProbeAfterHBTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001435 }
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001436 else
1437 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001438 limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val);
Srinivas Girigowda3789b742013-04-08 16:14:44 -07001439 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001440
1441 break;
1442
1443 case eLIM_KEEPALIVE_TIMER:
1444 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer)
1445 != TX_SUCCESS)
1446 {
1447 // Could not deactivate Keepalive timer.
1448 // Log error
1449 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001450 FL("unable to deactivate KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001451 }
1452
1453 // Change timer to reactivate it in future
1454
1455 if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT,
1456 &val) != eSIR_SUCCESS)
1457 {
1458 /**
1459 * Could not get keepalive timeout value
1460 * from CFG. Log error.
1461 */
1462 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001463 FL("could not retrieve keepalive timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001464 }
1465 if (val == 0)
1466 {
1467 val = 3000;
1468 pMac->sch.keepAlive = 0;
1469 } else
1470 pMac->sch.keepAlive = 1;
1471
1472
1473
1474 val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1);
1475
1476 if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer,
1477 val, val) != TX_SUCCESS)
1478 {
1479 // Could not change KeepaliveTimer timer.
1480 // Log error
1481 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001482 FL("unable to change KeepaliveTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001483 }
1484
1485 break;
1486
Jeff Johnson295189b2012-06-20 16:38:30 -07001487 case eLIM_BACKGROUND_SCAN_TIMER:
1488 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
1489 != TX_SUCCESS)
1490 {
1491 // Could not deactivate BackgroundScanTimer timer.
1492 // Log error
1493 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001494 FL("unable to deactivate BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001495 }
1496
1497 // Change timer to reactivate it in future
1498 if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
1499 &val) != eSIR_SUCCESS)
1500 {
1501 /**
1502 * Could not get Background scan period value
1503 * from CFG. Log error.
1504 */
1505 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001506 FL("could not retrieve Background scan period value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001507 }
1508 if (val == 0)
1509 {
1510 val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS;
1511 pMac->lim.gLimBackgroundScanDisable = true;
1512 }
1513 else
1514 pMac->lim.gLimBackgroundScanDisable = false;
1515
1516 val = SYS_MS_TO_TICKS(val);
1517
1518 if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer,
1519 val, val) != TX_SUCCESS)
1520 {
1521 // Could not change BackgroundScanTimer timer.
1522 // Log error
1523 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001524 FL("unable to change BackgroundScanTimer timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001525 }
1526
1527 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001528
Jeff Johnsone7245742012-09-05 17:12:55 -07001529#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001530 case eLIM_CHANNEL_SWITCH_TIMER:
1531 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
1532 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001533 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001534 return;
1535 }
1536
1537 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
1538 pMac->lim.gLimChannelSwitch.switchTimeoutValue,
1539 0) != TX_SUCCESS)
1540 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001541 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001542 return;
1543 }
1544 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001545#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001546
1547 case eLIM_LEARN_DURATION_TIMER:
Jeff Johnson295189b2012-06-20 16:38:30 -07001548 break;
1549
Jeff Johnsone7245742012-09-05 17:12:55 -07001550#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001551 case eLIM_QUIET_BSS_TIMER:
1552 if (TX_SUCCESS !=
1553 tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer))
1554 {
1555 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001556 FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001557 }
1558
1559 // gLimQuietDuration appears to be in units of ticks
1560 // Use it as is
1561 if (TX_SUCCESS !=
1562 tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer,
1563 pMac->lim.gLimSpecMgmt.quietDuration,
1564 0))
1565 {
1566 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001567 FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001568 }
1569 break;
1570
1571 case eLIM_QUIET_TIMER:
1572 if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer))
1573 {
1574 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001575 FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001576 }
1577
1578 // Set the NEW timeout value, in ticks
1579 if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer,
1580 SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0))
1581 {
1582 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001583 FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001584 }
1585 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001586#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001587
Jeff Johnson295189b2012-06-20 16:38:30 -07001588#if 0
1589 case eLIM_WPS_OVERLAP_TIMER:
1590 {
1591 // Restart Learn Interval timer
1592
1593 tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS);
1594
1595 if (tx_timer_deactivate(
1596 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS)
1597 {
1598 // Could not deactivate Learn Interval timer.
1599 // Log error
1600 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001601 FL("Unable to deactivate WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001602 }
1603
1604 if (tx_timer_change(
1605 &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer,
1606 WPSOverlapTimer, 0) != TX_SUCCESS)
1607 {
1608 // Could not change Learn Interval timer.
1609 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001610 limLog(pMac, LOGP, FL("Unable to change WPS overlap timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001611
1612 return;
1613 }
1614
1615 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001616 FL("Setting WPS overlap TIMER to %d ticks"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001617 WPSOverlapTimer);
1618 }
1619 break;
1620#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001621
1622#ifdef WLAN_FEATURE_VOWIFI_11R
1623 case eLIM_FT_PREAUTH_RSP_TIMER:
1624 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS)
1625 {
1626 /**
1627 ** Could not deactivate Join Failure
1628 ** timer. Log error.
1629 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001630 limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001631 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001632 }
1633 val = 1000;
1634 val = SYS_MS_TO_TICKS(val);
1635 if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
1636 val, 0) != TX_SUCCESS)
1637 {
1638 /**
1639 * Could not change Join Failure
1640 * timer. Log error.
1641 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001642 limLog(pMac, LOGP, FL("Unable to change Join Failure timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001643 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001644 }
1645 break;
1646#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001647#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001648 case eLIM_TSM_TIMER:
1649 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer)
1650 != TX_SUCCESS)
1651 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001652 limLog(pMac, LOGE, FL("Unable to deactivate TSM timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001653 }
1654 break;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001655#endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001656 case eLIM_REMAIN_CHN_TIMER:
1657 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS)
1658 {
1659 /**
1660 ** Could not deactivate Join Failure
1661 ** timer. Log error.
1662 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001663 limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001664 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001665 }
1666 val = 1000;
1667 val = SYS_MS_TO_TICKS(val);
1668 if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
1669 val, 0) != TX_SUCCESS)
1670 {
1671 /**
1672 * Could not change Join Failure
1673 * timer. Log error.
1674 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001675 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001676 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001677 }
1678 break;
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301679
1680 case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1681 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS)
1682 {
1683 /**
1684 ** Could not deactivate Active to passive channel timer.
1685 ** Log error.
1686 **/
1687 limLog(pMac, LOGP, FL("Unable to Deactivate "
1688 "Active to passive channel timer"));
1689 return;
1690 }
1691 val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
1692 val = SYS_MS_TO_TICKS(val);
1693 if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
1694 val, 0) != TX_SUCCESS)
1695 {
1696 /**
1697 * Could not change timer to check scan type for passive channel.
1698 * timer. Log error.
1699 */
1700 limLog(pMac, LOGP, FL("Unable to change timer"));
1701 return;
1702 }
1703 break;
1704
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001705 case eLIM_DISASSOC_ACK_TIMER:
1706 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS)
1707 {
1708 /**
1709 ** Could not deactivate Join Failure
1710 ** timer. Log error.
1711 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001712 limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001713 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001714 }
1715 val = 1000;
1716 val = SYS_MS_TO_TICKS(val);
1717 if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer,
1718 val, 0) != TX_SUCCESS)
1719 {
1720 /**
1721 * Could not change Join Failure
1722 * timer. Log error.
1723 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001724 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001725 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001726 }
1727 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001728
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001729 case eLIM_DEAUTH_ACK_TIMER:
1730 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS)
1731 {
1732 /**
1733 ** Could not deactivate Join Failure
1734 ** timer. Log error.
1735 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001736 limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001737 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001738 }
1739 val = 1000;
1740 val = SYS_MS_TO_TICKS(val);
1741 if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer,
1742 val, 0) != TX_SUCCESS)
1743 {
1744 /**
1745 * Could not change Join Failure
1746 * timer. Log error.
1747 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001748 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001749 return;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001750 }
1751 break;
Viral Modid86bde22012-12-10 13:09:21 -08001752
Viral Modid86bde22012-12-10 13:09:21 -08001753 case eLIM_INSERT_SINGLESHOT_NOA_TIMER:
1754 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS)
1755 {
1756 /**
1757 ** Could not deactivate SingleShot NOA Insert
1758 ** timer. Log error.
1759 **/
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001760 limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001761 return;
1762 }
1763 val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
1764 val = SYS_MS_TO_TICKS(val);
1765 if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
1766 val, 0) != TX_SUCCESS)
1767 {
1768 /**
1769 * Could not change Single Shot NOA Insert
1770 * timer. Log error.
1771 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001772 limLog(pMac, LOGP, FL("Unable to change timer"));
Viral Modid86bde22012-12-10 13:09:21 -08001773 return;
1774 }
1775 break;
Jeff Johnson62c27982013-02-27 17:53:55 -08001776
Jeff Johnson295189b2012-06-20 16:38:30 -07001777 default:
1778 // Invalid timerId. Log error
1779 break;
1780 }
1781} /****** end limDeactivateAndChangeTimer() ******/
1782
1783
1784
1785/**---------------------------------------------------------------
1786\fn limHeartBeatDeactivateAndChangeTimer
1787\brief This function deactivates and changes the heart beat
1788\ timer, eLIM_HEART_BEAT_TIMER.
1789\
1790\param pMac
1791\param psessionEntry
1792\return None
1793------------------------------------------------------------------*/
1794void
1795limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1796{
Ravi Joshid0699502013-07-08 15:48:47 -07001797 tANI_U32 val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001798
Ravi Joshid0699502013-07-08 15:48:47 -07001799 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Yathish9f22e662012-12-10 14:21:35 -08001800#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
Ravi Joshid0699502013-07-08 15:48:47 -07001801 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1802 return;
Yathish9f22e662012-12-10 14:21:35 -08001803#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001804
Ravi Joshid0699502013-07-08 15:48:47 -07001805 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS)
1806 limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001807
Ravi Joshid0699502013-07-08 15:48:47 -07001808 /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps
1809 changing. to avoid this problem, HeartBeat interval is made constant, by
1810 fixing beacon interval to 100ms immaterial of the beacon interval of the session */
Jeff Johnson295189b2012-06-20 16:38:30 -07001811
Ravi Joshid0699502013-07-08 15:48:47 -07001812 //val = psessionEntry->beaconParams.beaconInterval;
1813 val = LIM_HB_TIMER_BEACON_INTERVAL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001814
Ravi Joshid0699502013-07-08 15:48:47 -07001815 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS)
1816 limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001817
Ravi Joshid0699502013-07-08 15:48:47 -07001818 PELOGW(limLog(pMac,LOGW,
1819 FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "),
1820 val1, psessionEntry->beaconParams.beaconInterval,
1821 psessionEntry->peSessionId);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001822
Ravi Joshid0699502013-07-08 15:48:47 -07001823 /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not
1824 * enough to judge the peer device inactivity when 32 peers are connected.
1825 * Hence increasing the HB timer timeout to
1826 * HBtimeout = (TBTT * num_beacons * num_peers)
1827 */
1828 if (eSIR_IBSS_MODE == psessionEntry->bssType &&
1829 pMac->lim.gLimNumIbssPeers > 0)
1830 {
Ravi Joshi92a4e142013-06-27 17:00:42 -07001831 val1 = val1 * pMac->lim.gLimNumIbssPeers;
Ravi Joshid0699502013-07-08 15:48:47 -07001832 }
Ravi Joshi92a4e142013-06-27 17:00:42 -07001833
Ravi Joshid0699502013-07-08 15:48:47 -07001834 // Change timer to reactivate it in future
1835 val = SYS_MS_TO_TICKS(val * val1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001836
Ravi Joshid0699502013-07-08 15:48:47 -07001837 if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS)
1838 limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001839
1840} /****** end limHeartBeatDeactivateAndChangeTimer() ******/
1841
1842
1843/**---------------------------------------------------------------
1844\fn limReactivateHeartBeatTimer
1845\brief This function s called to deactivate, change and
1846\ activate a timer.
1847\
1848\param pMac - Pointer to Global MAC structure
1849\param psessionEntry
1850\return None
1851------------------------------------------------------------------*/
1852void
1853limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
1854{
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001855 PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001856
Yathish9f22e662012-12-10 14:21:35 -08001857#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1858 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001859 {
1860 limLog(pMac, LOGW, FL("Active offload feature is enabled, FW takes care of HB monitoring"));
Yathish9f22e662012-12-10 14:21:35 -08001861 return;
Srinivas Girigowda35f6a712013-04-04 16:48:34 -07001862 }
Yathish9f22e662012-12-10 14:21:35 -08001863#endif
1864
Jeff Johnson295189b2012-06-20 16:38:30 -07001865 limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07001866 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001867
1868 //only start the hearbeat-timer if the timeout value is non-zero
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001869 if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0)
1870 {
1871 /*
1872 * There is increasing need to limit the apps wakeup due to WLAN
1873 * activity. During HB monitoring, the beacons from peer are sent to
1874 * the host causing the host to wakeup. Hence, offloading the HB
1875 * monitoring to LMAC
1876 */
1877 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1878 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1879 {
1880 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1881 {
1882 limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer"));
1883 }
1884 else
1885 {
1886 limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring"));
1887 }
1888 }
1889 else
1890 {
1891 if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS)
1892 {
1893 limLog(pMac, LOGP,FL("could not activate Heartbeat timer"));
1894 }
1895 else
1896 {
1897 limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring"));
1898 }
1899 }
1900 limResetHBPktCount(psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001901 }
1902
1903} /****** end limReactivateHeartBeatTimer() ******/
1904
Jeff Johnson295189b2012-06-20 16:38:30 -07001905
1906/**
1907 * limActivateHearBeatTimer()
1908 *
1909 *
1910 * @brief: This function is called to activate heartbeat timer
1911 *
1912 *LOGIC:
1913 *
1914 *ASSUMPTIONS:
1915 * NA
1916 *
1917 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1918 *
1919 * @param pMac - Pointer to Global MAC structure
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001920 * @param psessionEntry - Session Entry
Jeff Johnson295189b2012-06-20 16:38:30 -07001921 *
1922 * @return TX_SUCCESS - timer is activated
1923 * errors - fail to start the timer
1924 */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001925v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001926{
1927 v_UINT_t status = TX_TIMER_ERROR;
1928
Yathish9f22e662012-12-10 14:21:35 -08001929#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1930 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Ravi Joshif7fe8d32013-09-21 17:02:11 -07001931 return (TX_SUCCESS);
Yathish9f22e662012-12-10 14:21:35 -08001932#endif
1933
Jeff Johnson295189b2012-06-20 16:38:30 -07001934 if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature)
1935 {
1936 //consider 0 interval a ok case
1937 if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs )
1938 {
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001939 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE &&
1940 IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE)
1941 {
1942 /* HB offload in IBSS mode */
1943 status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1944 if (TX_SUCCESS != status)
1945 {
1946 PELOGE(limLog(pMac, LOGE,
1947 FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"),
1948 status);)
1949 }
1950 else
1951 {
1952 PELOGE(limLog(pMac, LOGE,
1953 FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"),
1954 __func__);)
1955 }
1956
1957 }
1958 else
1959 {
1960 status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer);
1961 if ( TX_SUCCESS != status )
1962 {
1963 PELOGE(limLog(pMac, LOGE,
1964 FL("could not activate Heartbeat timer status(%d)"), status);)
1965 }
1966 else
1967 {
1968 PELOGE(limLog(pMac, LOGW,
1969 FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);)
1970 }
1971 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001972 }
1973 else
1974 {
1975 status = TX_SUCCESS;
1976 }
1977 }
1978
1979 return (status);
1980}
1981
1982
1983
1984/**
1985 * limDeactivateAndChangePerStaIdTimer()
1986 *
1987 *
1988 * @brief: This function is called to deactivate and change a per STA timer
1989 * for future re-activation
1990 *
1991 *LOGIC:
1992 *
1993 *ASSUMPTIONS:
1994 * NA
1995 *
1996 * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index.
1997 *
1998 * @param pMac - Pointer to Global MAC structure
1999 * @param timerId - enum of timer to be deactivated and changed
2000 * This enum is defined in limUtils.h file
2001 * @param staId - staId
2002 *
2003 * @return None
2004 */
2005
2006void
2007limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId)
2008{
2009 tANI_U32 val;
Jeff Johnsone7245742012-09-05 17:12:55 -07002010 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId));
Jeff Johnson295189b2012-06-20 16:38:30 -07002011
2012 switch (timerId)
2013 {
2014 case eLIM_CNF_WAIT_TIMER:
2015
2016 if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2017 != TX_SUCCESS)
2018 {
2019 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002020 FL("unable to deactivate CNF wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002021
2022 }
2023
2024 // Change timer to reactivate it in future
2025
2026 if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT,
2027 &val) != eSIR_SUCCESS)
2028 {
2029 /**
2030 * Could not get cnf timeout value
2031 * from CFG. Log error.
2032 */
2033 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002034 FL("could not retrieve cnf timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002035 }
2036 val = SYS_MS_TO_TICKS(val);
2037
2038 if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId],
2039 val, val) != TX_SUCCESS)
2040 {
2041 // Could not change cnf timer.
2042 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002043 limLog(pMac, LOGP, FL("unable to change cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002044 }
2045
2046 break;
2047
2048 case eLIM_AUTH_RSP_TIMER:
2049 {
2050 tLimPreAuthNode *pAuthNode;
2051
2052 pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId);
2053
2054 if (pAuthNode == NULL)
2055 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002056 limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07002057 break;
2058 }
2059
2060 if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS)
2061 {
2062 // Could not deactivate auth response timer.
2063 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002064 limLog(pMac, LOGP, FL("unable to deactivate auth response timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002065 }
2066
2067 // Change timer to reactivate it in future
2068
2069 if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS)
2070 {
2071 /**
2072 * Could not get auth rsp timeout value
2073 * from CFG. Log error.
2074 */
2075 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002076 FL("could not retrieve auth response timeout value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002077 }
2078
2079 val = SYS_MS_TO_TICKS(val);
2080
2081 if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS)
2082 {
2083 // Could not change auth rsp timer.
2084 // Log error
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002085 limLog(pMac, LOGP, FL("unable to change auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002086 }
2087 }
2088 break;
2089
Jeff Johnson295189b2012-06-20 16:38:30 -07002090
2091 default:
2092 // Invalid timerId. Log error
2093 break;
2094
2095 }
2096}
2097
2098
2099/**
2100 * limActivateCnfTimer()
2101 *
2102 *FUNCTION:
2103 * This function is called to activate a per STA timer
2104 *
2105 *LOGIC:
2106 *
2107 *ASSUMPTIONS:
2108 * NA
2109 *
2110 *NOTE:
2111 * NA
2112 *
2113 * @param pMac - Pointer to Global MAC structure
2114 * @param StaId - staId
2115 *
2116 * @return None
2117 */
2118
2119void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry)
2120{
Jeff Johnsone7245742012-09-05 17:12:55 -07002121 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002122 pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId;
2123 if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId])
2124 != TX_SUCCESS)
2125 {
2126 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002127 FL("could not activate cnf wait timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002128 }
2129}
2130
2131/**
2132 * limActivateAuthRspTimer()
2133 *
2134 *FUNCTION:
2135 * This function is called to activate a per STA timer
2136 *
2137 *LOGIC:
2138 *
2139 *ASSUMPTIONS:
2140 * NA
2141 *
2142 *NOTE:
2143 * NA
2144 *
2145 * @param pMac - Pointer to Global MAC structure
2146 * @param id - id
2147 *
2148 * @return None
2149 */
2150
2151void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode)
2152{
Jeff Johnsone7245742012-09-05 17:12:55 -07002153 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07002154 if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS)
2155 {
2156 /// Could not activate auth rsp timer.
2157 // Log error
2158 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002159 FL("could not activate auth rsp timer"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002160 }
2161}
2162
2163
2164/**
2165 * limSendDisassocFrameThresholdHandler()
2166 *
2167 *FUNCTION:
2168 * This function reloads the credit to the send disassociate frame bucket
2169 *
2170 *LOGIC:
2171 *
2172 *ASSUMPTIONS:
2173 *
2174 *NOTE:
2175 * NA
2176 *
2177 * @param
2178 *
2179 * @return None
2180 */
2181
2182void
2183limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param)
2184{
2185 tSirMsgQ msg;
2186 tANI_U32 statusCode;
2187 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2188
2189 msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT;
2190 msg.bodyval = 0;
2191 msg.bodyptr = NULL;
2192
2193 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2194 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002195 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002196
2197}
2198
2199/**
2200 * limAssocCnfWaitTmerHandler()
2201 *
2202 *FUNCTION:
2203 * This function post a message to send a disassociate frame out.
2204 *
2205 *LOGIC:
2206 *
2207 *ASSUMPTIONS:
2208 *
2209 *NOTE:
2210 * NA
2211 *
2212 * @param
2213 *
2214 * @return None
2215 */
2216
2217void
2218limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param)
2219{
2220 tSirMsgQ msg;
2221 tANI_U32 statusCode;
2222 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2223
2224 msg.type = SIR_LIM_CNF_WAIT_TIMEOUT;
2225 msg.bodyval = (tANI_U32)param;
2226 msg.bodyptr = NULL;
2227
2228 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2229 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002230 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002231
2232}
2233
2234/**
2235 * limKeepaliveTmerHandler()
2236 *
2237 *FUNCTION:
2238 * This function post a message to send a NULL data frame.
2239 *
2240 *LOGIC:
2241 *
2242 *ASSUMPTIONS:
2243 *
2244 *NOTE:
2245 * NA
2246 *
2247 * @param
2248 *
2249 * @return None
2250 */
2251
2252void
2253limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param)
2254{
2255 tSirMsgQ msg;
2256 tANI_U32 statusCode;
2257 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2258
2259 msg.type = SIR_LIM_KEEPALIVE_TIMEOUT;
2260 msg.bodyval = (tANI_U32)param;
2261 msg.bodyptr = NULL;
2262
2263 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2264 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002265 FL("posting to LIM failed, reason=%d"), statusCode);
Jeff Johnson295189b2012-06-20 16:38:30 -07002266
2267}
2268
2269void
2270limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param)
2271{
2272 tSirMsgQ msg;
2273 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2274
2275 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002276 FL("ChannelSwitch Timer expired. Posting msg to LIM "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002277
2278 msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT;
2279 msg.bodyval = (tANI_U32)param;
2280 msg.bodyptr = NULL;
2281
2282 limPostMsgApi(pMac, &msg);
2283}
2284
2285void
2286limQuietTimerHandler(void *pMacGlobal, tANI_U32 param)
2287{
2288 tSirMsgQ msg;
2289 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2290
2291 msg.type = SIR_LIM_QUIET_TIMEOUT;
2292 msg.bodyval = (tANI_U32)param;
2293 msg.bodyptr = NULL;
2294
2295 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002296 FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002297 limPostMsgApi(pMac, &msg);
2298}
2299
2300void
2301limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param)
2302{
2303 tSirMsgQ msg;
2304 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2305
2306 msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
2307 msg.bodyval = (tANI_U32)param;
2308 msg.bodyptr = NULL;
2309 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002310 FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002311 limPostMsgApi(pMac, &msg);
2312}
Jeff Johnson295189b2012-06-20 16:38:30 -07002313#if 0
2314void
2315limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param)
2316{
2317 tSirMsgQ msg;
2318 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2319
2320 msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT;
2321 msg.bodyval = (tANI_U32)param;
2322 msg.bodyptr = NULL;
2323 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002324 FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002325 limPostMsgApi(pMac, &msg);
2326}
2327#endif
Yathish9f22e662012-12-10 14:21:35 -08002328
2329#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2330/* ACTIVE_MODE_HB_OFFLOAD */
2331/**
2332 * limMissedBeaconInActiveMode()
2333 *
2334 *FUNCTION:
2335 * This function handle beacon miss indication from FW
2336 * in Active mode.
2337 *
2338 *LOGIC:
2339 *
2340 *ASSUMPTIONS:
2341 * NA
2342 *
2343 *NOTE:
2344 * NA
2345 *
2346 * @param param - Msg Type
2347 *
2348 * @return None
2349 */
2350void
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002351limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry)
Yathish9f22e662012-12-10 14:21:35 -08002352{
2353 tANI_U32 statusCode;
2354 tSirMsgQ msg;
2355 tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal;
2356
2357 // Prepare and post message to LIM Message Queue
2358 if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
Jeff Johnson62c27982013-02-27 17:53:55 -08002359 {
Yathish9f22e662012-12-10 14:21:35 -08002360 msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08002361 msg.bodyptr = psessionEntry;
Yathish9f22e662012-12-10 14:21:35 -08002362 msg.bodyval = 0;
2363 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002364 FL("Heartbeat failure from Riva"));
Yathish9f22e662012-12-10 14:21:35 -08002365 if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS)
2366 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002367 FL("posting message %X to LIM failed, reason=%d"),
Yathish9f22e662012-12-10 14:21:35 -08002368 msg.type, statusCode);
2369 }
2370}
2371#endif