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