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