Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Yeshwanth Sriram Guntuka | a396161 | 2018-01-04 14:24:50 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015, 2018 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limProcessCfgUpdates.cc contains the utility functions |
| 30 | * to handle various CFG parameter update events |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 01/20/03 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | */ |
| 37 | |
| 38 | #include "aniGlobal.h" |
| 39 | |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 40 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | #include "sirMacProtDef.h" |
| 42 | #include "cfgApi.h" |
| 43 | #include "limTypes.h" |
| 44 | #include "limUtils.h" |
| 45 | #include "limPropExtsUtils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | #include "schApi.h" |
| 47 | #include "pmmApi.h" |
| 48 | #if defined WLAN_FEATURE_VOWIFI |
| 49 | #include "rrmApi.h" |
| 50 | #endif |
| 51 | |
| 52 | static void limUpdateConfig(tpAniSirGlobal pMac,tpPESession psessionEntry); |
| 53 | |
| 54 | #if 0 |
| 55 | /** |
| 56 | * limGetCfgIdOfDefaultKeyid() |
| 57 | * |
| 58 | *FUNCTION: |
| 59 | * This function is called to get CFG ID of default key id |
| 60 | * |
| 61 | *PARAMS: |
| 62 | * |
| 63 | *LOGIC: |
| 64 | * |
| 65 | *ASSUMPTIONS: |
| 66 | * NA |
| 67 | * |
| 68 | *NOTE: |
| 69 | * NA |
| 70 | * |
| 71 | * @param dkid - Value of default key id |
| 72 | * @return dkCfgId - CFG ID of key corresponding to default key Id |
| 73 | */ |
| 74 | |
| 75 | static tANI_U32 |
| 76 | limGetCfgIdOfDefaultKeyid(tANI_U32 dkid) |
| 77 | { |
| 78 | if (dkid == WNI_CFG_WEP_DEFAULT_KEYID_0) |
| 79 | return WNI_CFG_WEP_DEFAULT_KEY_1; |
| 80 | else if (dkid == WNI_CFG_WEP_DEFAULT_KEYID_1) |
| 81 | return WNI_CFG_WEP_DEFAULT_KEY_2; |
| 82 | else if (dkid == WNI_CFG_WEP_DEFAULT_KEYID_2) |
| 83 | return WNI_CFG_WEP_DEFAULT_KEY_3; |
| 84 | else // dkid == WNI_CFG_WEP_DEFAULT_KEYID_3 |
| 85 | return WNI_CFG_WEP_DEFAULT_KEY_4; |
| 86 | } /*** end limGetCfgIdOfDefaultKeyid() ***/ |
| 87 | #endif |
| 88 | |
| 89 | |
| 90 | /** |
| 91 | * limSetDefaultKeyIdAndKeys() |
| 92 | * |
| 93 | *FUNCTION: |
| 94 | * This function is called while applying configuration |
| 95 | * during JOIN/REASSOC/START_BSS. |
| 96 | * |
| 97 | *PARAMS: |
| 98 | * |
| 99 | *LOGIC: |
| 100 | * |
| 101 | *ASSUMPTIONS: |
| 102 | * NA |
| 103 | * |
| 104 | *NOTE: |
| 105 | * |
| 106 | * @param pMac - Pointer to Global MAC structure |
| 107 | * @return None |
| 108 | */ |
| 109 | |
| 110 | static void |
| 111 | limSetDefaultKeyIdAndKeys(tpAniSirGlobal pMac) |
| 112 | { |
| 113 | #ifdef FIXME_GEN6 |
| 114 | tANI_U32 val; |
| 115 | tANI_U32 dkCfgId; |
| 116 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 117 | PELOG1(limLog(pMac, LOG1, FL("Setting default keys at SP"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 118 | |
| 119 | if (wlan_cfgGetInt(pMac, WNI_CFG_WEP_DEFAULT_KEYID, |
| 120 | &val) != eSIR_SUCCESS) |
| 121 | { |
| 122 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 123 | FL("Unable to retrieve defaultKeyId from CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 124 | } |
| 125 | dkCfgId = limGetCfgIdOfDefaultKeyid(val); |
| 126 | #endif |
| 127 | |
| 128 | } /*** end limSetDefaultKeyIdAndKeys() ***/ |
| 129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | /** ------------------------------------------------------------- |
| 131 | \fn limSetCfgProtection |
| 132 | \brief sets lim global cfg cache from the config. |
| 133 | \param tpAniSirGlobal pMac |
| 134 | \return None |
| 135 | -------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 136 | void limSetCfgProtection(tpAniSirGlobal pMac, tpPESession pesessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 137 | { |
| 138 | tANI_U32 val = 0; |
| 139 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 140 | if(( pesessionEntry != NULL ) && (pesessionEntry->limSystemRole == eLIM_AP_ROLE )){ |
| 141 | if (pesessionEntry->gLimProtectionControl == WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE ) |
Hema Aparna Medicharla | eef78fc | 2013-07-12 11:47:01 +0530 | [diff] [blame] | 142 | vos_mem_set((void *)&pesessionEntry->cfgProtection, sizeof(tCfgProtection), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 143 | else{ |
| 144 | limLog(pMac, LOG1, FL(" frm11a = %d, from11b = %d, frm11g = %d, " |
| 145 | "ht20 = %d, nongf = %d, lsigTxop = %d, " |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 146 | "rifs = %d, obss = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 147 | pesessionEntry->cfgProtection.fromlla, |
| 148 | pesessionEntry->cfgProtection.fromllb, |
| 149 | pesessionEntry->cfgProtection.fromllg, |
| 150 | pesessionEntry->cfgProtection.ht20, |
| 151 | pesessionEntry->cfgProtection.nonGf, |
| 152 | pesessionEntry->cfgProtection.lsigTxop, |
| 153 | pesessionEntry->cfgProtection.rifs, |
| 154 | pesessionEntry->cfgProtection.obss); |
| 155 | } |
| 156 | } |
| 157 | else{ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 158 | if (wlan_cfgGetInt(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, &val) != eSIR_SUCCESS) |
| 159 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 160 | limLog(pMac, LOGP, FL("reading WNI_CFG_FORCE_POLICY_PROTECTION cfg failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 161 | return; |
| 162 | } |
| 163 | else |
| 164 | pMac->lim.gLimProtectionControl = (tANI_U8)val; |
| 165 | |
| 166 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROTECTION_ENABLED, &val) != eSIR_SUCCESS) |
| 167 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 168 | limLog(pMac, LOGP, FL("reading protection cfg failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 169 | return; |
| 170 | } |
| 171 | |
Hema Aparna Medicharla | eef78fc | 2013-07-12 11:47:01 +0530 | [diff] [blame] | 172 | if (pMac->lim.gLimProtectionControl == WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 173 | vos_mem_set((void *)&pMac->lim.cfgProtection, sizeof(tCfgProtection), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 174 | else |
| 175 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 176 | pMac->lim.cfgProtection.fromlla = (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llA) & 1; |
| 177 | pMac->lim.cfgProtection.fromllb = (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llB) & 1; |
| 178 | pMac->lim.cfgProtection.fromllg = (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llG) & 1; |
| 179 | pMac->lim.cfgProtection.ht20 = (val >> WNI_CFG_PROTECTION_ENABLED_HT_20) & 1; |
| 180 | pMac->lim.cfgProtection.nonGf = (val >> WNI_CFG_PROTECTION_ENABLED_NON_GF) & 1; |
| 181 | pMac->lim.cfgProtection.lsigTxop = (val >> WNI_CFG_PROTECTION_ENABLED_LSIG_TXOP) & 1; |
| 182 | pMac->lim.cfgProtection.rifs = (val >> WNI_CFG_PROTECTION_ENABLED_RIFS) & 1; |
| 183 | pMac->lim.cfgProtection.obss= (val >> WNI_CFG_PROTECTION_ENABLED_OBSS) & 1; |
| 184 | |
| 185 | } |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 186 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | |
| 190 | |
| 191 | /** |
| 192 | * limUpdateTriggerStaBkScanFlag |
| 193 | * |
| 194 | * FUNCTION: |
| 195 | * This function updates the lim global gLimTriggerBackgroundScanDuringQuietBss |
| 196 | * based on cfg configuration. Usually triggered after a cfgSetInt call. |
| 197 | * |
| 198 | * PARAMS: |
| 199 | * pMac - Pointer to Global MAC structure |
| 200 | * |
| 201 | */ |
| 202 | static tSirRetStatus limUpdateTriggerStaBkScanFlag(tpAniSirGlobal pMac) |
| 203 | { |
| 204 | tANI_U32 val; |
| 205 | tANI_U8 flag; |
| 206 | |
| 207 | if(wlan_cfgGetInt(pMac, WNI_CFG_TRIG_STA_BK_SCAN, &val) != eSIR_SUCCESS) |
| 208 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 209 | PELOG1(limLog(pMac, LOG1, FL("Failed to get WNI_CFG_TRIG_STA_BK_SCAN from cfg"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 210 | return eSIR_FAILURE; |
| 211 | } |
| 212 | |
| 213 | flag = (val) ? 1 : 0; |
| 214 | if(flag != pMac->lim.gLimTriggerBackgroundScanDuringQuietBss) |
| 215 | { |
| 216 | /* Update global flag */ |
| 217 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = flag; |
| 218 | /*Update beacon prop IE also if we're an AP */ |
| 219 | |
| 220 | //call a wrapper and if the session role is other than the sta call this function schsetfixedbeacon fields function |
| 221 | limUpdateBeacon(pMac); |
| 222 | |
| 223 | } |
| 224 | |
| 225 | return eSIR_FAILURE; |
| 226 | } |
| 227 | |
| 228 | |
| 229 | /** |
| 230 | * limHandleCFGparamUpdate() |
| 231 | * |
| 232 | *FUNCTION: |
| 233 | * This function is called by limProcessMessages() to |
| 234 | * whenever SIR_CFG_PARAM_UPDATE_IND message is posted |
| 235 | * to LIM (due to a set operation on a CFG parameter). |
| 236 | * |
| 237 | *PARAMS: |
| 238 | * |
| 239 | *LOGIC: |
| 240 | * |
| 241 | *ASSUMPTIONS: |
| 242 | * NA |
| 243 | * |
| 244 | *NOTE: |
| 245 | * |
| 246 | * @param pMac - Pointer to Global MAC structure |
| 247 | * @param cfgId - ID of CFG parameter that got updated |
| 248 | * @return None |
| 249 | */ |
| 250 | |
| 251 | void |
| 252 | limHandleCFGparamUpdate(tpAniSirGlobal pMac, tANI_U32 cfgId) |
| 253 | { |
| 254 | tANI_U32 val1, val2; |
| 255 | tANI_U16 val16; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | tSirMacHTCapabilityInfo *pHTCapabilityInfo; |
| 257 | tSirMacHTParametersInfo *pAmpduParamInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 258 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 259 | PELOG3(limLog(pMac, LOG3, FL("Handling CFG parameter id %X update"), cfgId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 260 | switch (cfgId) |
| 261 | { |
| 262 | case WNI_CFG_WEP_DEFAULT_KEYID: |
| 263 | |
| 264 | // !!LAC - when the default KeyID is changed, force all of the |
| 265 | // keys and the keyID to be reprogrammed. this allows the |
| 266 | // keys to change after the initial setting of the keys when the CFG was |
| 267 | // applied at association time through CFG changes of the keys. |
| 268 | limSetDefaultKeyIdAndKeys( pMac ); |
| 269 | |
| 270 | break; |
| 271 | |
| 272 | case WNI_CFG_EXCLUDE_UNENCRYPTED: |
| 273 | if (wlan_cfgGetInt(pMac, WNI_CFG_EXCLUDE_UNENCRYPTED, |
| 274 | &val1) != eSIR_SUCCESS) |
| 275 | { |
| 276 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 277 | FL("Unable to retrieve excludeUnencr from CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | } |
| 279 | #if 0 |
| 280 | halSetSpExclUndecrypted(pMac, (tHalBitVal) val); |
| 281 | #else |
| 282 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 283 | FL("Unsupported CFG: WNI_CFG_EXCLUDE_UNENCRYPTED")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 284 | #endif |
| 285 | |
| 286 | break; |
| 287 | |
| 288 | case WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT: |
| 289 | if (pMac->lim.gLimMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) |
| 290 | { |
| 291 | // 'Change' timer for future activations |
| 292 | limDeactivateAndChangeTimer(pMac, |
| 293 | eLIM_ASSOC_FAIL_TIMER); |
| 294 | } |
| 295 | |
| 296 | break; |
| 297 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 298 | case WNI_CFG_BACKGROUND_SCAN_PERIOD: |
| 299 | |
| 300 | |
| 301 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
| 302 | |
| 303 | if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, &val1) != eSIR_SUCCESS) |
| 304 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 305 | limLog(pMac, LOGP, FL("could not retrieve Background scan period value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | break; |
| 307 | } |
| 308 | if (val1 == 0) |
| 309 | break; |
| 310 | |
| 311 | |
| 312 | |
| 313 | if ( (pMac->lim.gLimSystemRole == eLIM_STA_ROLE) || |
| 314 | ( (pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE) && |
| 315 | (pMac->lim.gLimSmeState == eLIM_SME_NORMAL_STATE))) |
| 316 | { |
| 317 | // Reactivate Background scan timer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 318 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_BACKGROUND_SCAN_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 319 | if (tx_timer_activate( |
| 320 | &pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
| 321 | { |
| 322 | /// Could not activate background scan timer. |
| 323 | // Log error |
| 324 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 325 | FL("could not activate background scan timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 326 | pMac->lim.gLimBackgroundScanStarted = FALSE; |
| 327 | pMac->lim.gLimBackgroundScanTerminate = TRUE; |
| 328 | } |
| 329 | else |
| 330 | { |
| 331 | pMac->lim.gLimBackgroundScanStarted = TRUE; |
| 332 | pMac->lim.gLimBackgroundScanTerminate = FALSE; |
| 333 | } |
| 334 | |
| 335 | PELOG3(limLog(pMac, LOG3, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 336 | FL("Updated Background scan period"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 340 | |
| 341 | case WNI_CFG_BG_SCAN_CHANNEL_LIST: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 342 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 343 | FL("VALID_CHANNEL_LIST has changed, reset next bg scan channel"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 344 | pMac->lim.gLimBackgroundScanChannelId = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | |
| 346 | break; |
| 347 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 348 | case WNI_CFG_TRIG_STA_BK_SCAN: |
| 349 | if(limUpdateTriggerStaBkScanFlag(pMac) != eSIR_SUCCESS) |
| 350 | { |
| 351 | PELOG2(limLog(pMac, LOG2, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 352 | FL("Updating lim trigger sta bk scan global flag failed!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 353 | } |
| 354 | break; |
| 355 | |
| 356 | case WNI_CFG_PROTECTION_ENABLED: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | limSetCfgProtection(pMac, NULL); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 358 | break; |
| 359 | case WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG: |
| 360 | { |
| 361 | tSirMsgQ msg = {0}; |
| 362 | tANI_U32 status; |
| 363 | |
| 364 | msg.type = SIR_LIM_UPDATE_BEACON; |
| 365 | |
| 366 | status = limPostMsgApi(pMac, &msg); |
| 367 | |
| 368 | if (status != TX_SUCCESS) |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 369 | PELOGE(limLog(pMac, LOGE, FL("Failed limPostMsgApi %u"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 370 | break; |
| 371 | } |
| 372 | case WNI_CFG_GREENFIELD_CAPABILITY: |
| 373 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) |
| 374 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 375 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 376 | break; |
| 377 | } |
| 378 | if (wlan_cfgGetInt(pMac, WNI_CFG_GREENFIELD_CAPABILITY, &val2) != eSIR_SUCCESS) |
| 379 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 380 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve GreenField CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 381 | break; |
| 382 | } |
| 383 | val16 = ( tANI_U16 ) val1; |
| 384 | pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16; |
| 385 | pHTCapabilityInfo->greenField = (tANI_U16)val2; |
| 386 | if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 387 | PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | break; |
| 389 | |
| 390 | case WNI_CFG_HT_RX_STBC: |
| 391 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) |
| 392 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 393 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve WNI_CFG_HT_CAP_INFO "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 394 | break; |
| 395 | } |
| 396 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_RX_STBC, &val2) != eSIR_SUCCESS) |
| 397 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 398 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve WNI_CFG_HT_RX_STBC"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 399 | break; |
| 400 | } |
| 401 | val16 = ( tANI_U16 ) val1; |
| 402 | pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16; |
| 403 | pHTCapabilityInfo->rxSTBC = (tANI_U16)val2; |
| 404 | if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 405 | PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | break; |
| 407 | |
| 408 | case WNI_CFG_MAX_AMSDU_LENGTH: |
| 409 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) |
| 410 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 411 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 412 | break; |
| 413 | } |
| 414 | if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_AMSDU_LENGTH, &val2) != eSIR_SUCCESS) |
| 415 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 416 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max AMSDU Length CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 417 | break; |
| 418 | } |
| 419 | val16 = ( tANI_U16 ) val1; |
| 420 | pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16; |
| 421 | pHTCapabilityInfo->maximalAMSDUsize = (tANI_U16)val2; |
| 422 | if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 423 | PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 424 | break; |
| 425 | |
| 426 | case WNI_CFG_SHORT_GI_20MHZ: |
| 427 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) |
| 428 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 429 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT Cap CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 430 | break; |
| 431 | } |
| 432 | if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) != eSIR_SUCCESS) |
| 433 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 434 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 20Mhz CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 435 | break; |
| 436 | } |
| 437 | val16 = ( tANI_U16 ) val1; |
| 438 | pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16; |
| 439 | pHTCapabilityInfo->shortGI20MHz = (tANI_U16)val2; |
| 440 | if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 441 | PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 442 | break; |
| 443 | case WNI_CFG_SHORT_GI_40MHZ: |
| 444 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) |
| 445 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 446 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT Cap CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 447 | break; |
| 448 | } |
| 449 | if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_GI_40MHZ, &val2) != eSIR_SUCCESS) |
| 450 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 451 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 40Mhz CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 452 | break; |
| 453 | } |
| 454 | val16 = ( tANI_U16 ) val1; |
| 455 | pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16; |
| 456 | pHTCapabilityInfo->shortGI40MHz = (tANI_U16)val2; |
| 457 | if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 458 | PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 459 | break; |
| 460 | case WNI_CFG_MPDU_DENSITY: |
| 461 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != eSIR_SUCCESS) |
| 462 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 463 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT AMPDU Param CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 464 | break; |
| 465 | } |
| 466 | if (wlan_cfgGetInt(pMac, WNI_CFG_MPDU_DENSITY, &val2) != eSIR_SUCCESS) |
| 467 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 468 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve MPDU Density CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 469 | break; |
| 470 | } |
| 471 | val16 = ( tANI_U16 ) val1; |
| 472 | pAmpduParamInfo = ( tSirMacHTParametersInfo* ) &val16; |
| 473 | pAmpduParamInfo->mpduDensity = (tANI_U8)val2; |
| 474 | if(cfgSetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, *(tANI_U8*)pAmpduParamInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 475 | PELOGE(limLog(pMac, LOGE, FL("could not update HT AMPDU Param CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 476 | |
| 477 | break; |
| 478 | case WNI_CFG_MAX_RX_AMPDU_FACTOR: |
| 479 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != eSIR_SUCCESS) |
| 480 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 481 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT AMPDU Param CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | break; |
| 483 | } |
| 484 | if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != eSIR_SUCCESS) |
| 485 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 486 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve AMPDU Factor CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 487 | break; |
| 488 | } |
| 489 | val16 = ( tANI_U16 ) val1; |
| 490 | pAmpduParamInfo = ( tSirMacHTParametersInfo* ) &val16; |
| 491 | pAmpduParamInfo->maxRxAMPDUFactor = (tANI_U8)val2; |
| 492 | if(cfgSetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, *(tANI_U8*)pAmpduParamInfo) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 493 | PELOGE(limLog(pMac, LOGE, FL("could not update HT AMPDU Param CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 494 | break; |
| 495 | |
| 496 | case WNI_CFG_HEART_BEAT_THRESHOLD: |
| 497 | if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) != eSIR_SUCCESS) |
| 498 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 499 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve WNI_CFG_HEART_BEAT_THRESHOLD CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 500 | break; |
| 501 | } |
| 502 | if(!val1) |
| 503 | { |
| 504 | limDeactivateAndChangeTimer(pMac, eLIM_HEART_BEAT_TIMER); |
| 505 | pMac->sys.gSysEnableLinkMonitorMode = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 506 | } |
| 507 | else |
| 508 | { |
Madan Mohan Koyyalamudi | 49a7c0f | 2012-11-06 18:57:59 -0800 | [diff] [blame] | 509 | tANI_U16 sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 510 | pMac->sys.gSysEnableLinkMonitorMode = 1; |
Madan Mohan Koyyalamudi | 49a7c0f | 2012-11-06 18:57:59 -0800 | [diff] [blame] | 511 | for(sessionId = 0; sessionId < pMac->lim.maxBssId; sessionId++) |
| 512 | { |
| 513 | if( (pMac->lim.gpSession[sessionId].valid )&& |
| 514 | (eLIM_MLM_LINK_ESTABLISHED_STATE == pMac->lim.gpSession[sessionId].limMlmState) && |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 515 | ( pMac->pmm.gPmmState != ePMM_STATE_BMPS_SLEEP) && |
| 516 | (!IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)) |
Madan Mohan Koyyalamudi | 49a7c0f | 2012-11-06 18:57:59 -0800 | [diff] [blame] | 517 | { |
Srikant Kuppa | e6812eb | 2012-12-27 17:34:52 -0800 | [diff] [blame] | 518 | PELOG2(limLog(pMac, LOG2, "HB link monitoring reactivated" |
| 519 | " for session=%d", sessionId);) |
Srinivas Girigowda | 35f6a71 | 2013-04-04 16:48:34 -0700 | [diff] [blame] | 520 | PELOGW(limLog(pMac, LOGW, "Before reactivating HB timer; parameters are" |
| 521 | " session=%d limMlmState=%d pmmState=%d", sessionId, |
| 522 | pMac->lim.gpSession[sessionId].limMlmState, |
| 523 | pMac->pmm.gPmmState);) |
Madan Mohan Koyyalamudi | 49a7c0f | 2012-11-06 18:57:59 -0800 | [diff] [blame] | 524 | limReactivateHeartBeatTimer(pMac, &pMac->lim.gpSession[sessionId]); |
| 525 | } |
Srikant Kuppa | e6812eb | 2012-12-27 17:34:52 -0800 | [diff] [blame] | 526 | else if ( pMac->lim.gpSession[sessionId].valid ) |
| 527 | { |
Srinivas Girigowda | 35f6a71 | 2013-04-04 16:48:34 -0700 | [diff] [blame] | 528 | PELOGW(limLog(pMac, LOGW, "HB link monitoring not reactivated-" |
Srikant Kuppa | e6812eb | 2012-12-27 17:34:52 -0800 | [diff] [blame] | 529 | "session=%d, limMlmState=%d, gPmmState=%d", |
| 530 | sessionId, pMac->lim.gpSession[sessionId].limMlmState, |
| 531 | pMac->pmm.gPmmState);) |
| 532 | } |
Madan Mohan Koyyalamudi | 49a7c0f | 2012-11-06 18:57:59 -0800 | [diff] [blame] | 533 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 534 | } |
| 535 | case WNI_CFG_MAX_PS_POLL: |
| 536 | case WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE: |
| 537 | case WNI_CFG_MIN_RSSI_THRESHOLD: |
| 538 | case WNI_CFG_NTH_BEACON_FILTER: |
| 539 | case WNI_CFG_BROADCAST_FRAME_FILTER_ENABLE: |
| 540 | { |
| 541 | tpSirPowerSaveCfg pPowerSaveConfig; |
| 542 | |
| 543 | /* Allocate and fill in power save configuration. */ |
Hema Aparna Medicharla | eef78fc | 2013-07-12 11:47:01 +0530 | [diff] [blame] | 544 | pPowerSaveConfig = vos_mem_malloc(sizeof(tSirPowerSaveCfg)); |
| 545 | if ( NULL == pPowerSaveConfig ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 547 | PELOGE(limLog(pMac, LOGE, FL("LIM: Cannot allocate memory for power save configuration"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 548 | break; |
| 549 | } |
| 550 | |
| 551 | /* This context should be valid if power-save configuration message has been already dispathed |
| 552 | * during initialization process. Re-using the present configuration mask |
| 553 | */ |
Hema Aparna Medicharla | eef78fc | 2013-07-12 11:47:01 +0530 | [diff] [blame] | 554 | vos_mem_copy(pPowerSaveConfig, (tANI_U8 *)&pMac->pmm.gPmmCfg, sizeof(tSirPowerSaveCfg)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 555 | |
| 556 | if ( (pmmSendPowerSaveCfg(pMac, pPowerSaveConfig)) != eSIR_SUCCESS) |
| 557 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 558 | PELOGE(limLog(pMac, LOGE, FL("LIM: pmmSendPowerSaveCfg() failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 559 | } |
| 560 | } |
| 561 | break; |
| 562 | |
| 563 | |
| 564 | case WNI_CFG_DOT11_MODE: |
| 565 | if (wlan_cfgGetInt(pMac, WNI_CFG_DOT11_MODE, &val1) != eSIR_SUCCESS) |
| 566 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 567 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve Dot11 Mode CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 568 | break; |
| 569 | } |
| 570 | /* TODO */ |
| 571 | //psessionEntry->dot11mode = val1; //// un comment this line ...FORBUILD -TEMPFIX.. HOW TO GET sessionEntry????? |
| 572 | break; |
| 573 | case WNI_CFG_ADDBA_REQ_DECLINE: |
| 574 | if(wlan_cfgGetInt(pMac, WNI_CFG_ADDBA_REQ_DECLINE, &val1) != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 575 | limLog( pMac, LOGE, FL( "Unable to get ADDBA_REQ_DECLINE cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 576 | break; |
| 577 | } |
| 578 | pMac->lim.gAddBA_Declined = (tANI_U8)val1; |
| 579 | break; |
| 580 | |
| 581 | case WNI_CFG_SCAN_IN_POWERSAVE: |
| 582 | if(wlan_cfgGetInt(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val1) != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 583 | limLog( pMac, LOGE, FL( "Unable to get WNI_CFG_SCAN_IN_POWERSAVE " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 584 | break; |
| 585 | } |
| 586 | pMac->lim.gScanInPowersave = (tANI_U8)val1; |
| 587 | break; |
| 588 | |
| 589 | |
| 590 | case WNI_CFG_ASSOC_STA_LIMIT: |
| 591 | if(wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val1) != eSIR_SUCCESS) { |
| 592 | limLog( pMac, LOGE, FL( "Unable to get WNI_CFG_ASSOC_STA_LIMIT" )); |
| 593 | break; |
| 594 | } |
| 595 | pMac->lim.gLimAssocStaLimit = (tANI_U16)val1; |
| 596 | break; |
| 597 | |
| 598 | default: |
| 599 | break; |
| 600 | } |
| 601 | } /*** end limHandleCFGparamUpdate() ***/ |
| 602 | |
| 603 | |
| 604 | |
| 605 | /** |
| 606 | * limApplyConfiguration() |
| 607 | * |
| 608 | *FUNCTION: |
| 609 | * This function is called to apply the configured parameters |
| 610 | * before joining or reassociating with a BSS or starting a BSS. |
| 611 | * |
| 612 | *PARAMS: |
| 613 | * |
| 614 | *LOGIC: |
| 615 | * |
| 616 | *ASSUMPTIONS: |
| 617 | * NA |
| 618 | * |
| 619 | *NOTE: |
| 620 | * |
| 621 | * @param pMac - Pointer to Global MAC structure |
| 622 | * @return None |
| 623 | */ |
| 624 | |
| 625 | void |
| 626 | limApplyConfiguration(tpAniSirGlobal pMac,tpPESession psessionEntry) |
| 627 | { |
| 628 | tANI_U32 val=0, phyMode; |
| 629 | |
Sushant Kaushik | 0b34342 | 2015-05-25 17:15:55 +0530 | [diff] [blame] | 630 | limLog(pMac, LOG2, FL("Applying config")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | limInitWdsInfoParams(pMac); |
| 633 | |
| 634 | psessionEntry->limSentCapsChangeNtf = false; |
| 635 | |
| 636 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 637 | |
| 638 | // Set default keyId and keys |
| 639 | limSetDefaultKeyIdAndKeys(pMac); |
| 640 | |
| 641 | limUpdateConfig(pMac,psessionEntry); |
| 642 | |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 643 | limGetShortSlotFromPhyMode(pMac, psessionEntry, phyMode, |
| 644 | &psessionEntry->shortSlotTimeSupported); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 645 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 646 | limSetCfgProtection(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 647 | |
| 648 | |
| 649 | /* Added for BT - AMP Support */ |
| 650 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 651 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)|| |
| 652 | (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)|| |
| 653 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) ) |
| 654 | { |
| 655 | /* This check is required to ensure the beacon generation is not done |
| 656 | as a part of join request for a BT-AMP station */ |
| 657 | |
| 658 | if(psessionEntry->statypeForBss == STA_ENTRY_SELF) |
| 659 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 660 | PELOG1(limLog(pMac, LOG1, FL("Initializing BT-AMP beacon generation"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 661 | schSetBeaconInterval(pMac,psessionEntry); |
| 662 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | if (wlan_cfgGetInt(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val) != eSIR_SUCCESS) |
| 667 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 668 | limLog(pMac, LOGP, FL("could not retrieve WNI_CFG_SCAN_IN_POWERSAVE")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | return; |
| 670 | } |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 671 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 672 | pMac->lim.gScanInPowersave = (tANI_U8) val; |
Sushant Kaushik | 0b34342 | 2015-05-25 17:15:55 +0530 | [diff] [blame] | 673 | limLog(pMac, LOG1, FL("pMac->lim.gScanInPowersave = %hu"), |
| 674 | pMac->lim.gScanInPowersave); |
| 675 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 676 | |
| 677 | } /*** end limApplyConfiguration() ***/ |
| 678 | |
| 679 | |
| 680 | /** |
| 681 | * limUpdateConfig |
| 682 | * |
| 683 | * FUNCTION: |
| 684 | * Update the local state from CFG database |
| 685 | * (This used to be dphUpdateConfig) |
| 686 | * |
| 687 | * LOGIC: |
| 688 | * |
| 689 | * ASSUMPTIONS: |
| 690 | * |
| 691 | * NOTE: |
| 692 | * |
| 693 | * @param None |
| 694 | * @return None |
| 695 | */ |
| 696 | |
| 697 | static void |
| 698 | limUpdateConfig(tpAniSirGlobal pMac,tpPESession psessionEntry) |
| 699 | { |
| 700 | tANI_U32 val; |
| 701 | |
| 702 | #if 0 |
| 703 | if (wlan_cfgGetStr(pMac, WNI_CFG_STA_ID, pMac->lim.gLimMyMacAddr, &len) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 704 | limLog(pMac, LOGP, FL("cfg get sta id failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | #endif //To SUPPORT BT-AMP |
| 706 | sirCopyMacAddr(pMac->lim.gLimMyMacAddr,psessionEntry->selfMacAddr); |
| 707 | |
| 708 | if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 709 | limLog(pMac, LOGP, FL("cfg get short preamble failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 710 | psessionEntry->beaconParams.fShortPreamble = (val) ? 1 : 0; |
| 711 | |
Sandeep Puligilla | aea98a2 | 2013-12-04 13:36:32 +0530 | [diff] [blame] | 712 | /* In STA case this parameter is filled during the join request */ |
krunal soni | bf965e4 | 2014-02-18 18:27:04 -0800 | [diff] [blame] | 713 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE || |
| 714 | psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE ) |
Sandeep Puligilla | aea98a2 | 2013-12-04 13:36:32 +0530 | [diff] [blame] | 715 | { |
| 716 | if (wlan_cfgGetInt(pMac, WNI_CFG_WME_ENABLED, &val) != eSIR_SUCCESS) |
| 717 | limLog(pMac, LOGP, FL("cfg get wme enabled failed")); |
| 718 | psessionEntry->limWmeEnabled = (val) ? 1 : 0; |
| 719 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 720 | |
| 721 | if (wlan_cfgGetInt(pMac, WNI_CFG_WSM_ENABLED, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 722 | limLog(pMac, LOGP, FL("cfg get wsm enabled failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 723 | psessionEntry->limWsmEnabled = (val) ? 1 : 0; |
| 724 | |
| 725 | if ((! psessionEntry->limWmeEnabled) && (psessionEntry->limWsmEnabled)) |
| 726 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 727 | PELOGE(limLog(pMac, LOGE, FL("Can't enable WSM without WME"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | psessionEntry->limWsmEnabled = 0; |
| 729 | } |
Sandeep Puligilla | aea98a2 | 2013-12-04 13:36:32 +0530 | [diff] [blame] | 730 | /* In STA , this parameter is filled during the join request */ |
krunal soni | bf965e4 | 2014-02-18 18:27:04 -0800 | [diff] [blame] | 731 | if (psessionEntry->limSystemRole== eLIM_AP_ROLE || |
| 732 | psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) |
Sandeep Puligilla | aea98a2 | 2013-12-04 13:36:32 +0530 | [diff] [blame] | 733 | { |
| 734 | if (wlan_cfgGetInt(pMac, WNI_CFG_QOS_ENABLED, &val) != eSIR_SUCCESS) |
| 735 | limLog(pMac, LOGP, FL("cfg get qos enabled failed")); |
| 736 | psessionEntry->limQosEnabled = (val) ? 1 : 0; |
| 737 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | if (wlan_cfgGetInt(pMac, WNI_CFG_HCF_ENABLED, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 739 | limLog(pMac, LOGP, FL("cfg get hcf enabled failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | psessionEntry->limHcfEnabled = (val) ? 1 : 0; |
| 741 | |
| 742 | // Update the ADD BA Declined configuration |
| 743 | if(wlan_cfgGetInt(pMac, WNI_CFG_ADDBA_REQ_DECLINE, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 744 | limLog( pMac, LOGP, FL( "Unable to get ADDBA_REQ_DECLINE cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 745 | pMac->lim.gAddBA_Declined = (val) ? 0xff : 0x0; |
| 746 | |
| 747 | // AP: WSM should enable HCF as well, for STA enable WSM only after |
| 748 | // association response is received |
| 749 | if (psessionEntry->limWsmEnabled && psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 750 | psessionEntry->limHcfEnabled = 1; |
| 751 | |
| 752 | if (wlan_cfgGetInt(pMac, WNI_CFG_11D_ENABLED, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 753 | limLog(pMac, LOGP, FL("cfg get 11d enabled failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | psessionEntry->lim11dEnabled = (val) ? 1 : 0; |
| 755 | |
| 756 | if(wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val) != eSIR_SUCCESS) { |
| 757 | limLog( pMac, LOGP, FL( "cfg get assoc sta limit failed" )); |
| 758 | } |
Gopichand Nakkala | 976e325 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 759 | if( (!WDI_getFwWlanFeatCaps(SAP32STA)) && (val >= WNI_CFG_ASSOC_STA_LIMIT_STAMAX)) |
| 760 | { |
| 761 | if(ccmCfgSetInt(pMac, WNI_CFG_ASSOC_STA_LIMIT, WNI_CFG_ASSOC_STA_LIMIT_STADEF, |
| 762 | NULL, eANI_BOOLEAN_FALSE) != eHAL_STATUS_SUCCESS) |
| 763 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 764 | limLog( pMac, LOGP, FL( "cfg get assoc sta limit failed" )); |
Gopichand Nakkala | 976e325 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 765 | } |
| 766 | val = WNI_CFG_ASSOC_STA_LIMIT_STADEF; |
| 767 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 768 | pMac->lim.gLimAssocStaLimit = (tANI_U16)val; |
| 769 | |
| 770 | #if defined WLAN_FEATURE_VOWIFI |
| 771 | rrmUpdateConfig( pMac, psessionEntry ); |
| 772 | #endif |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 773 | PELOG1(limLog(pMac, LOG1, FL("Updated Lim shadow state based on CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 774 | |
| 775 | |
| 776 | } |
| 777 | |
| 778 | |