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