Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 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; |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 56 | |
| 57 | pe_debug("Setting default keys at SP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | if (wlan_cfg_get_int(pMac, WNI_CFG_WEP_DEFAULT_KEYID, |
| 59 | &val) != eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 60 | pe_err("Unable to retrieve defaultKeyId from CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 82 | pe_debug("frm11a = %d, from11b = %d, frm11g = %d, " |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 83 | "ht20 = %d, nongf = %d, lsigTxop = %d, " |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 84 | "rifs = %d, obss = %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 85 | pesessionEntry->cfgProtection.fromlla, |
| 86 | pesessionEntry->cfgProtection.fromllb, |
| 87 | pesessionEntry->cfgProtection.fromllg, |
| 88 | pesessionEntry->cfgProtection.ht20, |
| 89 | pesessionEntry->cfgProtection.nonGf, |
| 90 | pesessionEntry->cfgProtection.lsigTxop, |
| 91 | pesessionEntry->cfgProtection.rifs, |
| 92 | pesessionEntry->cfgProtection.obss); |
| 93 | } |
| 94 | } else { |
| 95 | if (wlan_cfg_get_int(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, &val) |
| 96 | != eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 97 | pe_err("reading WNI_CFG_FORCE_POLICY_PROTECTION cfg failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 98 | return; |
| 99 | } else |
| 100 | pMac->lim.gLimProtectionControl = (uint8_t) val; |
| 101 | |
| 102 | if (wlan_cfg_get_int(pMac, WNI_CFG_PROTECTION_ENABLED, &val) != |
| 103 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 104 | pe_err("reading protection cfg failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 105 | return; |
| 106 | } |
| 107 | |
| 108 | if (pMac->lim.gLimProtectionControl == |
| 109 | WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 110 | qdf_mem_set((void *)&pMac->lim.cfgProtection, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 111 | sizeof(tCfgProtection), 0); |
| 112 | else { |
| 113 | pMac->lim.cfgProtection.fromlla = |
| 114 | (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llA) & 1; |
| 115 | pMac->lim.cfgProtection.fromllb = |
| 116 | (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llB) & 1; |
| 117 | pMac->lim.cfgProtection.fromllg = |
| 118 | (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llG) & 1; |
| 119 | pMac->lim.cfgProtection.ht20 = |
| 120 | (val >> WNI_CFG_PROTECTION_ENABLED_HT_20) & 1; |
| 121 | pMac->lim.cfgProtection.nonGf = |
| 122 | (val >> WNI_CFG_PROTECTION_ENABLED_NON_GF) & 1; |
| 123 | pMac->lim.cfgProtection.lsigTxop = |
| 124 | (val >> WNI_CFG_PROTECTION_ENABLED_LSIG_TXOP) & 1; |
| 125 | pMac->lim.cfgProtection.rifs = |
| 126 | (val >> WNI_CFG_PROTECTION_ENABLED_RIFS) & 1; |
| 127 | pMac->lim.cfgProtection.obss = |
| 128 | (val >> WNI_CFG_PROTECTION_ENABLED_OBSS) & 1; |
| 129 | |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * lim_handle_param_update() |
| 136 | * |
| 137 | ***FUNCTION: |
| 138 | * This function is use to post a message whenever need indicate |
| 139 | * there is update of config parameter. |
| 140 | * |
| 141 | ***PARAMS: |
| 142 | * |
| 143 | ***LOGIC: |
| 144 | * |
| 145 | ***ASSUMPTIONS: |
| 146 | * NA |
| 147 | * |
| 148 | ***NOTE: |
| 149 | * |
| 150 | * @param pMac - Pointer to Global MAC structure |
| 151 | * @param cfgId - ID of CFG parameter that got updated |
| 152 | * @return None |
| 153 | */ |
| 154 | void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId) |
| 155 | { |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 156 | struct scheduler_msg msg = { 0 }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 157 | uint32_t status; |
| 158 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 159 | pe_debug("Handling CFG parameter id %X update", cfgId); |
| 160 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 161 | switch (cfgId) { |
| 162 | case eUPDATE_IE_PROBE_BCN: |
| 163 | { |
| 164 | msg.type = SIR_LIM_UPDATE_BEACON; |
| 165 | status = lim_post_msg_api(pMac, &msg); |
| 166 | |
| 167 | if (status != TX_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 168 | pe_err("Failed lim_post_msg_api %u", status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 169 | break; |
| 170 | } |
| 171 | default: |
| 172 | break; |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * lim_handle_cf_gparam_update() |
| 178 | * |
| 179 | ***FUNCTION: |
| 180 | * This function is called by lim_process_messages() to |
| 181 | * whenever SIR_CFG_PARAM_UPDATE_IND message is posted |
| 182 | * to LIM (due to a set operation on a CFG parameter). |
| 183 | * |
| 184 | ***PARAMS: |
| 185 | * |
| 186 | ***LOGIC: |
| 187 | * |
| 188 | ***ASSUMPTIONS: |
| 189 | * NA |
| 190 | * |
| 191 | ***NOTE: |
| 192 | * |
| 193 | * @param pMac - Pointer to Global MAC structure |
| 194 | * @param cfgId - ID of CFG parameter that got updated |
| 195 | * @return None |
| 196 | */ |
| 197 | |
| 198 | void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId) |
| 199 | { |
| 200 | uint32_t val1, val2; |
| 201 | uint16_t val16; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 202 | tSirMacHTParametersInfo *pAmpduParamInfo; |
| 203 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 204 | pe_debug("Handling CFG parameter id %X update", cfgId); |
| 205 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 206 | switch (cfgId) { |
| 207 | case WNI_CFG_WEP_DEFAULT_KEYID: |
| 208 | |
| 209 | /* !!LAC - when the default KeyID is changed, force all of the */ |
| 210 | /* keys and the keyID to be reprogrammed. this allows the */ |
| 211 | /* keys to change after the initial setting of the keys when the CFG was */ |
| 212 | /* applied at association time through CFG changes of the keys. */ |
| 213 | lim_set_default_key_id_and_keys(pMac); |
| 214 | |
| 215 | break; |
| 216 | |
| 217 | case WNI_CFG_EXCLUDE_UNENCRYPTED: |
| 218 | if (wlan_cfg_get_int(pMac, WNI_CFG_EXCLUDE_UNENCRYPTED, |
| 219 | &val1) != eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 220 | pe_err("Unable to retrieve excludeUnencr from CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 221 | } |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 222 | pe_err("Unsupported CFG: WNI_CFG_EXCLUDE_UNENCRYPTED"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 223 | |
| 224 | break; |
| 225 | |
| 226 | case WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT: |
| 227 | if (pMac->lim.gLimMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) { |
| 228 | /* 'Change' timer for future activations */ |
| 229 | lim_deactivate_and_change_timer(pMac, |
| 230 | eLIM_ASSOC_FAIL_TIMER); |
| 231 | } |
| 232 | |
| 233 | break; |
| 234 | |
| 235 | case WNI_CFG_PROTECTION_ENABLED: |
| 236 | lim_set_cfg_protection(pMac, NULL); |
| 237 | break; |
| 238 | case WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG: |
| 239 | { |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 240 | struct scheduler_msg msg = { 0 }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 241 | uint32_t status; |
| 242 | |
| 243 | msg.type = SIR_LIM_UPDATE_BEACON; |
| 244 | |
| 245 | status = lim_post_msg_api(pMac, &msg); |
| 246 | |
| 247 | if (status != TX_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 248 | pe_err("Failed lim_post_msg_api %u", status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 249 | break; |
| 250 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 251 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 252 | case WNI_CFG_MPDU_DENSITY: |
| 253 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != |
| 254 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 255 | pe_err("could not retrieve HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 256 | break; |
| 257 | } |
| 258 | if (wlan_cfg_get_int(pMac, WNI_CFG_MPDU_DENSITY, &val2) != |
| 259 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 260 | pe_err("could not retrieve MPDU Density CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 261 | break; |
| 262 | } |
| 263 | val16 = (uint16_t) val1; |
| 264 | pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; |
| 265 | pAmpduParamInfo->mpduDensity = (uint8_t) val2; |
| 266 | if (cfg_set_int |
| 267 | (pMac, WNI_CFG_HT_AMPDU_PARAMS, |
| 268 | *(uint8_t *) pAmpduParamInfo) != eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 269 | pe_err("could not update HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 270 | break; |
| 271 | case WNI_CFG_MAX_RX_AMPDU_FACTOR: |
| 272 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != |
| 273 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 274 | pe_err("could not retrieve HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 275 | break; |
| 276 | } |
| 277 | if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != |
| 278 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 279 | pe_err("could not retrieve AMPDU Factor CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 280 | break; |
| 281 | } |
| 282 | val16 = (uint16_t) val1; |
| 283 | pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; |
| 284 | pAmpduParamInfo->maxRxAMPDUFactor = (uint8_t) val2; |
| 285 | if (cfg_set_int |
| 286 | (pMac, WNI_CFG_HT_AMPDU_PARAMS, |
| 287 | *(uint8_t *) pAmpduParamInfo) != eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 288 | pe_err("could not update HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 289 | break; |
| 290 | |
| 291 | case WNI_CFG_DOT11_MODE: |
| 292 | if (wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &val1) != |
| 293 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 294 | pe_err("could not retrieve Dot11 Mode CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 295 | break; |
| 296 | } |
| 297 | break; |
| 298 | |
| 299 | case WNI_CFG_SCAN_IN_POWERSAVE: |
| 300 | if (wlan_cfg_get_int(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val1) != |
| 301 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 302 | pe_err("Unable to get WNI_CFG_SCAN_IN_POWERSAVE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 303 | break; |
| 304 | } |
| 305 | pMac->lim.gScanInPowersave = (uint8_t) val1; |
| 306 | break; |
| 307 | |
| 308 | case WNI_CFG_ASSOC_STA_LIMIT: |
| 309 | if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val1) != |
| 310 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 311 | pe_err("Unable to get WNI_CFG_ASSOC_STA_LIMIT"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 312 | break; |
| 313 | } |
| 314 | pMac->lim.gLimAssocStaLimit = (uint16_t) val1; |
| 315 | break; |
| 316 | default: |
| 317 | break; |
| 318 | } |
| 319 | } /*** end lim_handle_cf_gparam_update() ***/ |
| 320 | |
| 321 | /** |
| 322 | * lim_apply_configuration() |
| 323 | * |
| 324 | ***FUNCTION: |
| 325 | * This function is called to apply the configured parameters |
| 326 | * before joining or reassociating with a BSS or starting a BSS. |
| 327 | * |
| 328 | ***PARAMS: |
| 329 | * |
| 330 | ***LOGIC: |
| 331 | * |
| 332 | ***ASSUMPTIONS: |
| 333 | * NA |
| 334 | * |
| 335 | ***NOTE: |
| 336 | * |
| 337 | * @param pMac - Pointer to Global MAC structure |
| 338 | * @return None |
| 339 | */ |
| 340 | |
| 341 | void lim_apply_configuration(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 342 | { |
| 343 | uint32_t val = 0, phyMode; |
| 344 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 345 | pe_debug("Applying config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 346 | |
| 347 | psessionEntry->limSentCapsChangeNtf = false; |
| 348 | |
| 349 | lim_get_phy_mode(pMac, &phyMode, psessionEntry); |
| 350 | |
| 351 | /* Set default keyId and keys */ |
| 352 | lim_set_default_key_id_and_keys(pMac); |
| 353 | |
| 354 | lim_update_config(pMac, psessionEntry); |
| 355 | |
| 356 | lim_get_short_slot_from_phy_mode(pMac, psessionEntry, phyMode, |
| 357 | &psessionEntry->shortSlotTimeSupported); |
| 358 | |
| 359 | lim_set_cfg_protection(pMac, psessionEntry); |
| 360 | |
| 361 | /* Added for BT - AMP Support */ |
| 362 | if (LIM_IS_AP_ROLE(psessionEntry) || |
Rajeev Kumar | cf835a0 | 2016-04-15 15:01:31 -0700 | [diff] [blame] | 363 | LIM_IS_IBSS_ROLE(psessionEntry)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 364 | /* This check is required to ensure the beacon generation is not done |
| 365 | as a part of join request for a BT-AMP station */ |
| 366 | |
| 367 | if (psessionEntry->statypeForBss == STA_ENTRY_SELF) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 368 | pe_debug("Initializing BT-AMP beacon generation"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 369 | sch_set_beacon_interval(pMac, psessionEntry); |
| 370 | sch_set_fixed_beacon_fields(pMac, psessionEntry); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | if (wlan_cfg_get_int(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val) != |
| 375 | eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 376 | pe_err("could not retrieve WNI_CFG_SCAN_IN_POWERSAVE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 377 | return; |
| 378 | } |
| 379 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 380 | pe_debug("pMac->lim.gScanInPowersave = %hu", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 381 | pMac->lim.gScanInPowersave); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 382 | pMac->lim.gScanInPowersave = (uint8_t) val; |
| 383 | |
| 384 | } /*** end lim_apply_configuration() ***/ |
| 385 | |
| 386 | /** |
| 387 | * lim_update_config |
| 388 | * |
| 389 | * FUNCTION: |
| 390 | * Update the local state from CFG database |
| 391 | * (This used to be dphUpdateConfig) |
| 392 | * |
| 393 | * LOGIC: |
| 394 | * |
| 395 | * ASSUMPTIONS: |
| 396 | * |
| 397 | * NOTE: |
| 398 | * |
| 399 | * @param None |
| 400 | * @return None |
| 401 | */ |
| 402 | |
| 403 | static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 404 | { |
| 405 | uint32_t val; |
| 406 | |
| 407 | sir_copy_mac_addr(pMac->lim.gLimMyMacAddr, psessionEntry->selfMacAddr); |
| 408 | |
| 409 | if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 410 | pe_err("cfg get short preamble failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 411 | psessionEntry->beaconParams.fShortPreamble = (val) ? 1 : 0; |
| 412 | |
| 413 | /* In STA case this parameter is filled during the join request */ |
| 414 | if (LIM_IS_AP_ROLE(psessionEntry) || |
| 415 | LIM_IS_IBSS_ROLE(psessionEntry)) { |
| 416 | if (wlan_cfg_get_int(pMac, WNI_CFG_WME_ENABLED, &val) != |
| 417 | eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 418 | pe_err("cfg get wme enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 419 | psessionEntry->limWmeEnabled = (val) ? 1 : 0; |
| 420 | } |
| 421 | |
| 422 | if (wlan_cfg_get_int(pMac, WNI_CFG_WSM_ENABLED, &val) != eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 423 | pe_err("cfg get wsm enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 424 | psessionEntry->limWsmEnabled = (val) ? 1 : 0; |
| 425 | |
| 426 | if ((!psessionEntry->limWmeEnabled) && (psessionEntry->limWsmEnabled)) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 427 | pe_err("Can't enable WSM without WME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 428 | psessionEntry->limWsmEnabled = 0; |
| 429 | } |
| 430 | /* In STA , this parameter is filled during the join request */ |
| 431 | if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { |
| 432 | if (wlan_cfg_get_int(pMac, WNI_CFG_QOS_ENABLED, &val) != |
| 433 | eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 434 | pe_err("cfg get qos enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 435 | psessionEntry->limQosEnabled = (val) ? 1 : 0; |
| 436 | } |
| 437 | if (wlan_cfg_get_int(pMac, WNI_CFG_HCF_ENABLED, &val) != eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 438 | pe_err("cfg get hcf enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 439 | psessionEntry->limHcfEnabled = (val) ? 1 : 0; |
| 440 | |
| 441 | /* AP: WSM should enable HCF as well, for STA enable WSM only after */ |
| 442 | /* association response is received */ |
| 443 | if (psessionEntry->limWsmEnabled && LIM_IS_AP_ROLE(psessionEntry)) |
| 444 | psessionEntry->limHcfEnabled = 1; |
| 445 | |
| 446 | if (wlan_cfg_get_int(pMac, WNI_CFG_11D_ENABLED, &val) != eSIR_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 447 | pe_err("cfg get 11d enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 448 | psessionEntry->lim11dEnabled = (val) ? 1 : 0; |
| 449 | |
| 450 | if (wlan_cfg_get_int(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val) != eSIR_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 451 | pe_err("cfg get assoc sta limit failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 452 | } |
| 453 | pMac->lim.gLimAssocStaLimit = (uint16_t) val; |
| 454 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame^] | 455 | pe_debug("Updated Lim shadow state based on CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 456 | } |