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