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