Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
| 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. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 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 | /* |
| 29 | * This file lim_process_cfg_updates.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 "ani_global.h" |
| 39 | |
| 40 | #include "wni_cfg.h" |
| 41 | #include "sir_mac_prot_def.h" |
| 42 | #include "cfg_api.h" |
| 43 | #include "lim_types.h" |
| 44 | #include "lim_utils.h" |
| 45 | #include "lim_prop_exts_utils.h" |
| 46 | #include "sch_api.h" |
| 47 | #if defined WLAN_FEATURE_VOWIFI |
| 48 | #include "rrm_api.h" |
| 49 | #endif |
| 50 | |
| 51 | static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 52 | |
| 53 | static void lim_set_default_key_id_and_keys(tpAniSirGlobal pMac) |
| 54 | { |
| 55 | #ifdef FIXME_GEN6 |
| 56 | uint32_t val; |
| 57 | uint32_t dkCfgId; |
| 58 | PELOG1(lim_log(pMac, LOG1, FL("Setting default keys at SP"));) |
| 59 | if (wlan_cfg_get_int(pMac, WNI_CFG_WEP_DEFAULT_KEYID, |
| 60 | &val) != eSIR_SUCCESS) { |
| 61 | lim_log(pMac, LOGP, |
| 62 | FL("Unable to retrieve defaultKeyId from CFG")); |
| 63 | } |
| 64 | dkCfgId = limGetCfgIdOfDefaultKeyid(val); |
| 65 | #endif |
| 66 | |
| 67 | } /*** end lim_set_default_key_id_and_keys() ***/ |
| 68 | /** ------------------------------------------------------------- |
| 69 | \fn lim_set_cfg_protection |
| 70 | \brief sets lim global cfg cache from the config. |
| 71 | \param tpAniSirGlobal pMac |
| 72 | \return None |
| 73 | -------------------------------------------------------------*/ |
| 74 | void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry) |
| 75 | { |
| 76 | uint32_t val = 0; |
| 77 | |
| 78 | if (pesessionEntry != NULL && LIM_IS_AP_ROLE(pesessionEntry)) { |
| 79 | if (pesessionEntry->gLimProtectionControl == |
| 80 | WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 81 | cdf_mem_set((void *)&pesessionEntry->cfgProtection, |
| 82 | sizeof(tCfgProtection), 0); |
| 83 | else { |
| 84 | lim_log(pMac, LOG1, |
| 85 | FL(" frm11a = %d, from11b = %d, frm11g = %d, " |
| 86 | "ht20 = %d, nongf = %d, lsigTxop = %d, " |
| 87 | "rifs = %d, obss = %d"), |
| 88 | pesessionEntry->cfgProtection.fromlla, |
| 89 | pesessionEntry->cfgProtection.fromllb, |
| 90 | pesessionEntry->cfgProtection.fromllg, |
| 91 | pesessionEntry->cfgProtection.ht20, |
| 92 | pesessionEntry->cfgProtection.nonGf, |
| 93 | pesessionEntry->cfgProtection.lsigTxop, |
| 94 | pesessionEntry->cfgProtection.rifs, |
| 95 | pesessionEntry->cfgProtection.obss); |
| 96 | } |
| 97 | } else { |
| 98 | if (wlan_cfg_get_int(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, &val) |
| 99 | != eSIR_SUCCESS) { |
| 100 | lim_log(pMac, LOGP, |
| 101 | FL |
| 102 | ("reading WNI_CFG_FORCE_POLICY_PROTECTION cfg failed")); |
| 103 | return; |
| 104 | } else |
| 105 | pMac->lim.gLimProtectionControl = (uint8_t) val; |
| 106 | |
| 107 | if (wlan_cfg_get_int(pMac, WNI_CFG_PROTECTION_ENABLED, &val) != |
| 108 | eSIR_SUCCESS) { |
| 109 | lim_log(pMac, LOGP, FL("reading protection cfg failed")); |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | if (pMac->lim.gLimProtectionControl == |
| 114 | WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 115 | cdf_mem_set((void *)&pMac->lim.cfgProtection, |
| 116 | sizeof(tCfgProtection), 0); |
| 117 | else { |
| 118 | pMac->lim.cfgProtection.fromlla = |
| 119 | (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llA) & 1; |
| 120 | pMac->lim.cfgProtection.fromllb = |
| 121 | (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llB) & 1; |
| 122 | pMac->lim.cfgProtection.fromllg = |
| 123 | (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llG) & 1; |
| 124 | pMac->lim.cfgProtection.ht20 = |
| 125 | (val >> WNI_CFG_PROTECTION_ENABLED_HT_20) & 1; |
| 126 | pMac->lim.cfgProtection.nonGf = |
| 127 | (val >> WNI_CFG_PROTECTION_ENABLED_NON_GF) & 1; |
| 128 | pMac->lim.cfgProtection.lsigTxop = |
| 129 | (val >> WNI_CFG_PROTECTION_ENABLED_LSIG_TXOP) & 1; |
| 130 | pMac->lim.cfgProtection.rifs = |
| 131 | (val >> WNI_CFG_PROTECTION_ENABLED_RIFS) & 1; |
| 132 | pMac->lim.cfgProtection.obss = |
| 133 | (val >> WNI_CFG_PROTECTION_ENABLED_OBSS) & 1; |
| 134 | |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * lim_handle_param_update() |
| 141 | * |
| 142 | ***FUNCTION: |
| 143 | * This function is use to post a message whenever need indicate |
| 144 | * there is update of config parameter. |
| 145 | * |
| 146 | ***PARAMS: |
| 147 | * |
| 148 | ***LOGIC: |
| 149 | * |
| 150 | ***ASSUMPTIONS: |
| 151 | * NA |
| 152 | * |
| 153 | ***NOTE: |
| 154 | * |
| 155 | * @param pMac - Pointer to Global MAC structure |
| 156 | * @param cfgId - ID of CFG parameter that got updated |
| 157 | * @return None |
| 158 | */ |
| 159 | void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId) |
| 160 | { |
| 161 | tSirMsgQ msg = { 0 }; |
| 162 | uint32_t status; |
| 163 | |
| 164 | PELOG3(lim_log |
| 165 | (pMac, LOG3, FL("Handling CFG parameter id %X update"), cfgId); |
| 166 | ) |
| 167 | switch (cfgId) { |
| 168 | case eUPDATE_IE_PROBE_BCN: |
| 169 | { |
| 170 | msg.type = SIR_LIM_UPDATE_BEACON; |
| 171 | status = lim_post_msg_api(pMac, &msg); |
| 172 | |
| 173 | if (status != TX_SUCCESS) |
| 174 | PELOGE(lim_log |
| 175 | (pMac, LOGE, |
| 176 | FL("Failed lim_post_msg_api %u"), status); |
| 177 | ) |
| 178 | break; |
| 179 | } |
| 180 | default: |
| 181 | break; |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * lim_handle_cf_gparam_update() |
| 187 | * |
| 188 | ***FUNCTION: |
| 189 | * This function is called by lim_process_messages() to |
| 190 | * whenever SIR_CFG_PARAM_UPDATE_IND message is posted |
| 191 | * to LIM (due to a set operation on a CFG parameter). |
| 192 | * |
| 193 | ***PARAMS: |
| 194 | * |
| 195 | ***LOGIC: |
| 196 | * |
| 197 | ***ASSUMPTIONS: |
| 198 | * NA |
| 199 | * |
| 200 | ***NOTE: |
| 201 | * |
| 202 | * @param pMac - Pointer to Global MAC structure |
| 203 | * @param cfgId - ID of CFG parameter that got updated |
| 204 | * @return None |
| 205 | */ |
| 206 | |
| 207 | void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId) |
| 208 | { |
| 209 | uint32_t val1, val2; |
| 210 | uint16_t val16; |
| 211 | tSirMacHTCapabilityInfo *pHTCapabilityInfo; |
| 212 | tSirMacHTParametersInfo *pAmpduParamInfo; |
| 213 | |
| 214 | PELOG3(lim_log |
| 215 | (pMac, LOG3, FL("Handling CFG parameter id %X update"), cfgId); |
| 216 | ) |
| 217 | switch (cfgId) { |
| 218 | case WNI_CFG_WEP_DEFAULT_KEYID: |
| 219 | |
| 220 | /* !!LAC - when the default KeyID is changed, force all of the */ |
| 221 | /* keys and the keyID to be reprogrammed. this allows the */ |
| 222 | /* keys to change after the initial setting of the keys when the CFG was */ |
| 223 | /* applied at association time through CFG changes of the keys. */ |
| 224 | lim_set_default_key_id_and_keys(pMac); |
| 225 | |
| 226 | break; |
| 227 | |
| 228 | case WNI_CFG_EXCLUDE_UNENCRYPTED: |
| 229 | if (wlan_cfg_get_int(pMac, WNI_CFG_EXCLUDE_UNENCRYPTED, |
| 230 | &val1) != eSIR_SUCCESS) { |
| 231 | lim_log(pMac, LOGP, |
| 232 | FL("Unable to retrieve excludeUnencr from CFG")); |
| 233 | } |
| 234 | lim_log(pMac, LOGE, |
| 235 | FL("Unsupported CFG: WNI_CFG_EXCLUDE_UNENCRYPTED")); |
| 236 | |
| 237 | break; |
| 238 | |
| 239 | case WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT: |
| 240 | if (pMac->lim.gLimMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) { |
| 241 | /* 'Change' timer for future activations */ |
| 242 | lim_deactivate_and_change_timer(pMac, |
| 243 | eLIM_ASSOC_FAIL_TIMER); |
| 244 | } |
| 245 | |
| 246 | break; |
| 247 | |
| 248 | case WNI_CFG_PROTECTION_ENABLED: |
| 249 | lim_set_cfg_protection(pMac, NULL); |
| 250 | break; |
| 251 | case WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG: |
| 252 | { |
| 253 | tSirMsgQ msg = { 0 }; |
| 254 | uint32_t status; |
| 255 | |
| 256 | msg.type = SIR_LIM_UPDATE_BEACON; |
| 257 | |
| 258 | status = lim_post_msg_api(pMac, &msg); |
| 259 | |
| 260 | if (status != TX_SUCCESS) |
| 261 | PELOGE(lim_log |
| 262 | (pMac, LOGE, |
| 263 | FL("Failed lim_post_msg_api %u"), status); |
| 264 | ) |
| 265 | break; |
| 266 | } |
| 267 | case WNI_CFG_GREENFIELD_CAPABILITY: |
| 268 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != |
| 269 | eSIR_SUCCESS) { |
| 270 | PELOGE(lim_log |
| 271 | (pMac, LOGE, |
| 272 | FL("could not retrieve HT Cap Info CFG")); |
| 273 | ) |
| 274 | break; |
| 275 | } |
| 276 | if (wlan_cfg_get_int(pMac, WNI_CFG_GREENFIELD_CAPABILITY, &val2) |
| 277 | != eSIR_SUCCESS) { |
| 278 | PELOGE(lim_log |
| 279 | (pMac, LOGE, |
| 280 | FL("could not retrieve GreenField CFG")); |
| 281 | ) |
| 282 | break; |
| 283 | } |
| 284 | val16 = (uint16_t) val1; |
| 285 | pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16; |
| 286 | pHTCapabilityInfo->greenField = (uint16_t) val2; |
| 287 | if (cfg_set_int |
| 288 | (pMac, WNI_CFG_HT_CAP_INFO, |
| 289 | *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) |
| 290 | PELOGE(lim_log |
| 291 | (pMac, LOGE, |
| 292 | FL("could not update HT Cap Info CFG")); |
| 293 | ) |
| 294 | break; |
| 295 | |
| 296 | case WNI_CFG_HT_RX_STBC: |
| 297 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != |
| 298 | eSIR_SUCCESS) { |
| 299 | PELOGE(lim_log |
| 300 | (pMac, LOGE, |
| 301 | FL("could not retrieve WNI_CFG_HT_CAP_INFO ")); |
| 302 | ) |
| 303 | break; |
| 304 | } |
| 305 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_RX_STBC, &val2) != |
| 306 | eSIR_SUCCESS) { |
| 307 | PELOGE(lim_log |
| 308 | (pMac, LOGE, |
| 309 | FL("could not retrieve WNI_CFG_HT_RX_STBC")); |
| 310 | ) |
| 311 | break; |
| 312 | } |
| 313 | val16 = (uint16_t) val1; |
| 314 | pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16; |
| 315 | pHTCapabilityInfo->rxSTBC = (uint16_t) val2; |
| 316 | if (cfg_set_int |
| 317 | (pMac, WNI_CFG_HT_CAP_INFO, |
| 318 | *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) |
| 319 | PELOGE(lim_log |
| 320 | (pMac, LOGE, |
| 321 | FL("could not update HT Cap Info CFG")); |
| 322 | ) |
| 323 | break; |
| 324 | |
| 325 | case WNI_CFG_MAX_AMSDU_LENGTH: |
| 326 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != |
| 327 | eSIR_SUCCESS) { |
| 328 | PELOGE(lim_log |
| 329 | (pMac, LOGE, |
| 330 | FL("could not retrieve HT Cap Info CFG")); |
| 331 | ) |
| 332 | break; |
| 333 | } |
| 334 | if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_AMSDU_LENGTH, &val2) != |
| 335 | eSIR_SUCCESS) { |
| 336 | PELOGE(lim_log |
| 337 | (pMac, LOGE, |
| 338 | FL("could not retrieve Max AMSDU Length CFG")); |
| 339 | ) |
| 340 | break; |
| 341 | } |
| 342 | val16 = (uint16_t) val1; |
| 343 | pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16; |
| 344 | pHTCapabilityInfo->maximalAMSDUsize = (uint16_t) val2; |
| 345 | if (cfg_set_int |
| 346 | (pMac, WNI_CFG_HT_CAP_INFO, |
| 347 | *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) |
| 348 | PELOGE(lim_log |
| 349 | (pMac, LOGE, |
| 350 | FL("could not update HT Cap Info CFG")); |
| 351 | ) |
| 352 | break; |
| 353 | |
| 354 | case WNI_CFG_SHORT_GI_20MHZ: |
| 355 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != |
| 356 | eSIR_SUCCESS) { |
| 357 | PELOGE(lim_log |
| 358 | (pMac, LOGE, |
| 359 | FL("could not retrieve HT Cap CFG")); |
| 360 | ) |
| 361 | break; |
| 362 | } |
| 363 | if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) != |
| 364 | eSIR_SUCCESS) { |
| 365 | PELOGE(lim_log |
| 366 | (pMac, LOGE, |
| 367 | FL("could not retrieve shortGI 20Mhz CFG")); |
| 368 | ) |
| 369 | break; |
| 370 | } |
| 371 | val16 = (uint16_t) val1; |
| 372 | pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16; |
| 373 | pHTCapabilityInfo->shortGI20MHz = (uint16_t) val2; |
| 374 | if (cfg_set_int |
| 375 | (pMac, WNI_CFG_HT_CAP_INFO, |
| 376 | *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) |
| 377 | PELOGE(lim_log |
| 378 | (pMac, LOGE, |
| 379 | FL("could not update HT Cap Info CFG")); |
| 380 | ) |
| 381 | break; |
| 382 | case WNI_CFG_SHORT_GI_40MHZ: |
| 383 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != |
| 384 | eSIR_SUCCESS) { |
| 385 | PELOGE(lim_log |
| 386 | (pMac, LOGE, |
| 387 | FL("could not retrieve HT Cap CFG")); |
| 388 | ) |
| 389 | break; |
| 390 | } |
| 391 | if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_40MHZ, &val2) != |
| 392 | eSIR_SUCCESS) { |
| 393 | PELOGE(lim_log |
| 394 | (pMac, LOGE, |
| 395 | FL("could not retrieve shortGI 40Mhz CFG")); |
| 396 | ) |
| 397 | break; |
| 398 | } |
| 399 | val16 = (uint16_t) val1; |
| 400 | pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16; |
| 401 | pHTCapabilityInfo->shortGI40MHz = (uint16_t) val2; |
| 402 | if (cfg_set_int |
| 403 | (pMac, WNI_CFG_HT_CAP_INFO, |
| 404 | *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) |
| 405 | PELOGE(lim_log |
| 406 | (pMac, LOGE, |
| 407 | FL("could not update HT Cap Info CFG")); |
| 408 | ) |
| 409 | break; |
| 410 | case WNI_CFG_MPDU_DENSITY: |
| 411 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != |
| 412 | eSIR_SUCCESS) { |
| 413 | PELOGE(lim_log |
| 414 | (pMac, LOGE, |
| 415 | FL("could not retrieve HT AMPDU Param CFG")); |
| 416 | ) |
| 417 | break; |
| 418 | } |
| 419 | if (wlan_cfg_get_int(pMac, WNI_CFG_MPDU_DENSITY, &val2) != |
| 420 | eSIR_SUCCESS) { |
| 421 | PELOGE(lim_log |
| 422 | (pMac, LOGE, |
| 423 | FL("could not retrieve MPDU Density CFG")); |
| 424 | ) |
| 425 | break; |
| 426 | } |
| 427 | val16 = (uint16_t) val1; |
| 428 | pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; |
| 429 | pAmpduParamInfo->mpduDensity = (uint8_t) val2; |
| 430 | if (cfg_set_int |
| 431 | (pMac, WNI_CFG_HT_AMPDU_PARAMS, |
| 432 | *(uint8_t *) pAmpduParamInfo) != eSIR_SUCCESS) |
| 433 | PELOGE(lim_log |
| 434 | (pMac, LOGE, |
| 435 | FL("could not update HT AMPDU Param CFG")); |
| 436 | ) |
| 437 | |
| 438 | break; |
| 439 | case WNI_CFG_MAX_RX_AMPDU_FACTOR: |
| 440 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != |
| 441 | eSIR_SUCCESS) { |
| 442 | PELOGE(lim_log |
| 443 | (pMac, LOGE, |
| 444 | FL("could not retrieve HT AMPDU Param CFG")); |
| 445 | ) |
| 446 | break; |
| 447 | } |
| 448 | if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != |
| 449 | eSIR_SUCCESS) { |
| 450 | PELOGE(lim_log |
| 451 | (pMac, LOGE, |
| 452 | FL("could not retrieve AMPDU Factor CFG")); |
| 453 | ) |
| 454 | break; |
| 455 | } |
| 456 | val16 = (uint16_t) val1; |
| 457 | pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; |
| 458 | pAmpduParamInfo->maxRxAMPDUFactor = (uint8_t) val2; |
| 459 | if (cfg_set_int |
| 460 | (pMac, WNI_CFG_HT_AMPDU_PARAMS, |
| 461 | *(uint8_t *) pAmpduParamInfo) != eSIR_SUCCESS) |
| 462 | PELOGE(lim_log |
| 463 | (pMac, LOGE, |
| 464 | FL("could not update HT AMPDU Param CFG")); |
| 465 | ) |
| 466 | break; |
| 467 | |
| 468 | case WNI_CFG_DOT11_MODE: |
| 469 | if (wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &val1) != |
| 470 | eSIR_SUCCESS) { |
| 471 | PELOGE(lim_log |
| 472 | (pMac, LOGE, |
| 473 | FL("could not retrieve Dot11 Mode CFG")); |
| 474 | ) |
| 475 | break; |
| 476 | } |
| 477 | break; |
| 478 | |
| 479 | case WNI_CFG_SCAN_IN_POWERSAVE: |
| 480 | if (wlan_cfg_get_int(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val1) != |
| 481 | eSIR_SUCCESS) { |
| 482 | lim_log(pMac, LOGE, |
| 483 | FL("Unable to get WNI_CFG_SCAN_IN_POWERSAVE ")); |
| 484 | break; |
| 485 | } |
| 486 | pMac->lim.gScanInPowersave = (uint8_t) val1; |
| 487 | break; |
| 488 | |
| 489 | case WNI_CFG_ASSOC_STA_LIMIT: |
| 490 | if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val1) != |
| 491 | eSIR_SUCCESS) { |
| 492 | lim_log(pMac, LOGE, |
| 493 | FL("Unable to get WNI_CFG_ASSOC_STA_LIMIT")); |
| 494 | break; |
| 495 | } |
| 496 | pMac->lim.gLimAssocStaLimit = (uint16_t) val1; |
| 497 | break; |
| 498 | default: |
| 499 | break; |
| 500 | } |
| 501 | } /*** end lim_handle_cf_gparam_update() ***/ |
| 502 | |
| 503 | /** |
| 504 | * lim_apply_configuration() |
| 505 | * |
| 506 | ***FUNCTION: |
| 507 | * This function is called to apply the configured parameters |
| 508 | * before joining or reassociating with a BSS or starting a BSS. |
| 509 | * |
| 510 | ***PARAMS: |
| 511 | * |
| 512 | ***LOGIC: |
| 513 | * |
| 514 | ***ASSUMPTIONS: |
| 515 | * NA |
| 516 | * |
| 517 | ***NOTE: |
| 518 | * |
| 519 | * @param pMac - Pointer to Global MAC structure |
| 520 | * @return None |
| 521 | */ |
| 522 | |
| 523 | void lim_apply_configuration(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 524 | { |
| 525 | uint32_t val = 0, phyMode; |
| 526 | |
| 527 | PELOG2(lim_log(pMac, LOG2, FL("Applying config"));) |
| 528 | |
| 529 | psessionEntry->limSentCapsChangeNtf = false; |
| 530 | |
| 531 | lim_get_phy_mode(pMac, &phyMode, psessionEntry); |
| 532 | |
| 533 | /* Set default keyId and keys */ |
| 534 | lim_set_default_key_id_and_keys(pMac); |
| 535 | |
| 536 | lim_update_config(pMac, psessionEntry); |
| 537 | |
| 538 | lim_get_short_slot_from_phy_mode(pMac, psessionEntry, phyMode, |
| 539 | &psessionEntry->shortSlotTimeSupported); |
| 540 | |
| 541 | lim_set_cfg_protection(pMac, psessionEntry); |
| 542 | |
| 543 | /* Added for BT - AMP Support */ |
| 544 | if (LIM_IS_AP_ROLE(psessionEntry) || |
| 545 | LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || |
| 546 | LIM_IS_IBSS_ROLE(psessionEntry) || |
| 547 | LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { |
| 548 | /* This check is required to ensure the beacon generation is not done |
| 549 | as a part of join request for a BT-AMP station */ |
| 550 | |
| 551 | if (psessionEntry->statypeForBss == STA_ENTRY_SELF) { |
| 552 | PELOG1(lim_log |
| 553 | (pMac, LOG1, |
| 554 | FL("Initializing BT-AMP beacon generation")); |
| 555 | ) |
| 556 | sch_set_beacon_interval(pMac, psessionEntry); |
| 557 | sch_set_fixed_beacon_fields(pMac, psessionEntry); |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | if (wlan_cfg_get_int(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val) != |
| 562 | eSIR_SUCCESS) { |
| 563 | lim_log(pMac, LOGP, |
| 564 | FL("could not retrieve WNI_CFG_SCAN_IN_POWERSAVE")); |
| 565 | return; |
| 566 | } |
| 567 | |
| 568 | PELOG1(lim_log(pMac, LOG1, FL("pMac->lim.gScanInPowersave = %hu"), |
| 569 | pMac->lim.gScanInPowersave); |
| 570 | ) |
| 571 | pMac->lim.gScanInPowersave = (uint8_t) val; |
| 572 | |
| 573 | } /*** end lim_apply_configuration() ***/ |
| 574 | |
| 575 | /** |
| 576 | * lim_update_config |
| 577 | * |
| 578 | * FUNCTION: |
| 579 | * Update the local state from CFG database |
| 580 | * (This used to be dphUpdateConfig) |
| 581 | * |
| 582 | * LOGIC: |
| 583 | * |
| 584 | * ASSUMPTIONS: |
| 585 | * |
| 586 | * NOTE: |
| 587 | * |
| 588 | * @param None |
| 589 | * @return None |
| 590 | */ |
| 591 | |
| 592 | static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 593 | { |
| 594 | uint32_t val; |
| 595 | |
| 596 | sir_copy_mac_addr(pMac->lim.gLimMyMacAddr, psessionEntry->selfMacAddr); |
| 597 | |
| 598 | if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != eSIR_SUCCESS) |
| 599 | lim_log(pMac, LOGP, FL("cfg get short preamble failed")); |
| 600 | psessionEntry->beaconParams.fShortPreamble = (val) ? 1 : 0; |
| 601 | |
| 602 | /* In STA case this parameter is filled during the join request */ |
| 603 | if (LIM_IS_AP_ROLE(psessionEntry) || |
| 604 | LIM_IS_IBSS_ROLE(psessionEntry)) { |
| 605 | if (wlan_cfg_get_int(pMac, WNI_CFG_WME_ENABLED, &val) != |
| 606 | eSIR_SUCCESS) |
| 607 | lim_log(pMac, LOGP, FL("cfg get wme enabled failed")); |
| 608 | psessionEntry->limWmeEnabled = (val) ? 1 : 0; |
| 609 | } |
| 610 | |
| 611 | if (wlan_cfg_get_int(pMac, WNI_CFG_WSM_ENABLED, &val) != eSIR_SUCCESS) |
| 612 | lim_log(pMac, LOGP, FL("cfg get wsm enabled failed")); |
| 613 | psessionEntry->limWsmEnabled = (val) ? 1 : 0; |
| 614 | |
| 615 | if ((!psessionEntry->limWmeEnabled) && (psessionEntry->limWsmEnabled)) { |
| 616 | PELOGE(lim_log(pMac, LOGE, FL("Can't enable WSM without WME"));) |
| 617 | psessionEntry->limWsmEnabled = 0; |
| 618 | } |
| 619 | /* In STA , this parameter is filled during the join request */ |
| 620 | if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { |
| 621 | if (wlan_cfg_get_int(pMac, WNI_CFG_QOS_ENABLED, &val) != |
| 622 | eSIR_SUCCESS) |
| 623 | lim_log(pMac, LOGP, FL("cfg get qos enabled failed")); |
| 624 | psessionEntry->limQosEnabled = (val) ? 1 : 0; |
| 625 | } |
| 626 | if (wlan_cfg_get_int(pMac, WNI_CFG_HCF_ENABLED, &val) != eSIR_SUCCESS) |
| 627 | lim_log(pMac, LOGP, FL("cfg get hcf enabled failed")); |
| 628 | psessionEntry->limHcfEnabled = (val) ? 1 : 0; |
| 629 | |
| 630 | /* AP: WSM should enable HCF as well, for STA enable WSM only after */ |
| 631 | /* association response is received */ |
| 632 | if (psessionEntry->limWsmEnabled && LIM_IS_AP_ROLE(psessionEntry)) |
| 633 | psessionEntry->limHcfEnabled = 1; |
| 634 | |
| 635 | if (wlan_cfg_get_int(pMac, WNI_CFG_11D_ENABLED, &val) != eSIR_SUCCESS) |
| 636 | lim_log(pMac, LOGP, FL("cfg get 11d enabled failed")); |
| 637 | psessionEntry->lim11dEnabled = (val) ? 1 : 0; |
| 638 | |
| 639 | if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val) != eSIR_SUCCESS) { |
| 640 | lim_log(pMac, LOGP, FL("cfg get assoc sta limit failed")); |
| 641 | } |
| 642 | pMac->lim.gLimAssocStaLimit = (uint16_t) val; |
| 643 | |
| 644 | #if defined WLAN_FEATURE_VOWIFI |
| 645 | rrm_update_config(pMac, psessionEntry); |
| 646 | #endif |
| 647 | PELOG1(lim_log(pMac, LOG1, FL("Updated Lim shadow state based on CFG"));) |
| 648 | } |