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