Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 24 | * This file limTimerUtils.cc contains the utility functions |
| 25 | * LIM uses for handling various timers. |
| 26 | * Author: Chandra Modumudi |
| 27 | * Date: 02/13/02 |
| 28 | * History:- |
| 29 | * Date Modified by Modification Information |
| 30 | * -------------------------------------------------------------------- |
| 31 | */ |
| 32 | |
| 33 | #include "limTypes.h" |
| 34 | #include "limUtils.h" |
| 35 | #include "limAssocUtils.h" |
| 36 | #include "limSecurityUtils.h" |
| 37 | #include "pmmApi.h" |
| 38 | |
| 39 | |
| 40 | // default value 5000 ms for background scan period when it is disabled |
| 41 | #define LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS 5000 |
| 42 | // channel Switch Timer in ticks |
| 43 | #define LIM_CHANNEL_SWITCH_TIMER_TICKS 1 |
| 44 | // Lim Quite timer in ticks |
| 45 | #define LIM_QUIET_TIMER_TICKS 100 |
| 46 | // Lim Quite BSS timer inteval in ticks |
| 47 | #define LIM_QUIET_BSS_TIMER_TICK 100 |
| 48 | // Lim KeepAlive timer default (3000)ms |
| 49 | #define LIM_KEEPALIVE_TIMER_MS 3000 |
| 50 | |
| 51 | //default beacon interval value used in HB timer interval calculation |
| 52 | #define LIM_HB_TIMER_BEACON_INTERVAL 100 |
| 53 | /** |
| 54 | * limCreateTimers() |
| 55 | * |
| 56 | *FUNCTION: |
| 57 | * This function is called upon receiving |
| 58 | * 1. SME_START_REQ for STA in ESS role |
| 59 | * 2. SME_START_BSS_REQ for AP role & STA in IBSS role |
| 60 | * |
| 61 | *LOGIC: |
| 62 | * |
| 63 | *ASSUMPTIONS: |
| 64 | * NA |
| 65 | * |
| 66 | *NOTE: |
| 67 | * NA |
| 68 | * |
| 69 | * @param pMac - Pointer to Global MAC structure |
| 70 | * |
| 71 | * @return None |
| 72 | */ |
| 73 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 74 | v_UINT_t |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 75 | limCreateTimers(tpAniSirGlobal pMac) |
| 76 | { |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 77 | tANI_U32 cfgValue, i=0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 78 | |
| 79 | PELOG1(limLog(pMac, LOG1, FL("Creating Timers used by LIM module in Role %d\n"), pMac->lim.gLimSystemRole);) |
| 80 | |
| 81 | if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME, |
| 82 | &cfgValue) != eSIR_SUCCESS) |
| 83 | { |
| 84 | /** |
| 85 | * Could not get MinChannelTimeout value |
| 86 | * from CFG. Log error. |
| 87 | */ |
| 88 | limLog(pMac, LOGP, FL("could not retrieve MinChannelTimeout value\n")); |
| 89 | } |
| 90 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 91 | |
| 92 | // Create MIN/MAX channel timers and activate them later |
| 93 | if (tx_timer_create(&pMac->lim.limTimers.gLimMinChannelTimer, |
| 94 | "MIN CHANNEL TIMEOUT", |
| 95 | limTimerHandler, SIR_LIM_MIN_CHANNEL_TIMEOUT, |
| 96 | cfgValue, 0, |
| 97 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 98 | { |
| 99 | /// Could not start min channel timer. |
| 100 | // Log error |
| 101 | limLog(pMac, LOGP, FL("could not create MIN channel timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 102 | return TX_TIMER_ERROR; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 103 | } |
| 104 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 105 | tx_timer_set_expiry_list( |
| 106 | &pMac->lim.limTimers.gLimMinChannelTimer, LIM_TIMER_EXPIRY_LIST); |
| 107 | #endif |
| 108 | |
| 109 | PELOG2(limLog(pMac, LOG2, FL("Created MinChannelTimer\n"));) |
| 110 | |
| 111 | /* Periodic probe request timer value is half of the Min channel |
| 112 | * timer. Probe request sends periodically till min/max channel |
| 113 | * timer expires |
| 114 | */ |
| 115 | |
| 116 | cfgValue = cfgValue/2 ; |
| 117 | if( cfgValue >= 1) |
| 118 | { |
| 119 | // Create periodic probe request timer and activate them later |
| 120 | if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer, |
| 121 | "Periodic Probe Request Timer", |
| 122 | limTimerHandler, SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT, |
| 123 | cfgValue, 0, |
| 124 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 125 | { |
| 126 | /// Could not start Periodic Probe Req timer. |
| 127 | // Log error |
| 128 | limLog(pMac, LOGP, FL("could not create periodic probe timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 129 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | } |
| 131 | } |
| 132 | |
| 133 | |
| 134 | if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME, |
| 135 | &cfgValue) != eSIR_SUCCESS) |
| 136 | { |
| 137 | /** |
| 138 | * Could not get MAXChannelTimeout value |
| 139 | * from CFG. Log error. |
| 140 | */ |
| 141 | limLog(pMac, LOGP, |
| 142 | FL("could not retrieve MAXChannelTimeout value\n")); |
| 143 | } |
| 144 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 145 | |
| 146 | if (tx_timer_create(&pMac->lim.limTimers.gLimMaxChannelTimer, |
| 147 | "MAX CHANNEL TIMEOUT", |
| 148 | limTimerHandler, SIR_LIM_MAX_CHANNEL_TIMEOUT, |
| 149 | cfgValue, 0, |
| 150 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 151 | { |
| 152 | /// Could not start max channel timer. |
| 153 | // Log error |
| 154 | limLog(pMac, LOGP, FL("could not create MAX channel timer\n")); |
| 155 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 156 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 160 | tx_timer_set_expiry_list( |
| 161 | &pMac->lim.limTimers.gLimMaxChannelTimer, LIM_TIMER_EXPIRY_LIST); |
| 162 | #endif |
| 163 | |
| 164 | PELOG2(limLog(pMac, LOG2, FL("Created MaxChannelTimer\n"));) |
| 165 | |
| 166 | if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE) |
| 167 | { |
| 168 | // Create Channel Switch Timer |
| 169 | if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer, |
| 170 | "CHANNEL SWITCH TIMER", |
| 171 | limChannelSwitchTimerHandler, |
| 172 | 0, // expiration_input |
| 173 | LIM_CHANNEL_SWITCH_TIMER_TICKS, // initial_ticks |
| 174 | 0, // reschedule_ticks |
| 175 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 176 | { |
| 177 | limLog(pMac, LOGP, FL("failed to create Channel Switch timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 178 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | // |
| 182 | // Create Quiet Timer |
| 183 | // This is used on the STA to go and shut-off |
| 184 | // Tx/Rx "after" the specified quiteInterval |
| 185 | // |
| 186 | if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer, |
| 187 | "QUIET TIMER", |
| 188 | limQuietTimerHandler, |
| 189 | SIR_LIM_QUIET_TIMEOUT, // expiration_input |
| 190 | LIM_QUIET_TIMER_TICKS, // initial_ticks |
| 191 | 0, // reschedule_ticks |
| 192 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 193 | { |
| 194 | limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 195 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | // |
| 199 | // Create Quiet BSS Timer |
| 200 | // After the specified quiteInterval, determined by |
| 201 | // gLimQuietTimer, this timer, gLimQuietBssTimer, |
| 202 | // trigger and put the STA to sleep for the specified |
| 203 | // gLimQuietDuration |
| 204 | // |
| 205 | if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer, |
| 206 | "QUIET BSS TIMER", |
| 207 | limQuietBssTimerHandler, |
| 208 | SIR_LIM_QUIET_BSS_TIMEOUT, // expiration_input |
| 209 | LIM_QUIET_BSS_TIMER_TICK, // initial_ticks |
| 210 | 0, // reschedule_ticks |
| 211 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 212 | { |
| 213 | limLog(pMac, LOGP, FL("failed to create Quiet Begin Timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 214 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, |
| 218 | &cfgValue) != eSIR_SUCCESS) |
| 219 | { |
| 220 | /** |
| 221 | * Could not get JoinFailureTimeout value |
| 222 | * from CFG. Log error. |
| 223 | */ |
| 224 | limLog(pMac, LOGP, |
| 225 | FL("could not retrieve JoinFailureTimeout value\n")); |
| 226 | } |
| 227 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 228 | |
| 229 | // Create Join failure timer and activate it later |
| 230 | if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer, |
| 231 | "JOIN FAILURE TIMEOUT", |
| 232 | limTimerHandler, SIR_LIM_JOIN_FAIL_TIMEOUT, |
| 233 | cfgValue, 0, |
| 234 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 235 | { |
| 236 | /// Could not create Join failure timer. |
| 237 | // Log error |
| 238 | limLog(pMac, LOGP, FL("could not create Join failure timer\n")); |
| 239 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 240 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 241 | } |
| 242 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 243 | tx_timer_set_expiry_list(&pMac->lim.limTimers.gLimJoinFailureTimer, |
| 244 | LIM_TIMER_EXPIRY_LIST); |
| 245 | #endif |
| 246 | |
| 247 | if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, |
| 248 | &cfgValue) != eSIR_SUCCESS) |
| 249 | { |
| 250 | /** |
| 251 | * Could not get AssocFailureTimeout value |
| 252 | * from CFG. Log error. |
| 253 | */ |
| 254 | limLog(pMac, LOGP, |
| 255 | FL("could not retrieve AssocFailureTimeout value\n")); |
| 256 | } |
| 257 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 258 | |
| 259 | // Create Association failure timer and activate it later |
| 260 | if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer, |
| 261 | "ASSOC FAILURE TIMEOUT", |
| 262 | limAssocFailureTimerHandler, LIM_ASSOC, |
| 263 | cfgValue, 0, |
| 264 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 265 | { |
| 266 | /// Could not create Assoc failure timer. |
| 267 | // Log error |
| 268 | limLog(pMac, LOGP, |
| 269 | FL("could not create Association failure timer\n")); |
| 270 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 271 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | } |
| 273 | if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, |
| 274 | &cfgValue) != eSIR_SUCCESS) |
| 275 | { |
| 276 | /** |
| 277 | * Could not get ReassocFailureTimeout value |
| 278 | * from CFG. Log error. |
| 279 | */ |
| 280 | limLog(pMac, LOGP, |
| 281 | FL("could not retrieve ReassocFailureTimeout value\n")); |
| 282 | } |
| 283 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 284 | |
| 285 | // Create Association failure timer and activate it later |
| 286 | if (tx_timer_create(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 287 | "REASSOC FAILURE TIMEOUT", |
| 288 | limAssocFailureTimerHandler, LIM_REASSOC, |
| 289 | cfgValue, 0, |
| 290 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 291 | { |
| 292 | /// Could not create Reassoc failure timer. |
| 293 | // Log error |
| 294 | limLog(pMac, LOGP, |
| 295 | FL("could not create Reassociation failure timer\n")); |
| 296 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 297 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &cfgValue) != eSIR_SUCCESS) |
| 301 | limLog(pMac, LOGP, FL("Fail to get WNI_CFG_ADDTS_RSP_TIMEOUT \n")); |
| 302 | |
| 303 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 304 | |
| 305 | // Create Addts response timer and activate it later |
| 306 | if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer, |
| 307 | "ADDTS RSP TIMEOUT", |
| 308 | limAddtsResponseTimerHandler, |
| 309 | SIR_LIM_ADDTS_RSP_TIMEOUT, |
| 310 | cfgValue, 0, |
| 311 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 312 | { |
| 313 | /// Could not create Auth failure timer. |
| 314 | // Log error |
| 315 | limLog(pMac, LOGP, FL("could not create Addts response timer\n")); |
| 316 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 317 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 321 | &cfgValue) != eSIR_SUCCESS) |
| 322 | { |
| 323 | /** |
| 324 | * Could not get AuthFailureTimeout value |
| 325 | * from CFG. Log error. |
| 326 | */ |
| 327 | limLog(pMac, LOGP, |
| 328 | FL("could not retrieve AuthFailureTimeout value\n")); |
| 329 | } |
| 330 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 331 | |
| 332 | // Create Auth failure timer and activate it later |
| 333 | if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer, |
| 334 | "AUTH FAILURE TIMEOUT", |
| 335 | limTimerHandler, |
| 336 | SIR_LIM_AUTH_FAIL_TIMEOUT, |
| 337 | cfgValue, 0, |
| 338 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 339 | { |
| 340 | /// Could not create Auth failure timer. |
| 341 | // Log error |
| 342 | limLog(pMac, LOGP, FL("could not create Auth failure timer\n")); |
| 343 | |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 344 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | } |
| 346 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 347 | tx_timer_set_expiry_list(&pMac->lim.limTimers.gLimAuthFailureTimer, |
| 348 | LIM_TIMER_EXPIRY_LIST); |
| 349 | #endif |
| 350 | if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, |
| 351 | &cfgValue) != eSIR_SUCCESS) |
| 352 | { |
| 353 | /** |
| 354 | * Could not get BEACON_INTERVAL value |
| 355 | * from CFG. Log error. |
| 356 | */ |
| 357 | limLog(pMac, LOGP, |
| 358 | FL("could not retrieve BEACON_INTERVAL value\n")); |
| 359 | } |
| 360 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 361 | |
| 362 | if (tx_timer_create(&pMac->lim.limTimers.gLimHeartBeatTimer, |
| 363 | "Heartbeat TIMEOUT", |
| 364 | limTimerHandler, |
| 365 | SIR_LIM_HEART_BEAT_TIMEOUT, |
| 366 | cfgValue, |
| 367 | 0, |
| 368 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 369 | { |
| 370 | /// Could not start Heartbeat timer. |
| 371 | // Log error |
| 372 | limLog(pMac, LOGP, |
| 373 | FL("call to create heartbeat timer failed\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 374 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, |
| 378 | &cfgValue) != eSIR_SUCCESS) |
| 379 | { |
| 380 | /** |
| 381 | * Could not get PROBE_AFTER_HB_FAILURE |
| 382 | * value from CFG. Log error. |
| 383 | */ |
| 384 | limLog(pMac, LOGP, |
| 385 | FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value\n")); |
| 386 | } |
| 387 | |
| 388 | // Change timer to reactivate it in future |
| 389 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 390 | |
| 391 | if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer, |
| 392 | "Probe after Heartbeat TIMEOUT", |
| 393 | limTimerHandler, |
| 394 | SIR_LIM_PROBE_HB_FAILURE_TIMEOUT, |
| 395 | cfgValue, |
| 396 | 0, |
| 397 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 398 | { |
| 399 | // Could not creat wt-probe-after-HeartBeat-failure timer. |
| 400 | // Log error |
| 401 | limLog(pMac, LOGP, |
| 402 | FL("unable to create ProbeAfterHBTimer\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 403 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 407 | tx_timer_set_expiry_list(&pMac->lim.limTimers.gLimProbeAfterHBTimer, |
| 408 | LIM_TIMER_EXPIRY_LIST); |
| 409 | #endif |
| 410 | |
| 411 | #if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK) |
| 412 | if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 413 | &cfgValue) != eSIR_SUCCESS) |
| 414 | { |
| 415 | /** |
| 416 | * Could not get Background scan period value |
| 417 | * from CFG. Log error. |
| 418 | */ |
| 419 | limLog(pMac, LOGP, |
| 420 | FL("could not retrieve Background scan period value\n")); |
| 421 | } |
| 422 | |
| 423 | /* |
| 424 | * setting period to zero means disabling background scans when associated |
| 425 | * the way we do this is to set a flag indicating this and keeping |
| 426 | * the timer running, since it will be used for PDU leak workarounds |
| 427 | * as well as background scanning during SME idle states |
| 428 | */ |
| 429 | if (cfgValue == 0) |
| 430 | { |
| 431 | cfgValue = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS; |
| 432 | pMac->lim.gLimBackgroundScanDisable = true; |
| 433 | } |
| 434 | else |
| 435 | pMac->lim.gLimBackgroundScanDisable = false; |
| 436 | |
| 437 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 438 | |
| 439 | if (tx_timer_create(&pMac->lim.limTimers.gLimBackgroundScanTimer, |
| 440 | "Background scan TIMEOUT", |
| 441 | limTimerHandler, |
| 442 | SIR_LIM_CHANNEL_SCAN_TIMEOUT, |
| 443 | cfgValue, |
| 444 | cfgValue, |
| 445 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 446 | { |
| 447 | /// Could not start background scan timer. |
| 448 | // Log error |
| 449 | limLog(pMac, LOGP, |
| 450 | FL("call to create background scan timer failed\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 451 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 452 | } |
| 453 | #endif |
| 454 | } |
| 455 | |
| 456 | |
| 457 | cfgValue = SYS_MS_TO_TICKS(LIM_HASH_MISS_TIMER_MS); |
| 458 | |
| 459 | if (tx_timer_create( |
| 460 | &pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer, |
| 461 | "Disassoc throttle TIMEOUT", |
| 462 | limSendDisassocFrameThresholdHandler, |
| 463 | SIR_LIM_HASH_MISS_THRES_TIMEOUT, |
| 464 | cfgValue, |
| 465 | cfgValue, |
| 466 | TX_AUTO_ACTIVATE) != TX_SUCCESS) |
| 467 | { |
| 468 | /// Could not start Send Disassociate Frame Threshold timer. |
| 469 | // Log error |
| 470 | limLog(pMac, LOGP, |
| 471 | FL("create Disassociate throttle timer failed\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 472 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | } |
| 474 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 475 | tx_timer_set_expiry_list( |
| 476 | &pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer, |
| 477 | LIM_TIMER_EXPIRY_LIST); |
| 478 | #endif |
| 479 | PELOG1(limLog(pMac, LOG1, |
| 480 | FL("Created Disassociate throttle timer \n"));) |
| 481 | |
| 482 | /** |
| 483 | * Create keepalive timer and activate it right away for AP role |
| 484 | */ |
| 485 | |
| 486 | if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT, |
| 487 | &cfgValue) != eSIR_SUCCESS) |
| 488 | { |
| 489 | /** |
| 490 | * Could not get keepalive timeout value |
| 491 | * from CFG. Log error. |
| 492 | */ |
| 493 | limLog(pMac, LOGP, |
| 494 | FL("could not retrieve keepalive timeout value\n")); |
| 495 | } |
| 496 | |
| 497 | // A value of zero implies keep alive should be disabled |
| 498 | if (cfgValue == 0) |
| 499 | { |
| 500 | cfgValue = LIM_KEEPALIVE_TIMER_MS; |
| 501 | pMac->sch.keepAlive = 0; |
| 502 | } else |
| 503 | pMac->sch.keepAlive = 1; |
| 504 | |
| 505 | |
| 506 | cfgValue = SYS_MS_TO_TICKS(cfgValue + SYS_TICK_DUR_MS - 1); |
| 507 | |
| 508 | if (tx_timer_create(&pMac->lim.limTimers.gLimKeepaliveTimer, |
| 509 | "KEEPALIVE_TIMEOUT", |
| 510 | limKeepaliveTmerHandler, |
| 511 | 0, |
| 512 | cfgValue, |
| 513 | cfgValue, |
| 514 | (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ? |
| 515 | TX_AUTO_ACTIVATE : TX_NO_ACTIVATE) |
| 516 | != TX_SUCCESS) |
| 517 | { |
| 518 | // Cannot create keepalive timer. Log error. |
| 519 | limLog(pMac, LOGP, FL("Cannot create keepalive timer.\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 520 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | /** |
| 524 | * Create all CNF_WAIT Timers upfront |
| 525 | */ |
| 526 | |
| 527 | if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT, |
| 528 | &cfgValue) != eSIR_SUCCESS) |
| 529 | { |
| 530 | /** |
| 531 | * Could not get CNF_WAIT timeout value |
| 532 | * from CFG. Log error. |
| 533 | */ |
| 534 | limLog(pMac, LOGP, |
| 535 | FL("could not retrieve CNF timeout value\n")); |
| 536 | } |
| 537 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 538 | |
| 539 | for (i=0; i<pMac->lim.maxStation; i++) |
| 540 | { |
| 541 | if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i], |
| 542 | "CNF_MISS_TIMEOUT", |
| 543 | limCnfWaitTmerHandler, |
| 544 | (tANI_U32)i, |
| 545 | cfgValue, |
| 546 | 0, |
| 547 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 548 | { |
| 549 | // Cannot create timer. Log error. |
| 550 | limLog(pMac, LOGP, FL("Cannot create CNF wait timer.\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 551 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 552 | } |
| 553 | } |
| 554 | |
| 555 | /* |
| 556 | ** Alloc and init table for the preAuth timer list |
| 557 | ** |
| 558 | **/ |
| 559 | |
| 560 | // get max number of Preauthentication |
| 561 | if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_NUM_PRE_AUTH, |
| 562 | &cfgValue) != eSIR_SUCCESS) |
| 563 | { |
| 564 | /* |
| 565 | ** Could not get max preauth value |
| 566 | ** from CFG. Log error. |
| 567 | **/ |
| 568 | limLog(pMac, LOGP, |
| 569 | FL("could not retrieve mac preauth value\n")); |
| 570 | } |
| 571 | #ifdef ANI_AP_SDK_OPT |
| 572 | if(cfgValue > SIR_SDK_OPT_MAX_NUM_PRE_AUTH) |
| 573 | cfgValue = SIR_SDK_OPT_MAX_NUM_PRE_AUTH; |
| 574 | #endif // ANI_AP_SDK_OPT |
| 575 | pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue; |
| 576 | if (palAllocateMemory(pMac->hHdd, (void **) &pMac->lim.gLimPreAuthTimerTable.pTable, |
| 577 | cfgValue*sizeof(tLimPreAuthNode)) != eHAL_STATUS_SUCCESS) |
| 578 | { |
| 579 | limLog(pMac, LOGP, FL("palAllocateMemory failed!\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 580 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | limInitPreAuthTimerTable(pMac, &pMac->lim.gLimPreAuthTimerTable); |
| 584 | PELOG1(limLog(pMac, LOG1, FL("alloc and init table for preAuth timers\n"));) |
| 585 | |
| 586 | |
| 587 | #ifdef WLAN_SOFTAP_FEATURE |
| 588 | { |
| 589 | /** |
| 590 | * Create OLBC cache aging timer |
| 591 | */ |
| 592 | if (wlan_cfgGetInt(pMac, WNI_CFG_OLBC_DETECT_TIMEOUT, |
| 593 | &cfgValue) != eSIR_SUCCESS) |
| 594 | { |
| 595 | /** |
| 596 | * Could not get OLBC detect timeout value |
| 597 | * from CFG. Log error. |
| 598 | */ |
| 599 | limLog(pMac, LOGP, |
| 600 | FL("could not retrieve OLBD detect timeout value\n")); |
| 601 | } |
| 602 | |
| 603 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 604 | |
| 605 | if (tx_timer_create( |
| 606 | &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer, |
| 607 | "OLBC UPDATE CACHE TIMEOUT", |
| 608 | limUpdateOlbcCacheTimerHandler, |
| 609 | SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT, |
| 610 | cfgValue, |
| 611 | cfgValue, |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 612 | TX_NO_ACTIVATE) != TX_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 613 | { |
| 614 | // Cannot create update OLBC cache timer |
| 615 | // Log error |
| 616 | limLog(pMac, LOGP, FL("Cannot create update OLBC cache timer\n")); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 617 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 618 | } |
| 619 | } |
| 620 | #endif |
| 621 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 622 | // In future we need to use the auth timer, cause |
| 623 | // the pre auth session will be introduced before sending |
| 624 | // Auth frame. |
| 625 | // We need to go off channel and come back to home channel |
| 626 | cfgValue = 1000; |
| 627 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 628 | |
| 629 | if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer, |
| 630 | "FT PREAUTH RSP TIMEOUT", |
| 631 | limTimerHandler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT, |
| 632 | cfgValue, 0, |
| 633 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 634 | { |
| 635 | // Could not create Join failure timer. |
| 636 | // Log error |
| 637 | limLog(pMac, LOGP, FL("could not create Join failure timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 638 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 639 | } |
| 640 | #endif |
| 641 | |
| 642 | #ifdef FEATURE_WLAN_CCX |
| 643 | cfgValue = 5000; |
| 644 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 645 | |
| 646 | if (tx_timer_create(&pMac->lim.limTimers.gLimCcxTsmTimer, |
| 647 | "CCX TSM Stats TIMEOUT", |
| 648 | limTimerHandler, SIR_LIM_CCX_TSM_TIMEOUT, |
| 649 | cfgValue, 0, |
| 650 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 651 | { |
| 652 | // Could not create Join failure timer. |
| 653 | // Log error |
| 654 | limLog(pMac, LOGP, FL("could not create Join failure timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 655 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 656 | } |
| 657 | #endif |
| 658 | |
| 659 | #ifdef WLAN_FEATURE_P2P |
| 660 | cfgValue = 1000; |
| 661 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 662 | if (tx_timer_create(&pMac->lim.limTimers.gLimRemainOnChannelTimer, |
| 663 | "FT PREAUTH RSP TIMEOUT", |
| 664 | limTimerHandler, SIR_LIM_REMAIN_CHN_TIMEOUT, |
| 665 | cfgValue, 0, |
| 666 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 667 | { |
| 668 | // Could not create Join failure timer. |
| 669 | // Log error |
| 670 | limLog(pMac, LOGP, FL("could not create Join failure timer\n")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 671 | goto err_timer; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | #endif |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame^] | 675 | |
| 676 | cfgValue = 1000; |
| 677 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 678 | if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer, |
| 679 | "DISASSOC ACK TIMEOUT", |
| 680 | limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT, |
| 681 | cfgValue, 0, |
| 682 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 683 | { |
| 684 | limLog(pMac, LOGP, FL("could not DISASSOC ACK TIMEOUT timer\n")); |
| 685 | goto err_timer; |
| 686 | } |
| 687 | |
| 688 | cfgValue = 1000; |
| 689 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 690 | if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer, |
| 691 | "DISASSOC ACK TIMEOUT", |
| 692 | limTimerHandler, SIR_LIM_DISASSOC_ACK_TIMEOUT, |
| 693 | cfgValue, 0, |
| 694 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 695 | { |
| 696 | limLog(pMac, LOGP, FL("could not create DEAUTH ACK TIMEOUT timer\n")); |
| 697 | goto err_timer; |
| 698 | } |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 699 | return TX_SUCCESS; |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 700 | |
| 701 | err_timer: |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame^] | 702 | tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer); |
| 703 | #ifdef WLAN_FEATURE_P2P |
| 704 | tx_timer_delete(&pMac->lim.limTimers.gLimRemainOnChannelTimer); |
| 705 | #endif |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 706 | #ifdef FEATURE_WLAN_CCX |
| 707 | tx_timer_delete(&pMac->lim.limTimers.gLimCcxTsmTimer); |
| 708 | #endif |
| 709 | tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer); |
| 710 | tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
| 711 | while(((tANI_S32)--i) >= 0) |
| 712 | { |
| 713 | tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[i]); |
| 714 | } |
| 715 | tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer); |
| 716 | tx_timer_delete(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer); |
| 717 | tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer); |
| 718 | tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 719 | tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 720 | tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer); |
| 721 | tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer); |
| 722 | tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer); |
| 723 | tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer); |
| 724 | tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer); |
| 725 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer); |
| 726 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer); |
| 727 | tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer); |
| 728 | tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer); |
| 729 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer); |
| 730 | tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer); |
| 731 | |
| 732 | if(NULL != pMac->lim.gLimPreAuthTimerTable.pTable) |
| 733 | palFreeMemory(pMac->hHdd, pMac->lim.gLimPreAuthTimerTable.pTable); |
| 734 | |
| 735 | return TX_TIMER_ERROR; |
| 736 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 737 | } /****** end limCreateTimers() ******/ |
| 738 | |
| 739 | |
| 740 | |
| 741 | /** |
| 742 | * limTimerHandler() |
| 743 | * |
| 744 | *FUNCTION: |
| 745 | * This function is called upon |
| 746 | * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning |
| 747 | * 2. JOIN_FAILURE timer expiration while joining a BSS |
| 748 | * 3. AUTH_FAILURE timer expiration while authenticating with a peer |
| 749 | * 4. Heartbeat timer expiration on STA |
| 750 | * 5. Background scan timer expiration on STA |
| 751 | * 6. AID release, Pre-auth cleanup and Link monitoring timer |
| 752 | * expiration on AP |
| 753 | * |
| 754 | *LOGIC: |
| 755 | * |
| 756 | *ASSUMPTIONS: |
| 757 | * NA |
| 758 | * |
| 759 | *NOTE: |
| 760 | * NA |
| 761 | * |
| 762 | * @param param - Message corresponding to the timer that expired |
| 763 | * |
| 764 | * @return None |
| 765 | */ |
| 766 | |
| 767 | void |
| 768 | limTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 769 | { |
| 770 | tANI_U32 statusCode; |
| 771 | tSirMsgQ msg; |
| 772 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 773 | |
| 774 | // Prepare and post message to LIM Message Queue |
| 775 | |
| 776 | msg.type = (tANI_U16) param; |
| 777 | msg.bodyptr = NULL; |
| 778 | msg.bodyval = 0; |
| 779 | |
| 780 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 781 | limLog(pMac, LOGE, |
| 782 | FL("posting message %X to LIM failed, reason=%d\n"), |
| 783 | msg.type, statusCode); |
| 784 | } /****** end limTimerHandler() ******/ |
| 785 | |
| 786 | |
| 787 | /** |
| 788 | * limAddtsResponseTimerHandler() |
| 789 | * |
| 790 | *FUNCTION: |
| 791 | * This function is called upon Addts response timer expiration on sta |
| 792 | * |
| 793 | *LOGIC: |
| 794 | * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 795 | * when this function is executed. |
| 796 | * |
| 797 | *ASSUMPTIONS: |
| 798 | * NA |
| 799 | * |
| 800 | *NOTE: |
| 801 | * NA |
| 802 | * |
| 803 | * @param param - pointer to pre-auth node |
| 804 | * |
| 805 | * @return None |
| 806 | */ |
| 807 | |
| 808 | void |
| 809 | limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 810 | { |
| 811 | tSirMsgQ msg; |
| 812 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 813 | |
| 814 | // Prepare and post message to LIM Message Queue |
| 815 | |
| 816 | msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT; |
| 817 | msg.bodyval = param; |
| 818 | msg.bodyptr = NULL; |
| 819 | |
| 820 | limPostMsgApi(pMac, &msg); |
| 821 | } /****** end limAuthResponseTimerHandler() ******/ |
| 822 | |
| 823 | |
| 824 | /** |
| 825 | * limAuthResponseTimerHandler() |
| 826 | * |
| 827 | *FUNCTION: |
| 828 | * This function is called upon Auth response timer expiration on AP |
| 829 | * |
| 830 | *LOGIC: |
| 831 | * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 832 | * when this function is executed. |
| 833 | * |
| 834 | *ASSUMPTIONS: |
| 835 | * NA |
| 836 | * |
| 837 | *NOTE: |
| 838 | * NA |
| 839 | * |
| 840 | * @param param - pointer to pre-auth node |
| 841 | * |
| 842 | * @return None |
| 843 | */ |
| 844 | |
| 845 | void |
| 846 | limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 847 | { |
| 848 | tSirMsgQ msg; |
| 849 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 850 | |
| 851 | // Prepare and post message to LIM Message Queue |
| 852 | |
| 853 | msg.type = SIR_LIM_AUTH_RSP_TIMEOUT; |
| 854 | msg.bodyptr = NULL; |
| 855 | msg.bodyval = (tANI_U32)param; |
| 856 | |
| 857 | limPostMsgApi(pMac, &msg); |
| 858 | } /****** end limAuthResponseTimerHandler() ******/ |
| 859 | |
| 860 | |
| 861 | |
| 862 | /** |
| 863 | * limAssocFailureTimerHandler() |
| 864 | * |
| 865 | *FUNCTION: |
| 866 | * This function is called upon Re/Assoc failure timer expiration |
| 867 | * on STA |
| 868 | * |
| 869 | *LOGIC: |
| 870 | * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ |
| 871 | * when this function is executed. |
| 872 | * |
| 873 | *ASSUMPTIONS: |
| 874 | * NA |
| 875 | * |
| 876 | *NOTE: |
| 877 | * NA |
| 878 | * |
| 879 | * @param param - Indicates whether this is assoc or reassoc |
| 880 | * failure timeout |
| 881 | * @return None |
| 882 | */ |
| 883 | |
| 884 | void |
| 885 | limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 886 | { |
| 887 | tSirMsgQ msg; |
| 888 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 889 | |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 890 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 891 | if((LIM_REASSOC == param) && |
| 892 | (NULL != pMac->lim.pSessionEntry)) |
| 893 | { |
| 894 | limLog(pMac, LOGE, FL("Reassoc timeout happened\n")); |
| 895 | if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT) |
| 896 | { |
| 897 | limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry); |
| 898 | pMac->lim.reAssocRetryAttempt++; |
| 899 | limLog(pMac, LOGW, FL("Reassoc request retry is sent %d times\n"), pMac->lim.reAssocRetryAttempt); |
| 900 | return; |
| 901 | } |
| 902 | else |
| 903 | { |
| 904 | limLog(pMac, LOGW, FL("Reassoc request retry MAX(%d) reached\n"), LIM_MAX_REASSOC_RETRY_LIMIT); |
| 905 | if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq) |
| 906 | { |
| 907 | palFreeMemory( pMac->hHdd, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq); |
| 908 | pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL; |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 913 | // Prepare and post message to LIM Message Queue |
| 914 | |
| 915 | msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT; |
| 916 | msg.bodyval = (tANI_U32)param; |
| 917 | msg.bodyptr = NULL; |
| 918 | |
| 919 | limPostMsgApi(pMac, &msg); |
| 920 | } /****** end limAssocFailureTimerHandler() ******/ |
| 921 | |
| 922 | |
| 923 | /** |
| 924 | * limUpdateOlbcCacheTimerHandler() |
| 925 | * |
| 926 | *FUNCTION: |
| 927 | * This function is called upon update olbc cache timer expiration |
| 928 | * on STA |
| 929 | * |
| 930 | *LOGIC: |
| 931 | * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ |
| 932 | * when this function is executed. |
| 933 | * |
| 934 | *ASSUMPTIONS: |
| 935 | * NA |
| 936 | * |
| 937 | *NOTE: |
| 938 | * NA |
| 939 | * |
| 940 | * @param |
| 941 | * |
| 942 | * @return None |
| 943 | */ |
| 944 | #ifdef WLAN_SOFTAP_FEATURE |
| 945 | void |
| 946 | limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 947 | { |
| 948 | tSirMsgQ msg; |
| 949 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 950 | |
| 951 | // Prepare and post message to LIM Message Queue |
| 952 | |
| 953 | msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT; |
| 954 | msg.bodyval = 0; |
| 955 | msg.bodyptr = NULL; |
| 956 | |
| 957 | limPostMsgApi(pMac, &msg); |
| 958 | } /****** end limUpdateOlbcCacheTimerHandler() ******/ |
| 959 | #endif |
| 960 | |
| 961 | /** |
| 962 | * limDeactivateAndChangeTimer() |
| 963 | * |
| 964 | *FUNCTION: |
| 965 | * This function is called to deactivate and change a timer |
| 966 | * for future re-activation |
| 967 | * |
| 968 | *LOGIC: |
| 969 | * |
| 970 | *ASSUMPTIONS: |
| 971 | * NA |
| 972 | * |
| 973 | *NOTE: |
| 974 | * NA |
| 975 | * |
| 976 | * @param pMac - Pointer to Global MAC structure |
| 977 | * @param timerId - enum of timer to be deactivated and changed |
| 978 | * This enum is defined in limUtils.h file |
| 979 | * |
| 980 | * @return None |
| 981 | */ |
| 982 | |
| 983 | void |
| 984 | limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId) |
| 985 | { |
| 986 | tANI_U32 val=0, val1=0; |
| 987 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 988 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 989 | |
| 990 | switch (timerId) |
| 991 | { |
| 992 | case eLIM_ADDTS_RSP_TIMER: |
| 993 | pMac->lim.gLimAddtsRspTimerCount++; |
| 994 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS) |
| 995 | { |
| 996 | // Could not deactivate AddtsRsp Timer |
| 997 | // Log error |
| 998 | limLog(pMac, LOGP, |
| 999 | FL("Unable to deactivate AddtsRsp timer\n")); |
| 1000 | } |
| 1001 | break; |
| 1002 | |
| 1003 | case eLIM_MIN_CHANNEL_TIMER: |
| 1004 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer) |
| 1005 | != TX_SUCCESS) |
| 1006 | { |
| 1007 | // Could not deactivate min channel timer. |
| 1008 | // Log error |
| 1009 | limLog(pMac, LOGP, |
| 1010 | FL("Unable to deactivate min channel timer\n")); |
| 1011 | } |
| 1012 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1013 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | // If a background was triggered via Quiet BSS, |
| 1015 | // then we need to adjust the MIN and MAX channel |
| 1016 | // timer's accordingly to the Quiet duration that |
| 1017 | // was specified |
| 1018 | if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState && |
| 1019 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss ) |
| 1020 | { |
| 1021 | // gLimQuietDuration is already cached in units of |
| 1022 | // system ticks. No conversion is reqd... |
| 1023 | val = pMac->lim.gLimSpecMgmt.quietDuration; |
| 1024 | } |
| 1025 | else |
| 1026 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1027 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1028 | if(pMac->lim.gpLimMlmScanReq) |
| 1029 | { |
| 1030 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime); |
| 1031 | } |
| 1032 | else |
| 1033 | { |
| 1034 | limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL ")); |
| 1035 | //No need to change min timer. This is not a scan |
| 1036 | break; |
| 1037 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1038 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1039 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1040 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1041 | |
| 1042 | if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer, |
| 1043 | val, 0) != TX_SUCCESS) |
| 1044 | { |
| 1045 | // Could not change min channel timer. |
| 1046 | // Log error |
| 1047 | limLog(pMac, LOGP, FL("Unable to change min channel timer\n")); |
| 1048 | } |
| 1049 | |
| 1050 | break; |
| 1051 | |
| 1052 | case eLIM_PERIODIC_PROBE_REQ_TIMER: |
| 1053 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer) |
| 1054 | != TX_SUCCESS) |
| 1055 | { |
| 1056 | // Could not deactivate min channel timer. |
| 1057 | // Log error |
| 1058 | limLog(pMac, LOGP, |
| 1059 | FL("Unable to deactivate periodic timer\n")); |
| 1060 | } |
| 1061 | |
| 1062 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2; |
| 1063 | if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer, |
| 1064 | val, 0) != TX_SUCCESS) |
| 1065 | { |
| 1066 | // Could not change min channel timer. |
| 1067 | // Log error |
| 1068 | limLog(pMac, LOGP, FL("Unable to change periodic timer\n")); |
| 1069 | } |
| 1070 | |
| 1071 | break; |
| 1072 | |
| 1073 | case eLIM_MAX_CHANNEL_TIMER: |
| 1074 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer) |
| 1075 | != TX_SUCCESS) |
| 1076 | { |
| 1077 | // Could not deactivate max channel timer. |
| 1078 | // Log error |
| 1079 | limLog(pMac, LOGP, |
| 1080 | FL("Unable to deactivate max channel timer\n")); |
| 1081 | } |
| 1082 | |
| 1083 | #if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK) |
| 1084 | // If a background was triggered via Quiet BSS, |
| 1085 | // then we need to adjust the MIN and MAX channel |
| 1086 | // timer's accordingly to the Quiet duration that |
| 1087 | // was specified |
| 1088 | if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE) |
| 1089 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1090 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1091 | |
| 1092 | if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState && |
| 1093 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss ) |
| 1094 | { |
| 1095 | // gLimQuietDuration is already cached in units of |
| 1096 | // system ticks. No conversion is reqd... |
| 1097 | val = pMac->lim.gLimSpecMgmt.quietDuration; |
| 1098 | } |
| 1099 | else |
| 1100 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1101 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1102 | if(pMac->lim.gpLimMlmScanReq) |
| 1103 | { |
| 1104 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime); |
| 1105 | } |
| 1106 | else |
| 1107 | { |
| 1108 | limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL ")); |
| 1109 | //No need to change max timer. This is not a scan |
| 1110 | break; |
| 1111 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1112 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1113 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1114 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1115 | } |
| 1116 | #endif |
| 1117 | #if defined(ANI_PRODUCT_TYPE_AP) |
| 1118 | if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) |
| 1119 | { |
| 1120 | if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME, |
| 1121 | &val) != eSIR_SUCCESS) |
| 1122 | { |
| 1123 | /** |
| 1124 | * Could not get max channel value |
| 1125 | * from CFG. Log error. |
| 1126 | */ |
| 1127 | limLog(pMac, LOGP, |
| 1128 | FL("could not retrieve max channel value\n")); |
| 1129 | } |
| 1130 | val = SYS_MS_TO_TICKS(val); |
| 1131 | } |
| 1132 | #endif |
| 1133 | |
| 1134 | if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer, |
| 1135 | val, 0) != TX_SUCCESS) |
| 1136 | { |
| 1137 | // Could not change max channel timer. |
| 1138 | // Log error |
| 1139 | limLog(pMac, LOGP, |
| 1140 | FL("Unable to change max channel timer\n")); |
| 1141 | } |
| 1142 | |
| 1143 | break; |
| 1144 | |
| 1145 | case eLIM_JOIN_FAIL_TIMER: |
| 1146 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer) |
| 1147 | != TX_SUCCESS) |
| 1148 | { |
| 1149 | /** |
| 1150 | * Could not deactivate Join Failure |
| 1151 | * timer. Log error. |
| 1152 | */ |
| 1153 | limLog(pMac, LOGP, |
| 1154 | FL("Unable to deactivate Join Failure timer\n")); |
| 1155 | } |
| 1156 | |
| 1157 | if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, |
| 1158 | &val) != eSIR_SUCCESS) |
| 1159 | { |
| 1160 | /** |
| 1161 | * Could not get JoinFailureTimeout value |
| 1162 | * from CFG. Log error. |
| 1163 | */ |
| 1164 | limLog(pMac, LOGP, |
| 1165 | FL("could not retrieve JoinFailureTimeout value\n")); |
| 1166 | } |
| 1167 | val = SYS_MS_TO_TICKS(val); |
| 1168 | |
| 1169 | if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer, |
| 1170 | val, 0) != TX_SUCCESS) |
| 1171 | { |
| 1172 | /** |
| 1173 | * Could not change Join Failure |
| 1174 | * timer. Log error. |
| 1175 | */ |
| 1176 | limLog(pMac, LOGP, |
| 1177 | FL("Unable to change Join Failure timer\n")); |
| 1178 | } |
| 1179 | |
| 1180 | break; |
| 1181 | |
| 1182 | case eLIM_AUTH_FAIL_TIMER: |
| 1183 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer) |
| 1184 | != TX_SUCCESS) |
| 1185 | { |
| 1186 | // Could not deactivate Auth failure timer. |
| 1187 | // Log error |
| 1188 | limLog(pMac, LOGP, |
| 1189 | FL("Unable to deactivate auth failure timer\n")); |
| 1190 | } |
| 1191 | |
| 1192 | // Change timer to reactivate it in future |
| 1193 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 1194 | &val) != eSIR_SUCCESS) |
| 1195 | { |
| 1196 | /** |
| 1197 | * Could not get AuthFailureTimeout value |
| 1198 | * from CFG. Log error. |
| 1199 | */ |
| 1200 | limLog(pMac, LOGP, |
| 1201 | FL("could not retrieve AuthFailureTimeout value\n")); |
| 1202 | } |
| 1203 | val = SYS_MS_TO_TICKS(val); |
| 1204 | |
| 1205 | if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer, |
| 1206 | val, 0) != TX_SUCCESS) |
| 1207 | { |
| 1208 | // Could not change Authentication failure timer. |
| 1209 | // Log error |
| 1210 | limLog(pMac, LOGP, |
| 1211 | FL("unable to change Auth failure timer\n")); |
| 1212 | } |
| 1213 | |
| 1214 | break; |
| 1215 | |
| 1216 | case eLIM_ASSOC_FAIL_TIMER: |
| 1217 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) != |
| 1218 | TX_SUCCESS) |
| 1219 | { |
| 1220 | // Could not deactivate Association failure timer. |
| 1221 | // Log error |
| 1222 | limLog(pMac, LOGP, |
| 1223 | FL("unable to deactivate Association failure timer\n")); |
| 1224 | } |
| 1225 | |
| 1226 | // Change timer to reactivate it in future |
| 1227 | if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, |
| 1228 | &val) != eSIR_SUCCESS) |
| 1229 | { |
| 1230 | /** |
| 1231 | * Could not get AssocFailureTimeout value |
| 1232 | * from CFG. Log error. |
| 1233 | */ |
| 1234 | limLog(pMac, LOGP, |
| 1235 | FL("could not retrieve AssocFailureTimeout value\n")); |
| 1236 | } |
| 1237 | val = SYS_MS_TO_TICKS(val); |
| 1238 | |
| 1239 | if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer, |
| 1240 | val, 0) != TX_SUCCESS) |
| 1241 | { |
| 1242 | // Could not change Association failure timer. |
| 1243 | // Log error |
| 1244 | limLog(pMac, LOGP, |
| 1245 | FL("unable to change Assoc failure timer\n")); |
| 1246 | } |
| 1247 | |
| 1248 | break; |
| 1249 | |
| 1250 | case eLIM_REASSOC_FAIL_TIMER: |
| 1251 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != |
| 1252 | TX_SUCCESS) |
| 1253 | { |
| 1254 | // Could not deactivate Reassociation failure timer. |
| 1255 | // Log error |
| 1256 | limLog(pMac, LOGP, |
| 1257 | FL("unable to deactivate Reassoc failure timer\n")); |
| 1258 | } |
| 1259 | |
| 1260 | // Change timer to reactivate it in future |
| 1261 | if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, |
| 1262 | &val) != eSIR_SUCCESS) |
| 1263 | { |
| 1264 | /** |
| 1265 | * Could not get ReassocFailureTimeout value |
| 1266 | * from CFG. Log error. |
| 1267 | */ |
| 1268 | limLog(pMac, LOGP, |
| 1269 | FL("could not retrieve ReassocFailureTimeout value\n")); |
| 1270 | } |
| 1271 | val = SYS_MS_TO_TICKS(val); |
| 1272 | |
| 1273 | if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 1274 | val, 0) != TX_SUCCESS) |
| 1275 | { |
| 1276 | // Could not change Reassociation failure timer. |
| 1277 | // Log error |
| 1278 | limLog(pMac, LOGP, |
| 1279 | FL("unable to change Reassociation failure timer\n")); |
| 1280 | } |
| 1281 | |
| 1282 | break; |
| 1283 | |
| 1284 | case eLIM_HEART_BEAT_TIMER: |
| 1285 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != |
| 1286 | TX_SUCCESS) |
| 1287 | { |
| 1288 | // Could not deactivate Heartbeat timer. |
| 1289 | // Log error |
| 1290 | limLog(pMac, LOGP, |
| 1291 | FL("unable to deactivate Heartbeat timer\n")); |
| 1292 | } |
| 1293 | |
| 1294 | if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, |
| 1295 | &val) != eSIR_SUCCESS) |
| 1296 | { |
| 1297 | /** |
| 1298 | * Could not get BEACON_INTERVAL value |
| 1299 | * from CFG. Log error. |
| 1300 | */ |
| 1301 | limLog(pMac, LOGP, |
| 1302 | FL("could not retrieve BEACON_INTERVAL value\n")); |
| 1303 | } |
| 1304 | |
| 1305 | if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != |
| 1306 | eSIR_SUCCESS) |
| 1307 | limLog(pMac, LOGP, |
| 1308 | FL("could not retrieve heartbeat failure value\n")); |
| 1309 | |
| 1310 | // Change timer to reactivate it in future |
| 1311 | val = SYS_MS_TO_TICKS(val * val1); |
| 1312 | |
| 1313 | if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, |
| 1314 | val, 0) != TX_SUCCESS) |
| 1315 | { |
| 1316 | // Could not change HeartBeat timer. |
| 1317 | // Log error |
| 1318 | limLog(pMac, LOGP, |
| 1319 | FL("unable to change HeartBeat timer\n")); |
| 1320 | } |
| 1321 | |
| 1322 | break; |
| 1323 | |
| 1324 | case eLIM_PROBE_AFTER_HB_TIMER: |
| 1325 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) != |
| 1326 | TX_SUCCESS) |
| 1327 | { |
| 1328 | // Could not deactivate Heartbeat timer. |
| 1329 | // Log error |
| 1330 | limLog(pMac, LOGP, |
| 1331 | FL("unable to deactivate probeAfterHBTimer\n")); |
| 1332 | } |
| 1333 | |
| 1334 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, |
| 1335 | &val) != eSIR_SUCCESS) |
| 1336 | { |
| 1337 | /** |
| 1338 | * Could not get PROBE_AFTER_HB_FAILURE |
| 1339 | * value from CFG. Log error. |
| 1340 | */ |
| 1341 | limLog(pMac, LOGP, |
| 1342 | FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value\n")); |
| 1343 | } |
| 1344 | |
| 1345 | // Change timer to reactivate it in future |
| 1346 | val = SYS_MS_TO_TICKS(val); |
| 1347 | |
| 1348 | if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer, |
| 1349 | val, 0) != TX_SUCCESS) |
| 1350 | { |
| 1351 | // Could not change HeartBeat timer. |
| 1352 | // Log error |
| 1353 | limLog(pMac, LOGP, |
| 1354 | FL("unable to change ProbeAfterHBTimer\n")); |
| 1355 | } |
| 1356 | |
| 1357 | break; |
| 1358 | |
| 1359 | case eLIM_KEEPALIVE_TIMER: |
| 1360 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer) |
| 1361 | != TX_SUCCESS) |
| 1362 | { |
| 1363 | // Could not deactivate Keepalive timer. |
| 1364 | // Log error |
| 1365 | limLog(pMac, LOGP, |
| 1366 | FL("unable to deactivate KeepaliveTimer timer\n")); |
| 1367 | } |
| 1368 | |
| 1369 | // Change timer to reactivate it in future |
| 1370 | |
| 1371 | if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT, |
| 1372 | &val) != eSIR_SUCCESS) |
| 1373 | { |
| 1374 | /** |
| 1375 | * Could not get keepalive timeout value |
| 1376 | * from CFG. Log error. |
| 1377 | */ |
| 1378 | limLog(pMac, LOGP, |
| 1379 | FL("could not retrieve keepalive timeout value\n")); |
| 1380 | } |
| 1381 | if (val == 0) |
| 1382 | { |
| 1383 | val = 3000; |
| 1384 | pMac->sch.keepAlive = 0; |
| 1385 | } else |
| 1386 | pMac->sch.keepAlive = 1; |
| 1387 | |
| 1388 | |
| 1389 | |
| 1390 | val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1); |
| 1391 | |
| 1392 | if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer, |
| 1393 | val, val) != TX_SUCCESS) |
| 1394 | { |
| 1395 | // Could not change KeepaliveTimer timer. |
| 1396 | // Log error |
| 1397 | limLog(pMac, LOGP, |
| 1398 | FL("unable to change KeepaliveTimer timer\n")); |
| 1399 | } |
| 1400 | |
| 1401 | break; |
| 1402 | |
| 1403 | #if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK) |
| 1404 | case eLIM_BACKGROUND_SCAN_TIMER: |
| 1405 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer) |
| 1406 | != TX_SUCCESS) |
| 1407 | { |
| 1408 | // Could not deactivate BackgroundScanTimer timer. |
| 1409 | // Log error |
| 1410 | limLog(pMac, LOGP, |
| 1411 | FL("unable to deactivate BackgroundScanTimer timer\n")); |
| 1412 | } |
| 1413 | |
| 1414 | // Change timer to reactivate it in future |
| 1415 | if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 1416 | &val) != eSIR_SUCCESS) |
| 1417 | { |
| 1418 | /** |
| 1419 | * Could not get Background scan period value |
| 1420 | * from CFG. Log error. |
| 1421 | */ |
| 1422 | limLog(pMac, LOGP, |
| 1423 | FL("could not retrieve Background scan period value\n")); |
| 1424 | } |
| 1425 | if (val == 0) |
| 1426 | { |
| 1427 | val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS; |
| 1428 | pMac->lim.gLimBackgroundScanDisable = true; |
| 1429 | } |
| 1430 | else |
| 1431 | pMac->lim.gLimBackgroundScanDisable = false; |
| 1432 | |
| 1433 | val = SYS_MS_TO_TICKS(val); |
| 1434 | |
| 1435 | if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer, |
| 1436 | val, val) != TX_SUCCESS) |
| 1437 | { |
| 1438 | // Could not change BackgroundScanTimer timer. |
| 1439 | // Log error |
| 1440 | limLog(pMac, LOGP, |
| 1441 | FL("unable to change BackgroundScanTimer timer\n")); |
| 1442 | } |
| 1443 | |
| 1444 | break; |
| 1445 | #endif |
| 1446 | |
| 1447 | #ifdef ANI_PRODUCT_TYPE_AP |
| 1448 | case eLIM_PRE_AUTH_CLEANUP_TIMER: |
| 1449 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPreAuthClnupTimer) != |
| 1450 | TX_SUCCESS) |
| 1451 | { |
| 1452 | // Could not deactivate Pre-auth cleanup timer. |
| 1453 | // Log error |
| 1454 | limLog(pMac, LOGP, |
| 1455 | FL("unable to deactivate Pre-auth cleanup timer\n")); |
| 1456 | } |
| 1457 | |
| 1458 | // Change timer to reactivate it in future |
| 1459 | if (wlan_cfgGetInt(pMac, WNI_CFG_PREAUTH_CLNUP_TIMEOUT, |
| 1460 | &val) != eSIR_SUCCESS) |
| 1461 | { |
| 1462 | /** |
| 1463 | * Could not get pre-auth cleanup value |
| 1464 | * from CFG. Log error. |
| 1465 | */ |
| 1466 | limLog(pMac, LOGP, |
| 1467 | FL("could not retrieve pre-auth cleanup value\n")); |
| 1468 | } |
| 1469 | val = SYS_MS_TO_TICKS(val); |
| 1470 | |
| 1471 | if (tx_timer_change(&pMac->lim.limTimers.gLimPreAuthClnupTimer, |
| 1472 | val, val) != TX_SUCCESS) |
| 1473 | { |
| 1474 | // Could not change pre-auth cleanup timer. |
| 1475 | // Log error |
| 1476 | limLog(pMac, LOGP, |
| 1477 | FL("unable to change pre-auth cleanup timer\n")); |
| 1478 | } |
| 1479 | |
| 1480 | break; |
| 1481 | |
| 1482 | case eLIM_LEARN_INTERVAL_TIMER: |
| 1483 | { |
| 1484 | // Restart Learn Interval timer |
| 1485 | tANI_U32 learnInterval = |
| 1486 | pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod / |
| 1487 | pMac->lim.gpLimMeasReq->channelList.numChannels; |
| 1488 | |
| 1489 | if (tx_timer_deactivate( |
| 1490 | &pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS) |
| 1491 | { |
| 1492 | // Could not deactivate Learn Interval timer. |
| 1493 | // Log error |
| 1494 | limLog(pMac, LOGP, |
| 1495 | FL("Unable to deactivate Learn Interval timer\n")); |
| 1496 | } |
| 1497 | |
| 1498 | if (tx_timer_change( |
| 1499 | &pMac->lim.gLimMeasParams.learnIntervalTimer, |
| 1500 | SYS_MS_TO_TICKS(learnInterval), 0) != TX_SUCCESS) |
| 1501 | { |
| 1502 | // Could not change Learn Interval timer. |
| 1503 | // Log error |
| 1504 | limLog(pMac, LOGP, FL("Unable to change Learn Interval timer\n")); |
| 1505 | |
| 1506 | return; |
| 1507 | } |
| 1508 | |
| 1509 | limLog( pMac, LOG3, |
| 1510 | FL("Setting the Learn Interval TIMER to %d ticks\n"), |
| 1511 | SYS_MS_TO_TICKS(learnInterval)); |
| 1512 | } |
| 1513 | break; |
| 1514 | |
| 1515 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1516 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1517 | case eLIM_CHANNEL_SWITCH_TIMER: |
| 1518 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) |
| 1519 | { |
| 1520 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed!\n")); |
| 1521 | return; |
| 1522 | } |
| 1523 | |
| 1524 | if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer, |
| 1525 | pMac->lim.gLimChannelSwitch.switchTimeoutValue, |
| 1526 | 0) != TX_SUCCESS) |
| 1527 | { |
| 1528 | limLog(pMac, LOGP, FL("tx_timer_change failed \n")); |
| 1529 | return; |
| 1530 | } |
| 1531 | break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1532 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1533 | |
| 1534 | case eLIM_LEARN_DURATION_TIMER: |
| 1535 | #ifdef ANI_PRODUCT_TYPE_AP |
| 1536 | if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.learnDurationTimer) != TX_SUCCESS) |
| 1537 | { |
| 1538 | limLog(pMac, LOGP, FL("Could not deactivate learn duration timer\n")); |
| 1539 | return; |
| 1540 | } |
| 1541 | |
| 1542 | if (pMac->lim.gpLimMeasReq->measControl.longChannelScanPeriodicity && |
| 1543 | (pMac->lim.gLimMeasParams.shortDurationCount == |
| 1544 | pMac->lim.gpLimMeasReq->measControl.longChannelScanPeriodicity)) |
| 1545 | { |
| 1546 | #ifdef ANI_AP_SDK |
| 1547 | val = pMac->lim.gLimScanDurationConvert.longChannelScanDuration_tick; |
| 1548 | #else |
| 1549 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.longChannelScanDuration |
| 1550 | + SYS_TICK_DUR_MS - 1); |
| 1551 | if(val > 1) |
| 1552 | val--; |
| 1553 | #endif /* ANI_AP_SDK */ |
| 1554 | // Time to perform measurements for longer term |
| 1555 | if (tx_timer_change(&pMac->lim.gLimMeasParams.learnDurationTimer, |
| 1556 | val, 0) != TX_SUCCESS) |
| 1557 | { |
| 1558 | // Could not change Learn duration timer. |
| 1559 | // Log error |
| 1560 | limLog(pMac, LOGP, FL("Unable to change Learn duration timer\n")); |
| 1561 | return; |
| 1562 | } |
| 1563 | pMac->lim.gLimMeasParams.shortDurationCount = 0; |
| 1564 | } |
| 1565 | else |
| 1566 | { |
| 1567 | #ifdef ANI_AP_SDK |
| 1568 | val = pMac->lim.gLimScanDurationConvert.shortChannelScanDuration_tick; |
| 1569 | #else |
| 1570 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration |
| 1571 | + SYS_TICK_DUR_MS - 1); |
| 1572 | if(val > 1) |
| 1573 | val--; |
| 1574 | #endif /* ANI_AP_SDK */ |
| 1575 | if (tx_timer_change(&pMac->lim.gLimMeasParams.learnDurationTimer, |
| 1576 | val, 0) != TX_SUCCESS) |
| 1577 | { |
| 1578 | // Could not change Learn duration timer. |
| 1579 | // Log error |
| 1580 | limLog(pMac, LOGP, FL("Unable to change Learn duration timer\n")); |
| 1581 | } |
| 1582 | } |
| 1583 | pMac->lim.gpLimMeasData->duration = val * SYS_TICK_DUR_MS; |
| 1584 | #endif |
| 1585 | break; |
| 1586 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1587 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1588 | case eLIM_QUIET_BSS_TIMER: |
| 1589 | if (TX_SUCCESS != |
| 1590 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer)) |
| 1591 | { |
| 1592 | limLog( pMac, LOGE, |
| 1593 | FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway...\n")); |
| 1594 | } |
| 1595 | |
| 1596 | // gLimQuietDuration appears to be in units of ticks |
| 1597 | // Use it as is |
| 1598 | if (TX_SUCCESS != |
| 1599 | tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer, |
| 1600 | pMac->lim.gLimSpecMgmt.quietDuration, |
| 1601 | 0)) |
| 1602 | { |
| 1603 | limLog( pMac, LOGE, |
| 1604 | FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway...\n")); |
| 1605 | } |
| 1606 | break; |
| 1607 | |
| 1608 | case eLIM_QUIET_TIMER: |
| 1609 | if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer)) |
| 1610 | { |
| 1611 | limLog( pMac, LOGE, |
| 1612 | FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway...\n" )); |
| 1613 | } |
| 1614 | |
| 1615 | // Set the NEW timeout value, in ticks |
| 1616 | if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer, |
| 1617 | SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0)) |
| 1618 | { |
| 1619 | limLog( pMac, LOGE, |
| 1620 | FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway...\n" )); |
| 1621 | } |
| 1622 | break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1623 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1624 | |
| 1625 | #ifdef WLAN_SOFTAP_FEATURE |
| 1626 | #if 0 |
| 1627 | case eLIM_WPS_OVERLAP_TIMER: |
| 1628 | { |
| 1629 | // Restart Learn Interval timer |
| 1630 | |
| 1631 | tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS); |
| 1632 | |
| 1633 | if (tx_timer_deactivate( |
| 1634 | &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS) |
| 1635 | { |
| 1636 | // Could not deactivate Learn Interval timer. |
| 1637 | // Log error |
| 1638 | limLog(pMac, LOGP, |
| 1639 | FL("Unable to deactivate WPS overlap timer\n")); |
| 1640 | } |
| 1641 | |
| 1642 | if (tx_timer_change( |
| 1643 | &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer, |
| 1644 | WPSOverlapTimer, 0) != TX_SUCCESS) |
| 1645 | { |
| 1646 | // Could not change Learn Interval timer. |
| 1647 | // Log error |
| 1648 | limLog(pMac, LOGP, FL("Unable to change WPS overlap timer\n")); |
| 1649 | |
| 1650 | return; |
| 1651 | } |
| 1652 | |
| 1653 | limLog( pMac, LOGE, |
| 1654 | FL("Setting WPS overlap TIMER to %d ticks\n"), |
| 1655 | WPSOverlapTimer); |
| 1656 | } |
| 1657 | break; |
| 1658 | #endif |
| 1659 | #endif |
| 1660 | |
| 1661 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1662 | case eLIM_FT_PREAUTH_RSP_TIMER: |
| 1663 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS) |
| 1664 | { |
| 1665 | /** |
| 1666 | ** Could not deactivate Join Failure |
| 1667 | ** timer. Log error. |
| 1668 | **/ |
| 1669 | limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer\n")); |
| 1670 | } |
| 1671 | val = 1000; |
| 1672 | val = SYS_MS_TO_TICKS(val); |
| 1673 | if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer, |
| 1674 | val, 0) != TX_SUCCESS) |
| 1675 | { |
| 1676 | /** |
| 1677 | * Could not change Join Failure |
| 1678 | * timer. Log error. |
| 1679 | */ |
| 1680 | limLog(pMac, LOGP, FL("Unable to change Join Failure timer\n")); |
| 1681 | } |
| 1682 | break; |
| 1683 | #endif |
| 1684 | #ifdef FEATURE_WLAN_CCX |
| 1685 | case eLIM_TSM_TIMER: |
| 1686 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer) |
| 1687 | != TX_SUCCESS) |
| 1688 | { |
| 1689 | limLog(pMac, LOGE, FL("Unable to deactivate TSM timer\n")); |
| 1690 | } |
| 1691 | break; |
| 1692 | #endif |
| 1693 | #ifdef WLAN_FEATURE_P2P |
| 1694 | case eLIM_REMAIN_CHN_TIMER: |
| 1695 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS) |
| 1696 | { |
| 1697 | /** |
| 1698 | ** Could not deactivate Join Failure |
| 1699 | ** timer. Log error. |
| 1700 | **/ |
| 1701 | limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer\n")); |
| 1702 | } |
| 1703 | val = 1000; |
| 1704 | val = SYS_MS_TO_TICKS(val); |
| 1705 | if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer, |
| 1706 | val, 0) != TX_SUCCESS) |
| 1707 | { |
| 1708 | /** |
| 1709 | * Could not change Join Failure |
| 1710 | * timer. Log error. |
| 1711 | */ |
| 1712 | limLog(pMac, LOGP, FL("Unable to change timer\n")); |
| 1713 | } |
| 1714 | break; |
| 1715 | #endif |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame^] | 1716 | case eLIM_DISASSOC_ACK_TIMER: |
| 1717 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS) |
| 1718 | { |
| 1719 | /** |
| 1720 | ** Could not deactivate Join Failure |
| 1721 | ** timer. Log error. |
| 1722 | **/ |
| 1723 | limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer\n")); |
| 1724 | } |
| 1725 | val = 1000; |
| 1726 | val = SYS_MS_TO_TICKS(val); |
| 1727 | if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer, |
| 1728 | val, 0) != TX_SUCCESS) |
| 1729 | { |
| 1730 | /** |
| 1731 | * Could not change Join Failure |
| 1732 | * timer. Log error. |
| 1733 | */ |
| 1734 | limLog(pMac, LOGP, FL("Unable to change timer\n")); |
| 1735 | } |
| 1736 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1737 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame^] | 1738 | case eLIM_DEAUTH_ACK_TIMER: |
| 1739 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS) |
| 1740 | { |
| 1741 | /** |
| 1742 | ** Could not deactivate Join Failure |
| 1743 | ** timer. Log error. |
| 1744 | **/ |
| 1745 | limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer\n")); |
| 1746 | } |
| 1747 | val = 1000; |
| 1748 | val = SYS_MS_TO_TICKS(val); |
| 1749 | if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer, |
| 1750 | val, 0) != TX_SUCCESS) |
| 1751 | { |
| 1752 | /** |
| 1753 | * Could not change Join Failure |
| 1754 | * timer. Log error. |
| 1755 | */ |
| 1756 | limLog(pMac, LOGP, FL("Unable to change timer\n")); |
| 1757 | } |
| 1758 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1759 | default: |
| 1760 | // Invalid timerId. Log error |
| 1761 | break; |
| 1762 | } |
| 1763 | } /****** end limDeactivateAndChangeTimer() ******/ |
| 1764 | |
| 1765 | |
| 1766 | |
| 1767 | /**--------------------------------------------------------------- |
| 1768 | \fn limHeartBeatDeactivateAndChangeTimer |
| 1769 | \brief This function deactivates and changes the heart beat |
| 1770 | \ timer, eLIM_HEART_BEAT_TIMER. |
| 1771 | \ |
| 1772 | \param pMac |
| 1773 | \param psessionEntry |
| 1774 | \return None |
| 1775 | ------------------------------------------------------------------*/ |
| 1776 | void |
| 1777 | limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1778 | { |
| 1779 | tANI_U32 val, val1; |
| 1780 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1781 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1782 | |
| 1783 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS) |
| 1784 | limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer \n")); |
| 1785 | |
| 1786 | /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps |
| 1787 | changing. to avoid this problem, HeartBeat interval is made constant, by |
| 1788 | fixing beacon interval to 100ms immaterial of the beacon interval of the session */ |
| 1789 | |
| 1790 | //val = psessionEntry->beaconParams.beaconInterval; |
| 1791 | val = LIM_HB_TIMER_BEACON_INTERVAL; |
| 1792 | |
| 1793 | if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS) |
| 1794 | limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD \n")); |
| 1795 | |
| 1796 | PELOGW(limLog(pMac,LOGW, |
| 1797 | FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d \n"), |
| 1798 | val1, psessionEntry->beaconParams.beaconInterval, |
| 1799 | psessionEntry->peSessionId);) |
| 1800 | |
| 1801 | // Change timer to reactivate it in future |
| 1802 | val = SYS_MS_TO_TICKS(val * val1); |
| 1803 | |
| 1804 | if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS) |
| 1805 | limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer\n")); |
| 1806 | |
| 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 | ------------------------------------------------------------------*/ |
| 1819 | void |
| 1820 | limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1821 | { |
| 1822 | PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d\n"), psessionEntry->LimRxedBeaconCntDuringHB);) |
| 1823 | |
| 1824 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1825 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1826 | |
| 1827 | //only start the hearbeat-timer if the timeout value is non-zero |
| 1828 | if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0) { |
| 1829 | if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS) |
| 1830 | { |
| 1831 | limLog(pMac, LOGP,FL("could not activate Heartbeat timer\n")); |
| 1832 | } |
| 1833 | limResetHBPktCount(psessionEntry); |
| 1834 | } |
| 1835 | |
| 1836 | } /****** end limReactivateHeartBeatTimer() ******/ |
| 1837 | |
| 1838 | #if 0 |
| 1839 | /****** |
| 1840 | * Note: Use this code once you have converted all |
| 1841 | * limReactivateHeartBeatTimer() calls to |
| 1842 | * limReactivateTimer() calls. |
| 1843 | * |
| 1844 | ******/ |
| 1845 | |
| 1846 | Now, in dev/btamp2, |
| 1847 | here are all the references to limReactivateHeartBeatTimer(). |
| 1848 | |
| 1849 | C symbol: limReactivateHeartBeatTimer |
| 1850 | |
| 1851 | File Function Line |
| 1852 | 0 limTimerUtils.h <global> 55 void limReactivateHeartBeatTimer(tpAniSirGlobal , tpPESession); |
| 1853 | 1 limIbssPeerMgmt.c limIbssHeartBeatHandle 1282 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1854 | 2 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 395 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1855 | 3 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 410 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1856 | 4 limProcessMlmRspMessages. limProcessStaMlmAddStaRsp 2111 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1857 | 5 limProcessMlmRspMessages_ limProcessStaMlmAddStaRsp 2350 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1858 | 6 limProcessMlmRspMessages_ limProcessStaMlmAddStaRsp 2111 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1859 | 7 limTimerUtils.c limReactivateHeartBeatTim 1473 limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1860 | 8 limUtils.c limHandleHeartBeatFailure 6743 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1861 | 9 limUtils.c limHandleHeartBeatFailure 6751 limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1862 | |
| 1863 | Now, in main/latest, on the other hand, |
| 1864 | here are all the references to limReactivateTimer(). |
| 1865 | |
| 1866 | C symbol: limReactivateTimer |
| 1867 | |
| 1868 | File Function Line |
| 1869 | 0 limTimerUtils.h <global> 54 void limReactivateTimer(tpAniSirGlobal, tANI_U32); |
| 1870 | 1 limIbssPeerMgmt.c limIbssHeartBeatHandle 1183 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1871 | 2 limIbssPeerMgmt.c limIbssHeartBeatHandle 1246 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1872 | 3 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 283 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1873 | 4 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 320 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1874 | 5 limLinkMonitoringAlgo.c limHandleHeartBeatFailure 335 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1875 | 6 limProcessMessageQueue.c limProcessMessages 1210 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1876 | 7 limProcessMessageQueue.c limProcessMessages 1218 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1877 | 8 limProcessMlmRspMessages. limProcessStaMlmAddStaRsp 1726 limReactivateTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1878 | 9 limTimerUtils.c limReactivateTimer 1451 limReactivateTimer(tpAniSirGlobal pMac, tANI_U32 timerId) |
| 1879 | |
| 1880 | |
| 1881 | /** |
| 1882 | * limReactivateTimer() |
| 1883 | * |
| 1884 | *FUNCTION: |
| 1885 | * This function is called to deactivate, change and |
| 1886 | * activate a timer |
| 1887 | * |
| 1888 | *LOGIC: |
| 1889 | * |
| 1890 | *ASSUMPTIONS: |
| 1891 | * NA |
| 1892 | * |
| 1893 | *NOTE: |
| 1894 | * NA |
| 1895 | * |
| 1896 | * @param pMac - Pointer to Global MAC structure |
| 1897 | * @param timerId - enum of timer to be deactivated and changed |
| 1898 | * This enum is defined in limUtils.h file |
| 1899 | * |
| 1900 | * @return None |
| 1901 | */ |
| 1902 | |
| 1903 | void |
| 1904 | limReactivateTimer(tpAniSirGlobal pMac, tANI_U32 timerId) |
| 1905 | { |
| 1906 | if (timerId == eLIM_HEART_BEAT_TIMER) |
| 1907 | { |
| 1908 | PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d\n"), |
| 1909 | pMac->lim.gLimRxedBeaconCntDuringHB);) |
| 1910 | limDeactivateAndChangeTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 1911 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, eLIM_HEART_BEAT_TIMER)); |
| 1912 | if (limActivateHearBeatTimer(pMac) != TX_SUCCESS) |
| 1913 | { |
| 1914 | /// Could not activate Heartbeat timer. |
| 1915 | // Log error |
| 1916 | limLog(pMac, LOGP, |
| 1917 | FL("could not activate Heartbeat timer\n")); |
| 1918 | } |
| 1919 | limResetHBPktCount(pMac); |
| 1920 | } |
| 1921 | } /****** end limReactivateTimer() ******/ |
| 1922 | #endif |
| 1923 | |
| 1924 | |
| 1925 | /** |
| 1926 | * limActivateHearBeatTimer() |
| 1927 | * |
| 1928 | * |
| 1929 | * @brief: This function is called to activate heartbeat timer |
| 1930 | * |
| 1931 | *LOGIC: |
| 1932 | * |
| 1933 | *ASSUMPTIONS: |
| 1934 | * NA |
| 1935 | * |
| 1936 | * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index. |
| 1937 | * |
| 1938 | * @param pMac - Pointer to Global MAC structure |
| 1939 | * |
| 1940 | * @return TX_SUCCESS - timer is activated |
| 1941 | * errors - fail to start the timer |
| 1942 | */ |
| 1943 | v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac) |
| 1944 | { |
| 1945 | v_UINT_t status = TX_TIMER_ERROR; |
| 1946 | |
| 1947 | if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature) |
| 1948 | { |
| 1949 | //consider 0 interval a ok case |
| 1950 | if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs ) |
| 1951 | { |
| 1952 | status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1953 | if( TX_SUCCESS != status ) |
| 1954 | { |
| 1955 | PELOGE(limLog(pMac, LOGE, |
| 1956 | FL("could not activate Heartbeat timer status(%d)\n"), status);) |
| 1957 | } |
| 1958 | } |
| 1959 | else |
| 1960 | { |
| 1961 | status = TX_SUCCESS; |
| 1962 | } |
| 1963 | } |
| 1964 | |
| 1965 | return (status); |
| 1966 | } |
| 1967 | |
| 1968 | |
| 1969 | |
| 1970 | /** |
| 1971 | * limDeactivateAndChangePerStaIdTimer() |
| 1972 | * |
| 1973 | * |
| 1974 | * @brief: This function is called to deactivate and change a per STA timer |
| 1975 | * for future re-activation |
| 1976 | * |
| 1977 | *LOGIC: |
| 1978 | * |
| 1979 | *ASSUMPTIONS: |
| 1980 | * NA |
| 1981 | * |
| 1982 | * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index. |
| 1983 | * |
| 1984 | * @param pMac - Pointer to Global MAC structure |
| 1985 | * @param timerId - enum of timer to be deactivated and changed |
| 1986 | * This enum is defined in limUtils.h file |
| 1987 | * @param staId - staId |
| 1988 | * |
| 1989 | * @return None |
| 1990 | */ |
| 1991 | |
| 1992 | void |
| 1993 | limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId) |
| 1994 | { |
| 1995 | tANI_U32 val; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1996 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1997 | |
| 1998 | switch (timerId) |
| 1999 | { |
| 2000 | case eLIM_CNF_WAIT_TIMER: |
| 2001 | |
| 2002 | if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
| 2003 | != TX_SUCCESS) |
| 2004 | { |
| 2005 | limLog(pMac, LOGP, |
| 2006 | FL("unable to deactivate CNF wait timer\n")); |
| 2007 | |
| 2008 | } |
| 2009 | |
| 2010 | // Change timer to reactivate it in future |
| 2011 | |
| 2012 | if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT, |
| 2013 | &val) != eSIR_SUCCESS) |
| 2014 | { |
| 2015 | /** |
| 2016 | * Could not get cnf timeout value |
| 2017 | * from CFG. Log error. |
| 2018 | */ |
| 2019 | limLog(pMac, LOGP, |
| 2020 | FL("could not retrieve cnf timeout value\n")); |
| 2021 | } |
| 2022 | val = SYS_MS_TO_TICKS(val); |
| 2023 | |
| 2024 | if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId], |
| 2025 | val, val) != TX_SUCCESS) |
| 2026 | { |
| 2027 | // Could not change cnf timer. |
| 2028 | // Log error |
| 2029 | limLog(pMac, LOGP, FL("unable to change cnf wait timer\n")); |
| 2030 | } |
| 2031 | |
| 2032 | break; |
| 2033 | |
| 2034 | case eLIM_AUTH_RSP_TIMER: |
| 2035 | { |
| 2036 | tLimPreAuthNode *pAuthNode; |
| 2037 | |
| 2038 | pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId); |
| 2039 | |
| 2040 | if (pAuthNode == NULL) |
| 2041 | { |
| 2042 | limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d\n"), staId); |
| 2043 | break; |
| 2044 | } |
| 2045 | |
| 2046 | if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS) |
| 2047 | { |
| 2048 | // Could not deactivate auth response timer. |
| 2049 | // Log error |
| 2050 | limLog(pMac, LOGP, FL("unable to deactivate auth response timer\n")); |
| 2051 | } |
| 2052 | |
| 2053 | // Change timer to reactivate it in future |
| 2054 | |
| 2055 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS) |
| 2056 | { |
| 2057 | /** |
| 2058 | * Could not get auth rsp timeout value |
| 2059 | * from CFG. Log error. |
| 2060 | */ |
| 2061 | limLog(pMac, LOGP, |
| 2062 | FL("could not retrieve auth response timeout value\n")); |
| 2063 | } |
| 2064 | |
| 2065 | val = SYS_MS_TO_TICKS(val); |
| 2066 | |
| 2067 | if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS) |
| 2068 | { |
| 2069 | // Could not change auth rsp timer. |
| 2070 | // Log error |
| 2071 | limLog(pMac, LOGP, FL("unable to change auth rsp timer\n")); |
| 2072 | } |
| 2073 | } |
| 2074 | break; |
| 2075 | |
| 2076 | #if (defined(ANI_PRODUCT_TYPE_AP) ||defined(ANI_PRODUCT_TYPE_AP_SDK)) |
| 2077 | case eLIM_LEARN_INTERVAL_TIMER: |
| 2078 | { |
| 2079 | // Restart Learn Interval timer |
| 2080 | tANI_U32 learnInterval = |
| 2081 | pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod / |
| 2082 | pMac->lim.gpLimMeasReq->channelList.numChannels; |
| 2083 | |
| 2084 | if (tx_timer_deactivate( |
| 2085 | &pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS) |
| 2086 | { |
| 2087 | // Could not deactivate Learn Interval timer. |
| 2088 | // Log error |
| 2089 | limLog(pMac, LOGP, |
| 2090 | FL("Unable to deactivate Learn Interval timer\n")); |
| 2091 | } |
| 2092 | |
| 2093 | if (tx_timer_change( |
| 2094 | &pMac->lim.gLimMeasParams.learnIntervalTimer, |
| 2095 | SYS_MS_TO_TICKS(learnInterval), 0) != TX_SUCCESS) |
| 2096 | { |
| 2097 | // Could not change Learn Interval timer. |
| 2098 | // Log error |
| 2099 | limLog(pMac, LOGP, FL("Unable to change Learn Interval timer\n")); |
| 2100 | |
| 2101 | return; |
| 2102 | } |
| 2103 | |
| 2104 | limLog( pMac, LOG3, |
| 2105 | FL("Setting the Learn Interval TIMER to %d ticks\n"), |
| 2106 | SYS_MS_TO_TICKS(learnInterval) ); |
| 2107 | } |
| 2108 | break; |
| 2109 | #endif //#if (defined(ANI_PRODUCT_TYPE_AP) ||defined(ANI_PRODUCT_TYPE_AP_SDK)) |
| 2110 | |
| 2111 | default: |
| 2112 | // Invalid timerId. Log error |
| 2113 | break; |
| 2114 | |
| 2115 | } |
| 2116 | } |
| 2117 | |
| 2118 | |
| 2119 | /** |
| 2120 | * limActivateCnfTimer() |
| 2121 | * |
| 2122 | *FUNCTION: |
| 2123 | * This function is called to activate a per STA timer |
| 2124 | * |
| 2125 | *LOGIC: |
| 2126 | * |
| 2127 | *ASSUMPTIONS: |
| 2128 | * NA |
| 2129 | * |
| 2130 | *NOTE: |
| 2131 | * NA |
| 2132 | * |
| 2133 | * @param pMac - Pointer to Global MAC structure |
| 2134 | * @param StaId - staId |
| 2135 | * |
| 2136 | * @return None |
| 2137 | */ |
| 2138 | |
| 2139 | void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry) |
| 2140 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2141 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_CNF_WAIT_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2142 | pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId; |
| 2143 | if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
| 2144 | != TX_SUCCESS) |
| 2145 | { |
| 2146 | limLog(pMac, LOGP, |
| 2147 | FL("could not activate cnf wait timer\n")); |
| 2148 | } |
| 2149 | } |
| 2150 | |
| 2151 | /** |
| 2152 | * limActivateAuthRspTimer() |
| 2153 | * |
| 2154 | *FUNCTION: |
| 2155 | * This function is called to activate a per STA timer |
| 2156 | * |
| 2157 | *LOGIC: |
| 2158 | * |
| 2159 | *ASSUMPTIONS: |
| 2160 | * NA |
| 2161 | * |
| 2162 | *NOTE: |
| 2163 | * NA |
| 2164 | * |
| 2165 | * @param pMac - Pointer to Global MAC structure |
| 2166 | * @param id - id |
| 2167 | * |
| 2168 | * @return None |
| 2169 | */ |
| 2170 | |
| 2171 | void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode) |
| 2172 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2173 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_AUTH_RESP_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2174 | if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS) |
| 2175 | { |
| 2176 | /// Could not activate auth rsp timer. |
| 2177 | // Log error |
| 2178 | limLog(pMac, LOGP, |
| 2179 | FL("could not activate auth rsp timer\n")); |
| 2180 | } |
| 2181 | } |
| 2182 | |
| 2183 | |
| 2184 | /** |
| 2185 | * limSendDisassocFrameThresholdHandler() |
| 2186 | * |
| 2187 | *FUNCTION: |
| 2188 | * This function reloads the credit to the send disassociate frame bucket |
| 2189 | * |
| 2190 | *LOGIC: |
| 2191 | * |
| 2192 | *ASSUMPTIONS: |
| 2193 | * |
| 2194 | *NOTE: |
| 2195 | * NA |
| 2196 | * |
| 2197 | * @param |
| 2198 | * |
| 2199 | * @return None |
| 2200 | */ |
| 2201 | |
| 2202 | void |
| 2203 | limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param) |
| 2204 | { |
| 2205 | tSirMsgQ msg; |
| 2206 | tANI_U32 statusCode; |
| 2207 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2208 | |
| 2209 | msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT; |
| 2210 | msg.bodyval = 0; |
| 2211 | msg.bodyptr = NULL; |
| 2212 | |
| 2213 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2214 | limLog(pMac, LOGE, |
| 2215 | FL("posting to LIM failed, reason=%d\n"), statusCode); |
| 2216 | |
| 2217 | } |
| 2218 | |
| 2219 | /** |
| 2220 | * limAssocCnfWaitTmerHandler() |
| 2221 | * |
| 2222 | *FUNCTION: |
| 2223 | * This function post a message to send a disassociate frame out. |
| 2224 | * |
| 2225 | *LOGIC: |
| 2226 | * |
| 2227 | *ASSUMPTIONS: |
| 2228 | * |
| 2229 | *NOTE: |
| 2230 | * NA |
| 2231 | * |
| 2232 | * @param |
| 2233 | * |
| 2234 | * @return None |
| 2235 | */ |
| 2236 | |
| 2237 | void |
| 2238 | limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param) |
| 2239 | { |
| 2240 | tSirMsgQ msg; |
| 2241 | tANI_U32 statusCode; |
| 2242 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2243 | |
| 2244 | msg.type = SIR_LIM_CNF_WAIT_TIMEOUT; |
| 2245 | msg.bodyval = (tANI_U32)param; |
| 2246 | msg.bodyptr = NULL; |
| 2247 | |
| 2248 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2249 | limLog(pMac, LOGE, |
| 2250 | FL("posting to LIM failed, reason=%d\n"), statusCode); |
| 2251 | |
| 2252 | } |
| 2253 | |
| 2254 | /** |
| 2255 | * limKeepaliveTmerHandler() |
| 2256 | * |
| 2257 | *FUNCTION: |
| 2258 | * This function post a message to send a NULL data frame. |
| 2259 | * |
| 2260 | *LOGIC: |
| 2261 | * |
| 2262 | *ASSUMPTIONS: |
| 2263 | * |
| 2264 | *NOTE: |
| 2265 | * NA |
| 2266 | * |
| 2267 | * @param |
| 2268 | * |
| 2269 | * @return None |
| 2270 | */ |
| 2271 | |
| 2272 | void |
| 2273 | limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param) |
| 2274 | { |
| 2275 | tSirMsgQ msg; |
| 2276 | tANI_U32 statusCode; |
| 2277 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2278 | |
| 2279 | msg.type = SIR_LIM_KEEPALIVE_TIMEOUT; |
| 2280 | msg.bodyval = (tANI_U32)param; |
| 2281 | msg.bodyptr = NULL; |
| 2282 | |
| 2283 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2284 | limLog(pMac, LOGE, |
| 2285 | FL("posting to LIM failed, reason=%d\n"), statusCode); |
| 2286 | |
| 2287 | } |
| 2288 | |
| 2289 | void |
| 2290 | limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2291 | { |
| 2292 | tSirMsgQ msg; |
| 2293 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2294 | |
| 2295 | PELOG1(limLog(pMac, LOG1, |
| 2296 | FL("ChannelSwitch Timer expired. Posting msg to LIM \n"));) |
| 2297 | |
| 2298 | msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT; |
| 2299 | msg.bodyval = (tANI_U32)param; |
| 2300 | msg.bodyptr = NULL; |
| 2301 | |
| 2302 | limPostMsgApi(pMac, &msg); |
| 2303 | } |
| 2304 | |
| 2305 | void |
| 2306 | limQuietTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2307 | { |
| 2308 | tSirMsgQ msg; |
| 2309 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2310 | |
| 2311 | msg.type = SIR_LIM_QUIET_TIMEOUT; |
| 2312 | msg.bodyval = (tANI_U32)param; |
| 2313 | msg.bodyptr = NULL; |
| 2314 | |
| 2315 | PELOG1(limLog(pMac, LOG1, |
| 2316 | FL("Post SIR_LIM_QUIET_TIMEOUT msg. \n"));) |
| 2317 | limPostMsgApi(pMac, &msg); |
| 2318 | } |
| 2319 | |
| 2320 | void |
| 2321 | limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2322 | { |
| 2323 | tSirMsgQ msg; |
| 2324 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2325 | |
| 2326 | msg.type = SIR_LIM_QUIET_BSS_TIMEOUT; |
| 2327 | msg.bodyval = (tANI_U32)param; |
| 2328 | msg.bodyptr = NULL; |
| 2329 | PELOG1(limLog(pMac, LOG1, |
| 2330 | FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. \n"));) |
| 2331 | limPostMsgApi(pMac, &msg); |
| 2332 | } |
| 2333 | #ifdef WLAN_SOFTAP_FEATURE |
| 2334 | #if 0 |
| 2335 | void |
| 2336 | limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2337 | { |
| 2338 | tSirMsgQ msg; |
| 2339 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2340 | |
| 2341 | msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT; |
| 2342 | msg.bodyval = (tANI_U32)param; |
| 2343 | msg.bodyptr = NULL; |
| 2344 | PELOG1(limLog(pMac, LOG1, |
| 2345 | FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. \n"));) |
| 2346 | limPostMsgApi(pMac, &msg); |
| 2347 | } |
| 2348 | #endif |
| 2349 | #endif |