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