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