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