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