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 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | /* |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 20 | * This file lim_process_cfg_updates.cc contains the utility functions |
| 21 | * to handle various CFG parameter update events |
| 22 | * Author: Chandra Modumudi |
| 23 | * Date: 01/20/03 |
| 24 | * History:- |
| 25 | * Date Modified by Modification Information |
| 26 | * -------------------------------------------------------------------- |
| 27 | */ |
| 28 | |
| 29 | #include "ani_global.h" |
| 30 | |
| 31 | #include "wni_cfg.h" |
| 32 | #include "sir_mac_prot_def.h" |
| 33 | #include "cfg_api.h" |
| 34 | #include "lim_types.h" |
| 35 | #include "lim_utils.h" |
| 36 | #include "lim_prop_exts_utils.h" |
| 37 | #include "sch_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 38 | #include "rrm_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 39 | |
| 40 | static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 41 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 42 | void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry) |
| 43 | { |
| 44 | uint32_t val = 0; |
Pragaspathi Thilagaraj | f4cc58b | 2018-07-31 00:39:05 +0530 | [diff] [blame] | 45 | struct wlan_mlme_cfg *mlme_cfg = pMac->mlme_cfg; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 46 | |
| 47 | if (pesessionEntry != NULL && LIM_IS_AP_ROLE(pesessionEntry)) { |
| 48 | if (pesessionEntry->gLimProtectionControl == |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 49 | MLME_FORCE_POLICY_PROTECTION_DISABLE) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 50 | qdf_mem_set((void *)&pesessionEntry->cfgProtection, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 51 | sizeof(tCfgProtection), 0); |
| 52 | else { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 53 | pe_debug("frm11a = %d, from11b = %d, frm11g = %d, " |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | "ht20 = %d, nongf = %d, lsigTxop = %d, " |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 55 | "rifs = %d, obss = %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 56 | pesessionEntry->cfgProtection.fromlla, |
| 57 | pesessionEntry->cfgProtection.fromllb, |
| 58 | pesessionEntry->cfgProtection.fromllg, |
| 59 | pesessionEntry->cfgProtection.ht20, |
| 60 | pesessionEntry->cfgProtection.nonGf, |
| 61 | pesessionEntry->cfgProtection.lsigTxop, |
| 62 | pesessionEntry->cfgProtection.rifs, |
| 63 | pesessionEntry->cfgProtection.obss); |
| 64 | } |
| 65 | } else { |
Pragaspathi Thilagaraj | f4cc58b | 2018-07-31 00:39:05 +0530 | [diff] [blame] | 66 | pMac->lim.gLimProtectionControl = |
| 67 | mlme_cfg->sap_protection_cfg.protection_force_policy; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 68 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 69 | |
| 70 | if (pMac->lim.gLimProtectionControl == |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 71 | MLME_FORCE_POLICY_PROTECTION_DISABLE) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 72 | qdf_mem_set((void *)&pMac->lim.cfgProtection, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 73 | sizeof(tCfgProtection), 0); |
| 74 | else { |
Pragaspathi Thilagaraj | f4cc58b | 2018-07-31 00:39:05 +0530 | [diff] [blame] | 75 | val = mlme_cfg->sap_protection_cfg.protection_enabled; |
| 76 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 77 | pMac->lim.cfgProtection.fromlla = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 78 | (val >> MLME_PROTECTION_ENABLED_FROM_llA) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | pMac->lim.cfgProtection.fromllb = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 80 | (val >> MLME_PROTECTION_ENABLED_FROM_llB) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 81 | pMac->lim.cfgProtection.fromllg = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 82 | (val >> MLME_PROTECTION_ENABLED_FROM_llG) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 83 | pMac->lim.cfgProtection.ht20 = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 84 | (val >> MLME_PROTECTION_ENABLED_HT_20) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 85 | pMac->lim.cfgProtection.nonGf = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 86 | (val >> MLME_PROTECTION_ENABLED_NON_GF) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 87 | pMac->lim.cfgProtection.lsigTxop = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 88 | (val >> MLME_PROTECTION_ENABLED_LSIG_TXOP) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | pMac->lim.cfgProtection.rifs = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 90 | (val >> MLME_PROTECTION_ENABLED_RIFS) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 91 | pMac->lim.cfgProtection.obss = |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame^] | 92 | (val >> MLME_PROTECTION_ENABLED_OBSS) & 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 93 | |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * lim_handle_param_update() |
| 100 | * |
| 101 | ***FUNCTION: |
| 102 | * This function is use to post a message whenever need indicate |
| 103 | * there is update of config parameter. |
| 104 | * |
| 105 | ***PARAMS: |
| 106 | * |
| 107 | ***LOGIC: |
| 108 | * |
| 109 | ***ASSUMPTIONS: |
| 110 | * NA |
| 111 | * |
| 112 | ***NOTE: |
| 113 | * |
| 114 | * @param pMac - Pointer to Global MAC structure |
| 115 | * @param cfgId - ID of CFG parameter that got updated |
| 116 | * @return None |
| 117 | */ |
| 118 | void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId) |
| 119 | { |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 120 | struct scheduler_msg msg = { 0 }; |
Jeff Johnson | c9f4462 | 2018-06-29 14:18:53 -0700 | [diff] [blame] | 121 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 122 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 123 | pe_debug("Handling CFG parameter id %X update", cfgId); |
| 124 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 125 | switch (cfgId) { |
| 126 | case eUPDATE_IE_PROBE_BCN: |
| 127 | { |
| 128 | msg.type = SIR_LIM_UPDATE_BEACON; |
| 129 | status = lim_post_msg_api(pMac, &msg); |
| 130 | |
Jeff Johnson | c9f4462 | 2018-06-29 14:18:53 -0700 | [diff] [blame] | 131 | if (status != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 132 | pe_err("Failed lim_post_msg_api %u", status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 133 | break; |
| 134 | } |
| 135 | default: |
| 136 | break; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * lim_handle_cf_gparam_update() |
| 142 | * |
| 143 | ***FUNCTION: |
| 144 | * This function is called by lim_process_messages() to |
| 145 | * whenever SIR_CFG_PARAM_UPDATE_IND message is posted |
| 146 | * to LIM (due to a set operation on a CFG parameter). |
| 147 | * |
| 148 | ***PARAMS: |
| 149 | * |
| 150 | ***LOGIC: |
| 151 | * |
| 152 | ***ASSUMPTIONS: |
| 153 | * NA |
| 154 | * |
| 155 | ***NOTE: |
| 156 | * |
| 157 | * @param pMac - Pointer to Global MAC structure |
| 158 | * @param cfgId - ID of CFG parameter that got updated |
| 159 | * @return None |
| 160 | */ |
| 161 | |
| 162 | void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId) |
| 163 | { |
| 164 | uint32_t val1, val2; |
| 165 | uint16_t val16; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 166 | tSirMacHTParametersInfo *pAmpduParamInfo; |
| 167 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 168 | pe_debug("Handling CFG parameter id %X update", cfgId); |
| 169 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 170 | switch (cfgId) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 171 | case WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT: |
| 172 | if (pMac->lim.gLimMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) { |
| 173 | /* 'Change' timer for future activations */ |
| 174 | lim_deactivate_and_change_timer(pMac, |
| 175 | eLIM_ASSOC_FAIL_TIMER); |
| 176 | } |
| 177 | |
| 178 | break; |
| 179 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 180 | case WNI_CFG_MPDU_DENSITY: |
| 181 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 182 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 183 | pe_err("could not retrieve HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | break; |
| 185 | } |
| 186 | if (wlan_cfg_get_int(pMac, WNI_CFG_MPDU_DENSITY, &val2) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 187 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 188 | pe_err("could not retrieve MPDU Density CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 189 | break; |
| 190 | } |
| 191 | val16 = (uint16_t) val1; |
| 192 | pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; |
| 193 | pAmpduParamInfo->mpduDensity = (uint8_t) val2; |
| 194 | if (cfg_set_int |
| 195 | (pMac, WNI_CFG_HT_AMPDU_PARAMS, |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 196 | *(uint8_t *) pAmpduParamInfo) != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 197 | pe_err("could not update HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 198 | break; |
| 199 | case WNI_CFG_MAX_RX_AMPDU_FACTOR: |
| 200 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 201 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 202 | pe_err("could not retrieve HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 203 | break; |
| 204 | } |
| 205 | if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 206 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 207 | pe_err("could not retrieve AMPDU Factor CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 208 | break; |
| 209 | } |
| 210 | val16 = (uint16_t) val1; |
| 211 | pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; |
| 212 | pAmpduParamInfo->maxRxAMPDUFactor = (uint8_t) val2; |
| 213 | if (cfg_set_int |
| 214 | (pMac, WNI_CFG_HT_AMPDU_PARAMS, |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 215 | *(uint8_t *) pAmpduParamInfo) != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 216 | pe_err("could not update HT AMPDU Param CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 217 | break; |
| 218 | |
| 219 | case WNI_CFG_DOT11_MODE: |
| 220 | if (wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &val1) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 221 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 222 | pe_err("could not retrieve Dot11 Mode CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 223 | break; |
| 224 | } |
| 225 | break; |
| 226 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 227 | default: |
| 228 | break; |
| 229 | } |
| 230 | } /*** end lim_handle_cf_gparam_update() ***/ |
| 231 | |
| 232 | /** |
| 233 | * lim_apply_configuration() |
| 234 | * |
| 235 | ***FUNCTION: |
| 236 | * This function is called to apply the configured parameters |
| 237 | * before joining or reassociating with a BSS or starting a BSS. |
| 238 | * |
| 239 | ***PARAMS: |
| 240 | * |
| 241 | ***LOGIC: |
| 242 | * |
| 243 | ***ASSUMPTIONS: |
| 244 | * NA |
| 245 | * |
| 246 | ***NOTE: |
| 247 | * |
| 248 | * @param pMac - Pointer to Global MAC structure |
| 249 | * @return None |
| 250 | */ |
| 251 | |
| 252 | void lim_apply_configuration(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 253 | { |
| 254 | uint32_t val = 0, phyMode; |
| 255 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 256 | pe_debug("Applying config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 257 | |
| 258 | psessionEntry->limSentCapsChangeNtf = false; |
| 259 | |
| 260 | lim_get_phy_mode(pMac, &phyMode, psessionEntry); |
| 261 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 262 | lim_update_config(pMac, psessionEntry); |
| 263 | |
| 264 | lim_get_short_slot_from_phy_mode(pMac, psessionEntry, phyMode, |
| 265 | &psessionEntry->shortSlotTimeSupported); |
| 266 | |
| 267 | lim_set_cfg_protection(pMac, psessionEntry); |
| 268 | |
| 269 | /* Added for BT - AMP Support */ |
| 270 | if (LIM_IS_AP_ROLE(psessionEntry) || |
Rajeev Kumar | cf835a0 | 2016-04-15 15:01:31 -0700 | [diff] [blame] | 271 | LIM_IS_IBSS_ROLE(psessionEntry)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 272 | /* This check is required to ensure the beacon generation is not done |
| 273 | as a part of join request for a BT-AMP station */ |
| 274 | |
| 275 | if (psessionEntry->statypeForBss == STA_ENTRY_SELF) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 276 | pe_debug("Initializing BT-AMP beacon generation"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 277 | sch_set_beacon_interval(pMac, psessionEntry); |
| 278 | sch_set_fixed_beacon_fields(pMac, psessionEntry); |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | if (wlan_cfg_get_int(pMac, WNI_CFG_SCAN_IN_POWERSAVE, &val) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 283 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 284 | pe_err("could not retrieve WNI_CFG_SCAN_IN_POWERSAVE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 285 | return; |
| 286 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 287 | } /*** end lim_apply_configuration() ***/ |
| 288 | |
| 289 | /** |
| 290 | * lim_update_config |
| 291 | * |
| 292 | * FUNCTION: |
| 293 | * Update the local state from CFG database |
| 294 | * (This used to be dphUpdateConfig) |
| 295 | * |
| 296 | * LOGIC: |
| 297 | * |
| 298 | * ASSUMPTIONS: |
| 299 | * |
| 300 | * NOTE: |
| 301 | * |
| 302 | * @param None |
| 303 | * @return None |
| 304 | */ |
| 305 | |
| 306 | static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 307 | { |
| 308 | uint32_t val; |
| 309 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 310 | if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 311 | pe_err("cfg get short preamble failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 312 | psessionEntry->beaconParams.fShortPreamble = (val) ? 1 : 0; |
| 313 | |
| 314 | /* In STA case this parameter is filled during the join request */ |
| 315 | if (LIM_IS_AP_ROLE(psessionEntry) || |
| 316 | LIM_IS_IBSS_ROLE(psessionEntry)) { |
| 317 | if (wlan_cfg_get_int(pMac, WNI_CFG_WME_ENABLED, &val) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 318 | QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 319 | pe_err("cfg get wme enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 320 | psessionEntry->limWmeEnabled = (val) ? 1 : 0; |
| 321 | } |
| 322 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 323 | if (wlan_cfg_get_int(pMac, WNI_CFG_WSM_ENABLED, &val) != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 324 | pe_err("cfg get wsm enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 325 | psessionEntry->limWsmEnabled = (val) ? 1 : 0; |
| 326 | |
| 327 | if ((!psessionEntry->limWmeEnabled) && (psessionEntry->limWsmEnabled)) { |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 328 | pe_err("Can't enable WSM without WME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 329 | psessionEntry->limWsmEnabled = 0; |
| 330 | } |
| 331 | /* In STA , this parameter is filled during the join request */ |
| 332 | if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { |
| 333 | if (wlan_cfg_get_int(pMac, WNI_CFG_QOS_ENABLED, &val) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 334 | QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 335 | pe_err("cfg get qos enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | psessionEntry->limQosEnabled = (val) ? 1 : 0; |
| 337 | } |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 338 | if (wlan_cfg_get_int(pMac, WNI_CFG_HCF_ENABLED, &val) != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 339 | pe_err("cfg get hcf enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 340 | psessionEntry->limHcfEnabled = (val) ? 1 : 0; |
| 341 | |
| 342 | /* AP: WSM should enable HCF as well, for STA enable WSM only after */ |
| 343 | /* association response is received */ |
| 344 | if (psessionEntry->limWsmEnabled && LIM_IS_AP_ROLE(psessionEntry)) |
| 345 | psessionEntry->limHcfEnabled = 1; |
| 346 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 347 | if (wlan_cfg_get_int(pMac, WNI_CFG_11D_ENABLED, &val) != QDF_STATUS_SUCCESS) |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 348 | pe_err("cfg get 11d enabled failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 349 | psessionEntry->lim11dEnabled = (val) ? 1 : 0; |
| 350 | |
Srinivas Girigowda | d0a72f9 | 2017-03-26 15:41:14 -0700 | [diff] [blame] | 351 | pe_debug("Updated Lim shadow state based on CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 352 | } |