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) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame^] | 794 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 795 | vos_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame^] | 796 | pMac->lim.gLimPreAuthTimerTable.pTable = NULL; |
| 797 | } |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 798 | |
| 799 | return TX_TIMER_ERROR; |
| 800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 801 | } /****** end limCreateTimers() ******/ |
| 802 | |
| 803 | |
| 804 | |
| 805 | /** |
| 806 | * limTimerHandler() |
| 807 | * |
| 808 | *FUNCTION: |
| 809 | * This function is called upon |
| 810 | * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning |
| 811 | * 2. JOIN_FAILURE timer expiration while joining a BSS |
| 812 | * 3. AUTH_FAILURE timer expiration while authenticating with a peer |
| 813 | * 4. Heartbeat timer expiration on STA |
| 814 | * 5. Background scan timer expiration on STA |
| 815 | * 6. AID release, Pre-auth cleanup and Link monitoring timer |
| 816 | * expiration on AP |
| 817 | * |
| 818 | *LOGIC: |
| 819 | * |
| 820 | *ASSUMPTIONS: |
| 821 | * NA |
| 822 | * |
| 823 | *NOTE: |
| 824 | * NA |
| 825 | * |
| 826 | * @param param - Message corresponding to the timer that expired |
| 827 | * |
| 828 | * @return None |
| 829 | */ |
| 830 | |
| 831 | void |
| 832 | limTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 833 | { |
| 834 | tANI_U32 statusCode; |
| 835 | tSirMsgQ msg; |
| 836 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 837 | |
| 838 | // Prepare and post message to LIM Message Queue |
| 839 | |
| 840 | msg.type = (tANI_U16) param; |
| 841 | msg.bodyptr = NULL; |
| 842 | msg.bodyval = 0; |
| 843 | |
| 844 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 845 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 846 | FL("posting message %X to LIM failed, reason=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 847 | msg.type, statusCode); |
| 848 | } /****** end limTimerHandler() ******/ |
| 849 | |
| 850 | |
| 851 | /** |
| 852 | * limAddtsResponseTimerHandler() |
| 853 | * |
| 854 | *FUNCTION: |
| 855 | * This function is called upon Addts response timer expiration on sta |
| 856 | * |
| 857 | *LOGIC: |
| 858 | * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 859 | * when this function is executed. |
| 860 | * |
| 861 | *ASSUMPTIONS: |
| 862 | * NA |
| 863 | * |
| 864 | *NOTE: |
| 865 | * NA |
| 866 | * |
| 867 | * @param param - pointer to pre-auth node |
| 868 | * |
| 869 | * @return None |
| 870 | */ |
| 871 | |
| 872 | void |
| 873 | limAddtsResponseTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 874 | { |
| 875 | tSirMsgQ msg; |
| 876 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 877 | |
| 878 | // Prepare and post message to LIM Message Queue |
| 879 | |
| 880 | msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT; |
| 881 | msg.bodyval = param; |
| 882 | msg.bodyptr = NULL; |
| 883 | |
| 884 | limPostMsgApi(pMac, &msg); |
| 885 | } /****** end limAuthResponseTimerHandler() ******/ |
| 886 | |
| 887 | |
| 888 | /** |
| 889 | * limAuthResponseTimerHandler() |
| 890 | * |
| 891 | *FUNCTION: |
| 892 | * This function is called upon Auth response timer expiration on AP |
| 893 | * |
| 894 | *LOGIC: |
| 895 | * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 896 | * when this function is executed. |
| 897 | * |
| 898 | *ASSUMPTIONS: |
| 899 | * NA |
| 900 | * |
| 901 | *NOTE: |
| 902 | * NA |
| 903 | * |
| 904 | * @param param - pointer to pre-auth node |
| 905 | * |
| 906 | * @return None |
| 907 | */ |
| 908 | |
| 909 | void |
| 910 | limAuthResponseTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 911 | { |
| 912 | tSirMsgQ msg; |
| 913 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 914 | |
| 915 | // Prepare and post message to LIM Message Queue |
| 916 | |
| 917 | msg.type = SIR_LIM_AUTH_RSP_TIMEOUT; |
| 918 | msg.bodyptr = NULL; |
| 919 | msg.bodyval = (tANI_U32)param; |
| 920 | |
| 921 | limPostMsgApi(pMac, &msg); |
| 922 | } /****** end limAuthResponseTimerHandler() ******/ |
| 923 | |
| 924 | |
| 925 | |
| 926 | /** |
| 927 | * limAssocFailureTimerHandler() |
| 928 | * |
| 929 | *FUNCTION: |
| 930 | * This function is called upon Re/Assoc failure timer expiration |
| 931 | * on STA |
| 932 | * |
| 933 | *LOGIC: |
| 934 | * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ |
| 935 | * when this function is executed. |
| 936 | * |
| 937 | *ASSUMPTIONS: |
| 938 | * NA |
| 939 | * |
| 940 | *NOTE: |
| 941 | * NA |
| 942 | * |
| 943 | * @param param - Indicates whether this is assoc or reassoc |
| 944 | * failure timeout |
| 945 | * @return None |
| 946 | */ |
| 947 | |
| 948 | void |
| 949 | limAssocFailureTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 950 | { |
| 951 | tSirMsgQ msg; |
| 952 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 953 | |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 954 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 955 | if((LIM_REASSOC == param) && |
| 956 | (NULL != pMac->lim.pSessionEntry)) |
| 957 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 958 | limLog(pMac, LOGE, FL("Reassoc timeout happened")); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 959 | if(pMac->lim.reAssocRetryAttempt < LIM_MAX_REASSOC_RETRY_LIMIT) |
| 960 | { |
| 961 | limSendRetryReassocReqFrame(pMac, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, pMac->lim.pSessionEntry); |
| 962 | pMac->lim.reAssocRetryAttempt++; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 963 | 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] | 964 | return; |
| 965 | } |
| 966 | else |
| 967 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 968 | 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] | 969 | if(NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq) |
| 970 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 971 | vos_mem_free( pMac->lim.pSessionEntry->pLimMlmReassocRetryReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 972 | pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL; |
| 973 | } |
| 974 | } |
| 975 | } |
| 976 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 977 | // Prepare and post message to LIM Message Queue |
| 978 | |
| 979 | msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT; |
| 980 | msg.bodyval = (tANI_U32)param; |
| 981 | msg.bodyptr = NULL; |
| 982 | |
| 983 | limPostMsgApi(pMac, &msg); |
| 984 | } /****** end limAssocFailureTimerHandler() ******/ |
| 985 | |
| 986 | |
| 987 | /** |
| 988 | * limUpdateOlbcCacheTimerHandler() |
| 989 | * |
| 990 | *FUNCTION: |
| 991 | * This function is called upon update olbc cache timer expiration |
| 992 | * on STA |
| 993 | * |
| 994 | *LOGIC: |
| 995 | * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ |
| 996 | * when this function is executed. |
| 997 | * |
| 998 | *ASSUMPTIONS: |
| 999 | * NA |
| 1000 | * |
| 1001 | *NOTE: |
| 1002 | * NA |
| 1003 | * |
| 1004 | * @param |
| 1005 | * |
| 1006 | * @return None |
| 1007 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1008 | void |
| 1009 | limUpdateOlbcCacheTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 1010 | { |
| 1011 | tSirMsgQ msg; |
| 1012 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 1013 | |
| 1014 | // Prepare and post message to LIM Message Queue |
| 1015 | |
| 1016 | msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT; |
| 1017 | msg.bodyval = 0; |
| 1018 | msg.bodyptr = NULL; |
| 1019 | |
| 1020 | limPostMsgApi(pMac, &msg); |
| 1021 | } /****** end limUpdateOlbcCacheTimerHandler() ******/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1022 | |
| 1023 | /** |
| 1024 | * limDeactivateAndChangeTimer() |
| 1025 | * |
| 1026 | *FUNCTION: |
| 1027 | * This function is called to deactivate and change a timer |
| 1028 | * for future re-activation |
| 1029 | * |
| 1030 | *LOGIC: |
| 1031 | * |
| 1032 | *ASSUMPTIONS: |
| 1033 | * NA |
| 1034 | * |
| 1035 | *NOTE: |
| 1036 | * NA |
| 1037 | * |
| 1038 | * @param pMac - Pointer to Global MAC structure |
| 1039 | * @param timerId - enum of timer to be deactivated and changed |
| 1040 | * This enum is defined in limUtils.h file |
| 1041 | * |
| 1042 | * @return None |
| 1043 | */ |
| 1044 | |
| 1045 | void |
| 1046 | limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId) |
| 1047 | { |
| 1048 | tANI_U32 val=0, val1=0; |
| 1049 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1050 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1051 | |
| 1052 | switch (timerId) |
| 1053 | { |
| 1054 | case eLIM_ADDTS_RSP_TIMER: |
| 1055 | pMac->lim.gLimAddtsRspTimerCount++; |
| 1056 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS) |
| 1057 | { |
| 1058 | // Could not deactivate AddtsRsp Timer |
| 1059 | // Log error |
| 1060 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1061 | FL("Unable to deactivate AddtsRsp timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1062 | } |
| 1063 | break; |
| 1064 | |
| 1065 | case eLIM_MIN_CHANNEL_TIMER: |
| 1066 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer) |
| 1067 | != TX_SUCCESS) |
| 1068 | { |
| 1069 | // Could not deactivate min channel timer. |
| 1070 | // Log error |
| 1071 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1072 | FL("Unable to deactivate min channel timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1073 | } |
| 1074 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1075 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1076 | // If a background was triggered via Quiet BSS, |
| 1077 | // then we need to adjust the MIN and MAX channel |
| 1078 | // timer's accordingly to the Quiet duration that |
| 1079 | // was specified |
| 1080 | if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState && |
| 1081 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss ) |
| 1082 | { |
| 1083 | // gLimQuietDuration is already cached in units of |
| 1084 | // system ticks. No conversion is reqd... |
| 1085 | val = pMac->lim.gLimSpecMgmt.quietDuration; |
| 1086 | } |
| 1087 | else |
| 1088 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1089 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1090 | if(pMac->lim.gpLimMlmScanReq) |
| 1091 | { |
| 1092 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime); |
Kiran Kumar Lokere | 3527f0c | 2013-02-24 22:21:28 -0800 | [diff] [blame] | 1093 | if (pMac->btc.btcScanCompromise) |
| 1094 | { |
| 1095 | if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc) |
| 1096 | { |
| 1097 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc); |
| 1098 | limLog(pMac, LOG1, FL("Using BTC Min Active Scan time")); |
| 1099 | } |
| 1100 | else |
| 1101 | { |
| 1102 | limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set")); |
| 1103 | } |
| 1104 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1105 | } |
| 1106 | else |
| 1107 | { |
| 1108 | limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL ")); |
| 1109 | //No need to change min timer. This is not a scan |
| 1110 | break; |
| 1111 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1112 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1113 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1114 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1115 | |
| 1116 | if (tx_timer_change(&pMac->lim.limTimers.gLimMinChannelTimer, |
| 1117 | val, 0) != TX_SUCCESS) |
| 1118 | { |
| 1119 | // Could not change min channel timer. |
| 1120 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1121 | limLog(pMac, LOGP, FL("Unable to change min channel timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1122 | } |
| 1123 | |
| 1124 | break; |
| 1125 | |
| 1126 | case eLIM_PERIODIC_PROBE_REQ_TIMER: |
| 1127 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer) |
| 1128 | != TX_SUCCESS) |
| 1129 | { |
| 1130 | // Could not deactivate min channel timer. |
| 1131 | // Log error |
| 1132 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1133 | FL("Unable to deactivate periodic timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1134 | } |
| 1135 | |
| 1136 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTime)/2; |
Kiran Kumar Lokere | 3527f0c | 2013-02-24 22:21:28 -0800 | [diff] [blame] | 1137 | if (pMac->btc.btcScanCompromise) |
| 1138 | { |
| 1139 | if (pMac->lim.gpLimMlmScanReq->minChannelTimeBtc) |
| 1140 | { |
| 1141 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->minChannelTimeBtc)/2; |
| 1142 | } |
| 1143 | else |
| 1144 | { |
| 1145 | limLog(pMac, LOGE, FL("BTC Active Scan Min Time is Not Set")); |
| 1146 | } |
| 1147 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1148 | if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer, |
| 1149 | val, 0) != TX_SUCCESS) |
| 1150 | { |
| 1151 | // Could not change min channel timer. |
| 1152 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1153 | limLog(pMac, LOGP, FL("Unable to change periodic timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1154 | } |
| 1155 | |
| 1156 | break; |
| 1157 | |
| 1158 | case eLIM_MAX_CHANNEL_TIMER: |
| 1159 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer) |
| 1160 | != TX_SUCCESS) |
| 1161 | { |
| 1162 | // Could not deactivate max channel timer. |
| 1163 | // Log error |
| 1164 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1165 | FL("Unable to deactivate max channel timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1166 | } |
| 1167 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1168 | // If a background was triggered via Quiet BSS, |
| 1169 | // then we need to adjust the MIN and MAX channel |
| 1170 | // timer's accordingly to the Quiet duration that |
| 1171 | // was specified |
| 1172 | if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE) |
| 1173 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1174 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1175 | |
| 1176 | if( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState && |
| 1177 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss ) |
| 1178 | { |
| 1179 | // gLimQuietDuration is already cached in units of |
| 1180 | // system ticks. No conversion is reqd... |
| 1181 | val = pMac->lim.gLimSpecMgmt.quietDuration; |
| 1182 | } |
| 1183 | else |
| 1184 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1185 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1186 | if(pMac->lim.gpLimMlmScanReq) |
| 1187 | { |
| 1188 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime); |
Kiran Kumar Lokere | 3527f0c | 2013-02-24 22:21:28 -0800 | [diff] [blame] | 1189 | if (pMac->btc.btcScanCompromise) |
| 1190 | { |
| 1191 | if (pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc) |
| 1192 | { |
| 1193 | val = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTimeBtc); |
| 1194 | limLog(pMac, LOG1, FL("Using BTC Max Active Scan time")); |
| 1195 | } |
| 1196 | else |
| 1197 | { |
| 1198 | limLog(pMac, LOGE, FL("BTC Active Scan Max Time is Not Set")); |
| 1199 | } |
| 1200 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1201 | } |
| 1202 | else |
| 1203 | { |
| 1204 | limLog(pMac, LOGE, FL(" gpLimMlmScanReq is NULL ")); |
| 1205 | //No need to change max timer. This is not a scan |
| 1206 | break; |
| 1207 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1208 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1210 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1211 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1212 | |
| 1213 | if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer, |
| 1214 | val, 0) != TX_SUCCESS) |
| 1215 | { |
| 1216 | // Could not change max channel timer. |
| 1217 | // Log error |
| 1218 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1219 | FL("Unable to change max channel timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1220 | } |
| 1221 | |
| 1222 | break; |
| 1223 | |
| 1224 | case eLIM_JOIN_FAIL_TIMER: |
| 1225 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer) |
| 1226 | != TX_SUCCESS) |
| 1227 | { |
| 1228 | /** |
| 1229 | * Could not deactivate Join Failure |
| 1230 | * timer. Log error. |
| 1231 | */ |
| 1232 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1233 | FL("Unable to deactivate Join Failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1234 | } |
| 1235 | |
| 1236 | if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, |
| 1237 | &val) != eSIR_SUCCESS) |
| 1238 | { |
| 1239 | /** |
| 1240 | * Could not get JoinFailureTimeout value |
| 1241 | * from CFG. Log error. |
| 1242 | */ |
| 1243 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1244 | FL("could not retrieve JoinFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1245 | } |
| 1246 | val = SYS_MS_TO_TICKS(val); |
| 1247 | |
| 1248 | if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer, |
| 1249 | val, 0) != TX_SUCCESS) |
| 1250 | { |
| 1251 | /** |
| 1252 | * Could not change Join Failure |
| 1253 | * timer. Log error. |
| 1254 | */ |
| 1255 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1256 | FL("Unable to change Join Failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1257 | } |
| 1258 | |
| 1259 | break; |
| 1260 | |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1261 | case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER: |
| 1262 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer) |
| 1263 | != TX_SUCCESS) |
| 1264 | { |
| 1265 | // Could not deactivate periodic join req Times. |
| 1266 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1267 | FL("Unable to deactivate periodic join request timer")); |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1268 | } |
| 1269 | |
| 1270 | val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS); |
| 1271 | if (tx_timer_change(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer, |
| 1272 | val, 0) != TX_SUCCESS) |
| 1273 | { |
| 1274 | // Could not change periodic join req times. |
| 1275 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1276 | limLog(pMac, LOGP, FL("Unable to change periodic join request timer")); |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1277 | } |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 1278 | |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1279 | break; |
| 1280 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1281 | case eLIM_AUTH_FAIL_TIMER: |
| 1282 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer) |
| 1283 | != TX_SUCCESS) |
| 1284 | { |
| 1285 | // Could not deactivate Auth failure timer. |
| 1286 | // Log error |
| 1287 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1288 | FL("Unable to deactivate auth failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1289 | } |
| 1290 | |
| 1291 | // Change timer to reactivate it in future |
| 1292 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 1293 | &val) != eSIR_SUCCESS) |
| 1294 | { |
| 1295 | /** |
| 1296 | * Could not get AuthFailureTimeout value |
| 1297 | * from CFG. Log error. |
| 1298 | */ |
| 1299 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1300 | FL("could not retrieve AuthFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1301 | } |
| 1302 | val = SYS_MS_TO_TICKS(val); |
| 1303 | |
| 1304 | if (tx_timer_change(&pMac->lim.limTimers.gLimAuthFailureTimer, |
| 1305 | val, 0) != TX_SUCCESS) |
| 1306 | { |
| 1307 | // Could not change Authentication failure timer. |
| 1308 | // Log error |
| 1309 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1310 | FL("unable to change Auth failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1311 | } |
| 1312 | |
| 1313 | break; |
| 1314 | |
| 1315 | case eLIM_ASSOC_FAIL_TIMER: |
| 1316 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer) != |
| 1317 | TX_SUCCESS) |
| 1318 | { |
| 1319 | // Could not deactivate Association failure timer. |
| 1320 | // Log error |
| 1321 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1322 | FL("unable to deactivate Association failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1323 | } |
| 1324 | |
| 1325 | // Change timer to reactivate it in future |
| 1326 | if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, |
| 1327 | &val) != eSIR_SUCCESS) |
| 1328 | { |
| 1329 | /** |
| 1330 | * Could not get AssocFailureTimeout value |
| 1331 | * from CFG. Log error. |
| 1332 | */ |
| 1333 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1334 | FL("could not retrieve AssocFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1335 | } |
| 1336 | val = SYS_MS_TO_TICKS(val); |
| 1337 | |
| 1338 | if (tx_timer_change(&pMac->lim.limTimers.gLimAssocFailureTimer, |
| 1339 | val, 0) != TX_SUCCESS) |
| 1340 | { |
| 1341 | // Could not change Association failure timer. |
| 1342 | // Log error |
| 1343 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1344 | FL("unable to change Assoc failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1345 | } |
| 1346 | |
| 1347 | break; |
| 1348 | |
| 1349 | case eLIM_REASSOC_FAIL_TIMER: |
| 1350 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != |
| 1351 | TX_SUCCESS) |
| 1352 | { |
| 1353 | // Could not deactivate Reassociation failure timer. |
| 1354 | // Log error |
| 1355 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1356 | FL("unable to deactivate Reassoc failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1357 | } |
| 1358 | |
| 1359 | // Change timer to reactivate it in future |
| 1360 | if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, |
| 1361 | &val) != eSIR_SUCCESS) |
| 1362 | { |
| 1363 | /** |
| 1364 | * Could not get ReassocFailureTimeout value |
| 1365 | * from CFG. Log error. |
| 1366 | */ |
| 1367 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1368 | FL("could not retrieve ReassocFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1369 | } |
| 1370 | val = SYS_MS_TO_TICKS(val); |
| 1371 | |
| 1372 | if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 1373 | val, 0) != TX_SUCCESS) |
| 1374 | { |
| 1375 | // Could not change Reassociation failure timer. |
| 1376 | // Log error |
| 1377 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1378 | FL("unable to change Reassociation failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | } |
| 1380 | |
| 1381 | break; |
| 1382 | |
| 1383 | case eLIM_HEART_BEAT_TIMER: |
| 1384 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != |
| 1385 | TX_SUCCESS) |
| 1386 | { |
| 1387 | // Could not deactivate Heartbeat timer. |
| 1388 | // Log error |
| 1389 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1390 | FL("unable to deactivate Heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | } |
Srinivas Girigowda | 3789b74 | 2013-04-08 16:14:44 -0700 | [diff] [blame] | 1392 | else |
| 1393 | { |
| 1394 | limLog(pMac, LOGW, FL("Deactivated heartbeat link monitoring")); |
| 1395 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1396 | |
| 1397 | if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, |
| 1398 | &val) != eSIR_SUCCESS) |
| 1399 | { |
| 1400 | /** |
| 1401 | * Could not get BEACON_INTERVAL value |
| 1402 | * from CFG. Log error. |
| 1403 | */ |
| 1404 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1405 | FL("could not retrieve BEACON_INTERVAL value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1406 | } |
| 1407 | |
| 1408 | if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != |
| 1409 | eSIR_SUCCESS) |
| 1410 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1411 | FL("could not retrieve heartbeat failure value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1412 | |
| 1413 | // Change timer to reactivate it in future |
| 1414 | val = SYS_MS_TO_TICKS(val * val1); |
| 1415 | |
| 1416 | if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, |
| 1417 | val, 0) != TX_SUCCESS) |
| 1418 | { |
| 1419 | // Could not change HeartBeat timer. |
| 1420 | // Log error |
| 1421 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1422 | FL("unable to change HeartBeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1423 | } |
Srinivas Girigowda | 3789b74 | 2013-04-08 16:14:44 -0700 | [diff] [blame] | 1424 | else |
| 1425 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1426 | limLog(pMac, LOGW, FL("HeartBeat timer value is changed = %u"), val); |
Srinivas Girigowda | 3789b74 | 2013-04-08 16:14:44 -0700 | [diff] [blame] | 1427 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1428 | break; |
| 1429 | |
| 1430 | case eLIM_PROBE_AFTER_HB_TIMER: |
| 1431 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) != |
| 1432 | TX_SUCCESS) |
| 1433 | { |
| 1434 | // Could not deactivate Heartbeat timer. |
| 1435 | // Log error |
| 1436 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1437 | FL("unable to deactivate probeAfterHBTimer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1438 | } |
Srinivas Girigowda | 3789b74 | 2013-04-08 16:14:44 -0700 | [diff] [blame] | 1439 | else |
| 1440 | { |
| 1441 | limLog(pMac, LOGE, FL("Deactivated probe after hb timer")); |
| 1442 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1443 | |
| 1444 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, |
| 1445 | &val) != eSIR_SUCCESS) |
| 1446 | { |
| 1447 | /** |
| 1448 | * Could not get PROBE_AFTER_HB_FAILURE |
| 1449 | * value from CFG. Log error. |
| 1450 | */ |
| 1451 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1452 | FL("could not retrieve PROBE_AFTER_HB_FAIL_TIMEOUT value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1453 | } |
| 1454 | |
| 1455 | // Change timer to reactivate it in future |
| 1456 | val = SYS_MS_TO_TICKS(val); |
| 1457 | |
| 1458 | if (tx_timer_change(&pMac->lim.limTimers.gLimProbeAfterHBTimer, |
| 1459 | val, 0) != TX_SUCCESS) |
| 1460 | { |
| 1461 | // Could not change HeartBeat timer. |
| 1462 | // Log error |
| 1463 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1464 | FL("unable to change ProbeAfterHBTimer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1465 | } |
Srinivas Girigowda | 3789b74 | 2013-04-08 16:14:44 -0700 | [diff] [blame] | 1466 | else |
| 1467 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1468 | limLog(pMac, LOGW, FL("Probe after HB timer value is changed = %u"), val); |
Srinivas Girigowda | 3789b74 | 2013-04-08 16:14:44 -0700 | [diff] [blame] | 1469 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1470 | |
| 1471 | break; |
| 1472 | |
| 1473 | case eLIM_KEEPALIVE_TIMER: |
| 1474 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer) |
| 1475 | != TX_SUCCESS) |
| 1476 | { |
| 1477 | // Could not deactivate Keepalive timer. |
| 1478 | // Log error |
| 1479 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1480 | FL("unable to deactivate KeepaliveTimer timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1481 | } |
| 1482 | |
| 1483 | // Change timer to reactivate it in future |
| 1484 | |
| 1485 | if (wlan_cfgGetInt(pMac, WNI_CFG_KEEPALIVE_TIMEOUT, |
| 1486 | &val) != eSIR_SUCCESS) |
| 1487 | { |
| 1488 | /** |
| 1489 | * Could not get keepalive timeout value |
| 1490 | * from CFG. Log error. |
| 1491 | */ |
| 1492 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1493 | FL("could not retrieve keepalive timeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | } |
| 1495 | if (val == 0) |
| 1496 | { |
| 1497 | val = 3000; |
| 1498 | pMac->sch.keepAlive = 0; |
| 1499 | } else |
| 1500 | pMac->sch.keepAlive = 1; |
| 1501 | |
| 1502 | |
| 1503 | |
| 1504 | val = SYS_MS_TO_TICKS(val + SYS_TICK_DUR_MS - 1); |
| 1505 | |
| 1506 | if (tx_timer_change(&pMac->lim.limTimers.gLimKeepaliveTimer, |
| 1507 | val, val) != TX_SUCCESS) |
| 1508 | { |
| 1509 | // Could not change KeepaliveTimer timer. |
| 1510 | // Log error |
| 1511 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1512 | FL("unable to change KeepaliveTimer timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1513 | } |
| 1514 | |
| 1515 | break; |
| 1516 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1517 | case eLIM_BACKGROUND_SCAN_TIMER: |
| 1518 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer) |
| 1519 | != TX_SUCCESS) |
| 1520 | { |
| 1521 | // Could not deactivate BackgroundScanTimer timer. |
| 1522 | // Log error |
| 1523 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1524 | FL("unable to deactivate BackgroundScanTimer timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1525 | } |
| 1526 | |
| 1527 | // Change timer to reactivate it in future |
| 1528 | if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 1529 | &val) != eSIR_SUCCESS) |
| 1530 | { |
| 1531 | /** |
| 1532 | * Could not get Background scan period value |
| 1533 | * from CFG. Log error. |
| 1534 | */ |
| 1535 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1536 | FL("could not retrieve Background scan period value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1537 | } |
| 1538 | if (val == 0) |
| 1539 | { |
| 1540 | val = LIM_BACKGROUND_SCAN_PERIOD_DEFAULT_MS; |
| 1541 | pMac->lim.gLimBackgroundScanDisable = true; |
| 1542 | } |
| 1543 | else |
| 1544 | pMac->lim.gLimBackgroundScanDisable = false; |
| 1545 | |
| 1546 | val = SYS_MS_TO_TICKS(val); |
| 1547 | |
| 1548 | if (tx_timer_change(&pMac->lim.limTimers.gLimBackgroundScanTimer, |
| 1549 | val, val) != TX_SUCCESS) |
| 1550 | { |
| 1551 | // Could not change BackgroundScanTimer timer. |
| 1552 | // Log error |
| 1553 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1554 | FL("unable to change BackgroundScanTimer timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1555 | } |
| 1556 | |
| 1557 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1558 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1559 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1560 | case eLIM_CHANNEL_SWITCH_TIMER: |
| 1561 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) |
| 1562 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1563 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1564 | return; |
| 1565 | } |
| 1566 | |
| 1567 | if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer, |
| 1568 | pMac->lim.gLimChannelSwitch.switchTimeoutValue, |
| 1569 | 0) != TX_SUCCESS) |
| 1570 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1571 | limLog(pMac, LOGP, FL("tx_timer_change failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1572 | return; |
| 1573 | } |
| 1574 | break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1575 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | |
| 1577 | case eLIM_LEARN_DURATION_TIMER: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1578 | break; |
| 1579 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1580 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1581 | case eLIM_QUIET_BSS_TIMER: |
| 1582 | if (TX_SUCCESS != |
| 1583 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer)) |
| 1584 | { |
| 1585 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1586 | FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1587 | } |
| 1588 | |
| 1589 | // gLimQuietDuration appears to be in units of ticks |
| 1590 | // Use it as is |
| 1591 | if (TX_SUCCESS != |
| 1592 | tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer, |
| 1593 | pMac->lim.gLimSpecMgmt.quietDuration, |
| 1594 | 0)) |
| 1595 | { |
| 1596 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1597 | FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1598 | } |
| 1599 | break; |
| 1600 | |
| 1601 | case eLIM_QUIET_TIMER: |
| 1602 | if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer)) |
| 1603 | { |
| 1604 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1605 | FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1606 | } |
| 1607 | |
| 1608 | // Set the NEW timeout value, in ticks |
| 1609 | if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer, |
| 1610 | SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0)) |
| 1611 | { |
| 1612 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1613 | FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1614 | } |
| 1615 | break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1616 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1617 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1618 | #if 0 |
| 1619 | case eLIM_WPS_OVERLAP_TIMER: |
| 1620 | { |
| 1621 | // Restart Learn Interval timer |
| 1622 | |
| 1623 | tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS); |
| 1624 | |
| 1625 | if (tx_timer_deactivate( |
| 1626 | &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS) |
| 1627 | { |
| 1628 | // Could not deactivate Learn Interval timer. |
| 1629 | // Log error |
| 1630 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1631 | FL("Unable to deactivate WPS overlap timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1632 | } |
| 1633 | |
| 1634 | if (tx_timer_change( |
| 1635 | &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer, |
| 1636 | WPSOverlapTimer, 0) != TX_SUCCESS) |
| 1637 | { |
| 1638 | // Could not change Learn Interval timer. |
| 1639 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1640 | limLog(pMac, LOGP, FL("Unable to change WPS overlap timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1641 | |
| 1642 | return; |
| 1643 | } |
| 1644 | |
| 1645 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1646 | FL("Setting WPS overlap TIMER to %d ticks"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | WPSOverlapTimer); |
| 1648 | } |
| 1649 | break; |
| 1650 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1651 | |
| 1652 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1653 | case eLIM_FT_PREAUTH_RSP_TIMER: |
| 1654 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS) |
| 1655 | { |
| 1656 | /** |
| 1657 | ** Could not deactivate Join Failure |
| 1658 | ** timer. Log error. |
| 1659 | **/ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1660 | limLog(pMac, LOGP, FL("Unable to deactivate Preauth response Failure timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1661 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1662 | } |
| 1663 | val = 1000; |
| 1664 | val = SYS_MS_TO_TICKS(val); |
| 1665 | if (tx_timer_change(&pMac->lim.limTimers.gLimFTPreAuthRspTimer, |
| 1666 | val, 0) != TX_SUCCESS) |
| 1667 | { |
| 1668 | /** |
| 1669 | * Could not change Join Failure |
| 1670 | * timer. Log error. |
| 1671 | */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1672 | limLog(pMac, LOGP, FL("Unable to change Join Failure timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1673 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1674 | } |
| 1675 | break; |
| 1676 | #endif |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1677 | #if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1678 | case eLIM_TSM_TIMER: |
| 1679 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer) |
| 1680 | != TX_SUCCESS) |
| 1681 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1682 | limLog(pMac, LOGE, FL("Unable to deactivate TSM timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1683 | } |
| 1684 | break; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1685 | #endif /* FEATURE_WLAN_CCX && !FEATURE_WLAN_CCX_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1686 | case eLIM_REMAIN_CHN_TIMER: |
| 1687 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer) != TX_SUCCESS) |
| 1688 | { |
| 1689 | /** |
| 1690 | ** Could not deactivate Join Failure |
| 1691 | ** timer. Log error. |
| 1692 | **/ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1693 | limLog(pMac, LOGP, FL("Unable to deactivate Remain on Chn timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1694 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1695 | } |
| 1696 | val = 1000; |
| 1697 | val = SYS_MS_TO_TICKS(val); |
| 1698 | if (tx_timer_change(&pMac->lim.limTimers.gLimRemainOnChannelTimer, |
| 1699 | val, 0) != TX_SUCCESS) |
| 1700 | { |
| 1701 | /** |
| 1702 | * Could not change Join Failure |
| 1703 | * timer. Log error. |
| 1704 | */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1705 | limLog(pMac, LOGP, FL("Unable to change timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1706 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1707 | } |
| 1708 | break; |
Gopichand Nakkala | d492d20 | 2013-05-10 02:50:47 +0530 | [diff] [blame] | 1709 | |
| 1710 | case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
| 1711 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer) != TX_SUCCESS) |
| 1712 | { |
| 1713 | /** |
| 1714 | ** Could not deactivate Active to passive channel timer. |
| 1715 | ** Log error. |
| 1716 | **/ |
| 1717 | limLog(pMac, LOGP, FL("Unable to Deactivate " |
| 1718 | "Active to passive channel timer")); |
| 1719 | return; |
| 1720 | } |
| 1721 | val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT; |
| 1722 | val = SYS_MS_TO_TICKS(val); |
| 1723 | if (tx_timer_change(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer, |
| 1724 | val, 0) != TX_SUCCESS) |
| 1725 | { |
| 1726 | /** |
| 1727 | * Could not change timer to check scan type for passive channel. |
| 1728 | * timer. Log error. |
| 1729 | */ |
| 1730 | limLog(pMac, LOGP, FL("Unable to change timer")); |
| 1731 | return; |
| 1732 | } |
| 1733 | break; |
| 1734 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1735 | case eLIM_DISASSOC_ACK_TIMER: |
| 1736 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS) |
| 1737 | { |
| 1738 | /** |
| 1739 | ** Could not deactivate Join Failure |
| 1740 | ** timer. Log error. |
| 1741 | **/ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1742 | limLog(pMac, LOGP, FL("Unable to deactivate Disassoc ack timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1743 | return; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1744 | } |
| 1745 | val = 1000; |
| 1746 | val = SYS_MS_TO_TICKS(val); |
| 1747 | if (tx_timer_change(&pMac->lim.limTimers.gLimDisassocAckTimer, |
| 1748 | val, 0) != TX_SUCCESS) |
| 1749 | { |
| 1750 | /** |
| 1751 | * Could not change Join Failure |
| 1752 | * timer. Log error. |
| 1753 | */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1754 | limLog(pMac, LOGP, FL("Unable to change timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1755 | return; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1756 | } |
| 1757 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1758 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1759 | case eLIM_DEAUTH_ACK_TIMER: |
| 1760 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer) != TX_SUCCESS) |
| 1761 | { |
| 1762 | /** |
| 1763 | ** Could not deactivate Join Failure |
| 1764 | ** timer. Log error. |
| 1765 | **/ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1766 | limLog(pMac, LOGP, FL("Unable to deactivate Deauth ack timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1767 | return; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1768 | } |
| 1769 | val = 1000; |
| 1770 | val = SYS_MS_TO_TICKS(val); |
| 1771 | if (tx_timer_change(&pMac->lim.limTimers.gLimDeauthAckTimer, |
| 1772 | val, 0) != TX_SUCCESS) |
| 1773 | { |
| 1774 | /** |
| 1775 | * Could not change Join Failure |
| 1776 | * timer. Log error. |
| 1777 | */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1778 | limLog(pMac, LOGP, FL("Unable to change timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1779 | return; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1780 | } |
| 1781 | break; |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1782 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1783 | case eLIM_INSERT_SINGLESHOT_NOA_TIMER: |
| 1784 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) != TX_SUCCESS) |
| 1785 | { |
| 1786 | /** |
| 1787 | ** Could not deactivate SingleShot NOA Insert |
| 1788 | ** timer. Log error. |
| 1789 | **/ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1790 | limLog(pMac, LOGP, FL("Unable to deactivate SingleShot NOA Insert timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1791 | return; |
| 1792 | } |
| 1793 | val = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE; |
| 1794 | val = SYS_MS_TO_TICKS(val); |
| 1795 | if (tx_timer_change(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer, |
| 1796 | val, 0) != TX_SUCCESS) |
| 1797 | { |
| 1798 | /** |
| 1799 | * Could not change Single Shot NOA Insert |
| 1800 | * timer. Log error. |
| 1801 | */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1802 | limLog(pMac, LOGP, FL("Unable to change timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1803 | return; |
| 1804 | } |
| 1805 | break; |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 1806 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1807 | default: |
| 1808 | // Invalid timerId. Log error |
| 1809 | break; |
| 1810 | } |
| 1811 | } /****** end limDeactivateAndChangeTimer() ******/ |
| 1812 | |
| 1813 | |
| 1814 | |
| 1815 | /**--------------------------------------------------------------- |
| 1816 | \fn limHeartBeatDeactivateAndChangeTimer |
| 1817 | \brief This function deactivates and changes the heart beat |
| 1818 | \ timer, eLIM_HEART_BEAT_TIMER. |
| 1819 | \ |
| 1820 | \param pMac |
| 1821 | \param psessionEntry |
| 1822 | \return None |
| 1823 | ------------------------------------------------------------------*/ |
| 1824 | void |
| 1825 | limHeartBeatDeactivateAndChangeTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1826 | { |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1827 | tANI_U32 val, val1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1828 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1829 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1830 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1831 | if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
| 1832 | return; |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1833 | #endif |
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 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer) != TX_SUCCESS) |
| 1836 | limLog(pMac, LOGP, FL("Fail to deactivate HeartBeatTimer ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1837 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1838 | /* HB Timer sessionisation: In case of 2 or more sessions, the HB interval keeps |
| 1839 | changing. to avoid this problem, HeartBeat interval is made constant, by |
| 1840 | 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] | 1841 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1842 | //val = psessionEntry->beaconParams.beaconInterval; |
| 1843 | val = LIM_HB_TIMER_BEACON_INTERVAL; |
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 | if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS) |
| 1846 | limLog(pMac, LOGP, FL("Fail to get WNI_CFG_HEART_BEAT_THRESHOLD ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1847 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1848 | PELOGW(limLog(pMac,LOGW, |
| 1849 | FL("HB Timer Int.=100ms * %d, Beacon Int.=%dms,Session Id=%d "), |
| 1850 | val1, psessionEntry->beaconParams.beaconInterval, |
| 1851 | psessionEntry->peSessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1852 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1853 | /* The HB timer timeout value of 4 seconds (40 beacon intervals) is not |
| 1854 | * enough to judge the peer device inactivity when 32 peers are connected. |
| 1855 | * Hence increasing the HB timer timeout to |
| 1856 | * HBtimeout = (TBTT * num_beacons * num_peers) |
| 1857 | */ |
| 1858 | if (eSIR_IBSS_MODE == psessionEntry->bssType && |
| 1859 | pMac->lim.gLimNumIbssPeers > 0) |
| 1860 | { |
Ravi Joshi | 92a4e14 | 2013-06-27 17:00:42 -0700 | [diff] [blame] | 1861 | val1 = val1 * pMac->lim.gLimNumIbssPeers; |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1862 | } |
Ravi Joshi | 92a4e14 | 2013-06-27 17:00:42 -0700 | [diff] [blame] | 1863 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1864 | // Change timer to reactivate it in future |
| 1865 | val = SYS_MS_TO_TICKS(val * val1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1866 | |
Ravi Joshi | d069950 | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 1867 | if (tx_timer_change(&pMac->lim.limTimers.gLimHeartBeatTimer, val, 0) != TX_SUCCESS) |
| 1868 | limLog(pMac, LOGP, FL("Fail to change HeartBeatTimer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1869 | |
| 1870 | } /****** end limHeartBeatDeactivateAndChangeTimer() ******/ |
| 1871 | |
| 1872 | |
| 1873 | /**--------------------------------------------------------------- |
| 1874 | \fn limReactivateHeartBeatTimer |
| 1875 | \brief This function s called to deactivate, change and |
| 1876 | \ activate a timer. |
| 1877 | \ |
| 1878 | \param pMac - Pointer to Global MAC structure |
| 1879 | \param psessionEntry |
| 1880 | \return None |
| 1881 | ------------------------------------------------------------------*/ |
| 1882 | void |
| 1883 | limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1884 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1885 | PELOG3(limLog(pMac, LOG3, FL("Rxed Heartbeat. Count=%d"), psessionEntry->LimRxedBeaconCntDuringHB);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1886 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1887 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 1888 | if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
Srinivas Girigowda | 35f6a71 | 2013-04-04 16:48:34 -0700 | [diff] [blame] | 1889 | { |
| 1890 | 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] | 1891 | return; |
Srinivas Girigowda | 35f6a71 | 2013-04-04 16:48:34 -0700 | [diff] [blame] | 1892 | } |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1893 | #endif |
| 1894 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1895 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1896 | 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] | 1897 | |
| 1898 | //only start the hearbeat-timer if the timeout value is non-zero |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 1899 | if(pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs > 0) |
| 1900 | { |
| 1901 | /* |
| 1902 | * There is increasing need to limit the apps wakeup due to WLAN |
| 1903 | * activity. During HB monitoring, the beacons from peer are sent to |
| 1904 | * the host causing the host to wakeup. Hence, offloading the HB |
| 1905 | * monitoring to LMAC |
| 1906 | */ |
| 1907 | if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE && |
| 1908 | IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE) |
| 1909 | { |
| 1910 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS) |
| 1911 | { |
| 1912 | limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer")); |
| 1913 | } |
| 1914 | else |
| 1915 | { |
| 1916 | limLog(pMac, LOGE, FL("IBSS HeartBeat Offloaded, Deactivated heartbeat link monitoring")); |
| 1917 | } |
| 1918 | } |
| 1919 | else |
| 1920 | { |
| 1921 | if (tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS) |
| 1922 | { |
| 1923 | limLog(pMac, LOGP,FL("could not activate Heartbeat timer")); |
| 1924 | } |
| 1925 | else |
| 1926 | { |
| 1927 | limLog(pMac, LOGW, FL("Reactivated heartbeat link monitoring")); |
| 1928 | } |
| 1929 | } |
| 1930 | limResetHBPktCount(psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1931 | } |
| 1932 | |
| 1933 | } /****** end limReactivateHeartBeatTimer() ******/ |
| 1934 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1935 | |
| 1936 | /** |
| 1937 | * limActivateHearBeatTimer() |
| 1938 | * |
| 1939 | * |
| 1940 | * @brief: This function is called to activate heartbeat timer |
| 1941 | * |
| 1942 | *LOGIC: |
| 1943 | * |
| 1944 | *ASSUMPTIONS: |
| 1945 | * NA |
| 1946 | * |
| 1947 | * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index. |
| 1948 | * |
| 1949 | * @param pMac - Pointer to Global MAC structure |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 1950 | * @param psessionEntry - Session Entry |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1951 | * |
| 1952 | * @return TX_SUCCESS - timer is activated |
| 1953 | * errors - fail to start the timer |
| 1954 | */ |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 1955 | v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1956 | { |
| 1957 | v_UINT_t status = TX_TIMER_ERROR; |
| 1958 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1959 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 1960 | if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
Ravi Joshi | f7fe8d3 | 2013-09-21 17:02:11 -0700 | [diff] [blame] | 1961 | return (TX_SUCCESS); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1962 | #endif |
| 1963 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1964 | if(TX_AIRGO_TMR_SIGNATURE == pMac->lim.limTimers.gLimHeartBeatTimer.tmrSignature) |
| 1965 | { |
| 1966 | //consider 0 interval a ok case |
| 1967 | if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs ) |
| 1968 | { |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 1969 | if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE && |
| 1970 | IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE) |
| 1971 | { |
| 1972 | /* HB offload in IBSS mode */ |
| 1973 | status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1974 | if (TX_SUCCESS != status) |
| 1975 | { |
| 1976 | PELOGE(limLog(pMac, LOGE, |
| 1977 | FL("IBSS HB Offload, Could not deactivate HB timer status(%d)"), |
| 1978 | status);) |
| 1979 | } |
| 1980 | else |
| 1981 | { |
| 1982 | PELOGE(limLog(pMac, LOGE, |
| 1983 | FL("%s] IBSS HB Offloaded, Heartbeat timer deactivated"), |
| 1984 | __func__);) |
| 1985 | } |
| 1986 | |
| 1987 | } |
| 1988 | else |
| 1989 | { |
| 1990 | status = tx_timer_activate(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1991 | if ( TX_SUCCESS != status ) |
| 1992 | { |
| 1993 | PELOGE(limLog(pMac, LOGE, |
| 1994 | FL("could not activate Heartbeat timer status(%d)"), status);) |
| 1995 | } |
| 1996 | else |
| 1997 | { |
| 1998 | PELOGE(limLog(pMac, LOGW, |
| 1999 | FL("%s] Activated Heartbeat timer status(%d)"), __func__, status);) |
| 2000 | } |
| 2001 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2002 | } |
| 2003 | else |
| 2004 | { |
| 2005 | status = TX_SUCCESS; |
| 2006 | } |
| 2007 | } |
| 2008 | |
| 2009 | return (status); |
| 2010 | } |
| 2011 | |
| 2012 | |
| 2013 | |
| 2014 | /** |
| 2015 | * limDeactivateAndChangePerStaIdTimer() |
| 2016 | * |
| 2017 | * |
| 2018 | * @brief: This function is called to deactivate and change a per STA timer |
| 2019 | * for future re-activation |
| 2020 | * |
| 2021 | *LOGIC: |
| 2022 | * |
| 2023 | *ASSUMPTIONS: |
| 2024 | * NA |
| 2025 | * |
| 2026 | * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index. |
| 2027 | * |
| 2028 | * @param pMac - Pointer to Global MAC structure |
| 2029 | * @param timerId - enum of timer to be deactivated and changed |
| 2030 | * This enum is defined in limUtils.h file |
| 2031 | * @param staId - staId |
| 2032 | * |
| 2033 | * @return None |
| 2034 | */ |
| 2035 | |
| 2036 | void |
| 2037 | limDeactivateAndChangePerStaIdTimer(tpAniSirGlobal pMac, tANI_U32 timerId, tANI_U16 staId) |
| 2038 | { |
| 2039 | tANI_U32 val; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2040 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, timerId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2041 | |
| 2042 | switch (timerId) |
| 2043 | { |
| 2044 | case eLIM_CNF_WAIT_TIMER: |
| 2045 | |
| 2046 | if (tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
| 2047 | != TX_SUCCESS) |
| 2048 | { |
| 2049 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2050 | FL("unable to deactivate CNF wait timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2051 | |
| 2052 | } |
| 2053 | |
| 2054 | // Change timer to reactivate it in future |
| 2055 | |
| 2056 | if (wlan_cfgGetInt(pMac, WNI_CFG_WT_CNF_TIMEOUT, |
| 2057 | &val) != eSIR_SUCCESS) |
| 2058 | { |
| 2059 | /** |
| 2060 | * Could not get cnf timeout value |
| 2061 | * from CFG. Log error. |
| 2062 | */ |
| 2063 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2064 | FL("could not retrieve cnf timeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2065 | } |
| 2066 | val = SYS_MS_TO_TICKS(val); |
| 2067 | |
| 2068 | if (tx_timer_change(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId], |
| 2069 | val, val) != TX_SUCCESS) |
| 2070 | { |
| 2071 | // Could not change cnf timer. |
| 2072 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2073 | limLog(pMac, LOGP, FL("unable to change cnf wait timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2074 | } |
| 2075 | |
| 2076 | break; |
| 2077 | |
| 2078 | case eLIM_AUTH_RSP_TIMER: |
| 2079 | { |
| 2080 | tLimPreAuthNode *pAuthNode; |
| 2081 | |
| 2082 | pAuthNode = limGetPreAuthNodeFromIndex(pMac, &pMac->lim.gLimPreAuthTimerTable, staId); |
| 2083 | |
| 2084 | if (pAuthNode == NULL) |
| 2085 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2086 | limLog(pMac, LOGP, FL("Invalid Pre Auth Index passed :%d"), staId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2087 | break; |
| 2088 | } |
| 2089 | |
| 2090 | if (tx_timer_deactivate(&pAuthNode->timer) != TX_SUCCESS) |
| 2091 | { |
| 2092 | // Could not deactivate auth response timer. |
| 2093 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2094 | limLog(pMac, LOGP, FL("unable to deactivate auth response timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2095 | } |
| 2096 | |
| 2097 | // Change timer to reactivate it in future |
| 2098 | |
| 2099 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, &val) != eSIR_SUCCESS) |
| 2100 | { |
| 2101 | /** |
| 2102 | * Could not get auth rsp timeout value |
| 2103 | * from CFG. Log error. |
| 2104 | */ |
| 2105 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2106 | FL("could not retrieve auth response timeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2107 | } |
| 2108 | |
| 2109 | val = SYS_MS_TO_TICKS(val); |
| 2110 | |
| 2111 | if (tx_timer_change(&pAuthNode->timer, val, 0) != TX_SUCCESS) |
| 2112 | { |
| 2113 | // Could not change auth rsp timer. |
| 2114 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2115 | limLog(pMac, LOGP, FL("unable to change auth rsp timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2116 | } |
| 2117 | } |
| 2118 | break; |
| 2119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2120 | |
| 2121 | default: |
| 2122 | // Invalid timerId. Log error |
| 2123 | break; |
| 2124 | |
| 2125 | } |
| 2126 | } |
| 2127 | |
| 2128 | |
| 2129 | /** |
| 2130 | * limActivateCnfTimer() |
| 2131 | * |
| 2132 | *FUNCTION: |
| 2133 | * This function is called to activate a per STA timer |
| 2134 | * |
| 2135 | *LOGIC: |
| 2136 | * |
| 2137 | *ASSUMPTIONS: |
| 2138 | * NA |
| 2139 | * |
| 2140 | *NOTE: |
| 2141 | * NA |
| 2142 | * |
| 2143 | * @param pMac - Pointer to Global MAC structure |
| 2144 | * @param StaId - staId |
| 2145 | * |
| 2146 | * @return None |
| 2147 | */ |
| 2148 | |
| 2149 | void limActivateCnfTimer(tpAniSirGlobal pMac, tANI_U16 staId, tpPESession psessionEntry) |
| 2150 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2151 | 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] | 2152 | pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = psessionEntry->peSessionId; |
| 2153 | if (tx_timer_activate(&pMac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
| 2154 | != TX_SUCCESS) |
| 2155 | { |
| 2156 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2157 | FL("could not activate cnf wait timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2158 | } |
| 2159 | } |
| 2160 | |
| 2161 | /** |
| 2162 | * limActivateAuthRspTimer() |
| 2163 | * |
| 2164 | *FUNCTION: |
| 2165 | * This function is called to activate a per STA timer |
| 2166 | * |
| 2167 | *LOGIC: |
| 2168 | * |
| 2169 | *ASSUMPTIONS: |
| 2170 | * NA |
| 2171 | * |
| 2172 | *NOTE: |
| 2173 | * NA |
| 2174 | * |
| 2175 | * @param pMac - Pointer to Global MAC structure |
| 2176 | * @param id - id |
| 2177 | * |
| 2178 | * @return None |
| 2179 | */ |
| 2180 | |
| 2181 | void limActivateAuthRspTimer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode) |
| 2182 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2183 | 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] | 2184 | if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS) |
| 2185 | { |
| 2186 | /// Could not activate auth rsp timer. |
| 2187 | // Log error |
| 2188 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2189 | FL("could not activate auth rsp timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2190 | } |
| 2191 | } |
| 2192 | |
| 2193 | |
| 2194 | /** |
| 2195 | * limSendDisassocFrameThresholdHandler() |
| 2196 | * |
| 2197 | *FUNCTION: |
| 2198 | * This function reloads the credit to the send disassociate frame bucket |
| 2199 | * |
| 2200 | *LOGIC: |
| 2201 | * |
| 2202 | *ASSUMPTIONS: |
| 2203 | * |
| 2204 | *NOTE: |
| 2205 | * NA |
| 2206 | * |
| 2207 | * @param |
| 2208 | * |
| 2209 | * @return None |
| 2210 | */ |
| 2211 | |
| 2212 | void |
| 2213 | limSendDisassocFrameThresholdHandler(void *pMacGlobal, tANI_U32 param) |
| 2214 | { |
| 2215 | tSirMsgQ msg; |
| 2216 | tANI_U32 statusCode; |
| 2217 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2218 | |
| 2219 | msg.type = SIR_LIM_HASH_MISS_THRES_TIMEOUT; |
| 2220 | msg.bodyval = 0; |
| 2221 | msg.bodyptr = NULL; |
| 2222 | |
| 2223 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2224 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2225 | FL("posting to LIM failed, reason=%d"), statusCode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2226 | |
| 2227 | } |
| 2228 | |
| 2229 | /** |
| 2230 | * limAssocCnfWaitTmerHandler() |
| 2231 | * |
| 2232 | *FUNCTION: |
| 2233 | * This function post a message to send a disassociate frame out. |
| 2234 | * |
| 2235 | *LOGIC: |
| 2236 | * |
| 2237 | *ASSUMPTIONS: |
| 2238 | * |
| 2239 | *NOTE: |
| 2240 | * NA |
| 2241 | * |
| 2242 | * @param |
| 2243 | * |
| 2244 | * @return None |
| 2245 | */ |
| 2246 | |
| 2247 | void |
| 2248 | limCnfWaitTmerHandler(void *pMacGlobal, tANI_U32 param) |
| 2249 | { |
| 2250 | tSirMsgQ msg; |
| 2251 | tANI_U32 statusCode; |
| 2252 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2253 | |
| 2254 | msg.type = SIR_LIM_CNF_WAIT_TIMEOUT; |
| 2255 | msg.bodyval = (tANI_U32)param; |
| 2256 | msg.bodyptr = NULL; |
| 2257 | |
| 2258 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2259 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2260 | FL("posting to LIM failed, reason=%d"), statusCode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2261 | |
| 2262 | } |
| 2263 | |
| 2264 | /** |
| 2265 | * limKeepaliveTmerHandler() |
| 2266 | * |
| 2267 | *FUNCTION: |
| 2268 | * This function post a message to send a NULL data frame. |
| 2269 | * |
| 2270 | *LOGIC: |
| 2271 | * |
| 2272 | *ASSUMPTIONS: |
| 2273 | * |
| 2274 | *NOTE: |
| 2275 | * NA |
| 2276 | * |
| 2277 | * @param |
| 2278 | * |
| 2279 | * @return None |
| 2280 | */ |
| 2281 | |
| 2282 | void |
| 2283 | limKeepaliveTmerHandler(void *pMacGlobal, tANI_U32 param) |
| 2284 | { |
| 2285 | tSirMsgQ msg; |
| 2286 | tANI_U32 statusCode; |
| 2287 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2288 | |
| 2289 | msg.type = SIR_LIM_KEEPALIVE_TIMEOUT; |
| 2290 | msg.bodyval = (tANI_U32)param; |
| 2291 | msg.bodyptr = NULL; |
| 2292 | |
| 2293 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2294 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2295 | FL("posting to LIM failed, reason=%d"), statusCode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2296 | |
| 2297 | } |
| 2298 | |
| 2299 | void |
| 2300 | limChannelSwitchTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2301 | { |
| 2302 | tSirMsgQ msg; |
| 2303 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2304 | |
| 2305 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2306 | FL("ChannelSwitch Timer expired. Posting msg to LIM "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2307 | |
| 2308 | msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT; |
| 2309 | msg.bodyval = (tANI_U32)param; |
| 2310 | msg.bodyptr = NULL; |
| 2311 | |
| 2312 | limPostMsgApi(pMac, &msg); |
| 2313 | } |
| 2314 | |
| 2315 | void |
| 2316 | limQuietTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2317 | { |
| 2318 | tSirMsgQ msg; |
| 2319 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2320 | |
| 2321 | msg.type = SIR_LIM_QUIET_TIMEOUT; |
| 2322 | msg.bodyval = (tANI_U32)param; |
| 2323 | msg.bodyptr = NULL; |
| 2324 | |
| 2325 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2326 | FL("Post SIR_LIM_QUIET_TIMEOUT msg. "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2327 | limPostMsgApi(pMac, &msg); |
| 2328 | } |
| 2329 | |
| 2330 | void |
| 2331 | limQuietBssTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2332 | { |
| 2333 | tSirMsgQ msg; |
| 2334 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2335 | |
| 2336 | msg.type = SIR_LIM_QUIET_BSS_TIMEOUT; |
| 2337 | msg.bodyval = (tANI_U32)param; |
| 2338 | msg.bodyptr = NULL; |
| 2339 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2340 | FL("Post SIR_LIM_QUIET_BSS_TIMEOUT msg. "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2341 | limPostMsgApi(pMac, &msg); |
| 2342 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2343 | #if 0 |
| 2344 | void |
| 2345 | limWPSOverlapTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 2346 | { |
| 2347 | tSirMsgQ msg; |
| 2348 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2349 | |
| 2350 | msg.type = SIR_LIM_WPS_OVERLAP_TIMEOUT; |
| 2351 | msg.bodyval = (tANI_U32)param; |
| 2352 | msg.bodyptr = NULL; |
| 2353 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2354 | FL("Post SIR_LIM_WPS_OVERLAP_TIMEOUT msg. "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2355 | limPostMsgApi(pMac, &msg); |
| 2356 | } |
| 2357 | #endif |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2358 | |
| 2359 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 2360 | /* ACTIVE_MODE_HB_OFFLOAD */ |
| 2361 | /** |
| 2362 | * limMissedBeaconInActiveMode() |
| 2363 | * |
| 2364 | *FUNCTION: |
| 2365 | * This function handle beacon miss indication from FW |
| 2366 | * in Active mode. |
| 2367 | * |
| 2368 | *LOGIC: |
| 2369 | * |
| 2370 | *ASSUMPTIONS: |
| 2371 | * NA |
| 2372 | * |
| 2373 | *NOTE: |
| 2374 | * NA |
| 2375 | * |
| 2376 | * @param param - Msg Type |
| 2377 | * |
| 2378 | * @return None |
| 2379 | */ |
| 2380 | void |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 2381 | limMissedBeaconInActiveMode(void *pMacGlobal, tpPESession psessionEntry) |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2382 | { |
| 2383 | tANI_U32 statusCode; |
| 2384 | tSirMsgQ msg; |
| 2385 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 2386 | |
| 2387 | // Prepare and post message to LIM Message Queue |
| 2388 | if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 2389 | { |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2390 | 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] | 2391 | msg.bodyptr = psessionEntry; |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2392 | msg.bodyval = 0; |
| 2393 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2394 | FL("Heartbeat failure from Riva")); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2395 | if ((statusCode = limPostMsgApi(pMac, &msg)) != eSIR_SUCCESS) |
| 2396 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2397 | FL("posting message %X to LIM failed, reason=%d"), |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2398 | msg.type, statusCode); |
| 2399 | } |
| 2400 | } |
| 2401 | #endif |