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