From e5a17e4acb7c0f69816bfa23b1bc48b76b7b99ee Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Mon, 10 Sep 2018 10:05:25 +0530 Subject: [PATCH] qcacld-3.0: Add MLME-CFG items for feature flags Add these cfg mlme items for feature flags:- 1. ACCEPT_SHORT_SLOT_ASSOC_ONLY 2. HCF_ENABLED 3. RSN_ENABLED 4. 11G_SHORT_PREAMBLE_ENABLED 5. 11G_SHORT_SLOT_TIME_ENABLED 6. CHANNEL_BONDING_MODE 7. CFG_BLOCK_ACK_ENABLED Change-Id: Id55299ece0169d40608df8508fbd768bb8aed741 CRs-Fixed: 2315584 --- components/mlme/core/src/wlan_mlme_main.c | 19 ++++ components/mlme/dispatcher/inc/cfg_mlme.h | 4 +- .../dispatcher/inc/cfg_mlme_feature_flag.h | 100 ++++++++++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 24 +++++ core/hdd/inc/wlan_hdd_cfg.h | 23 ---- core/hdd/src/wlan_hdd_cfg.c | 7 -- core/mac/inc/wni_cfg.h | 5 - core/mac/src/cfg/cfg_api.c | 13 +-- core/mac/src/cfg/cfg_param_name.c | 5 - core/mac/src/cfg/cfg_proc_msg.c | 30 ------ core/mac/src/pe/lim/lim_api.c | 14 +-- core/mac/src/pe/lim/lim_assoc_utils.c | 13 +-- core/mac/src/pe/lim/lim_process_cfg_updates.c | 4 +- core/mac/src/pe/lim/lim_sme_req_utils.c | 10 +- core/mac/src/pe/lim/lim_utils.c | 11 +- .../src/sys/legacy/src/utils/src/parser_api.c | 2 +- core/sme/inc/csr_internal.h | 1 - core/sme/src/csr/csr_api_roam.c | 17 +-- core/wma/src/wma_scan_roam.c | 16 +-- 19 files changed, 172 insertions(+), 146 deletions(-) create mode 100644 components/mlme/dispatcher/inc/cfg_mlme_feature_flag.h diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index b69cd36be012..6df01d18a9b4 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -392,6 +392,24 @@ static void mlme_init_rates_in_cfg(struct wlan_objmgr_psoc *psoc, CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2); } +static void mlme_init_feature_flag_in_cfg( + struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_feature_flag *feature_flags) +{ + feature_flags->accept_short_slot_assoc = + cfg_default(CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY); + feature_flags->enable_hcf = cfg_default(CFG_HCF_ENABLED); + feature_flags->enable_rsn = cfg_default(CFG_RSN_ENABLED); + feature_flags->enable_short_preamble_11g = + cfg_default(CFG_11G_SHORT_PREAMBLE_ENABLED); + feature_flags->enable_short_slot_time_11g = + cfg_default(CFG_11G_SHORT_SLOT_TIME_ENABLED); + feature_flags->channel_bonding_mode = + cfg_default(CFG_CHANNEL_BONDING_MODE); + feature_flags->enable_block_ack = cfg_default(CFG_BLOCK_ACK_ENABLED); + feature_flags->enable_ampdu = cfg_get(psoc, CFG_ENABLE_AMPDUPS); +} + static void mlme_init_sap_protection_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_sap_protection *sap_protection_params) @@ -916,6 +934,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) mlme_init_obss_ht40_cfg(psoc, &mlme_cfg->obss_ht40); mlme_init_sta_cfg(psoc, &mlme_cfg->sta); mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr); + mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags); mlme_init_scoring_cfg(psoc, &mlme_cfg->scoring); mlme_init_oce_cfg(psoc, &mlme_cfg->oce); diff --git a/components/mlme/dispatcher/inc/cfg_mlme.h b/components/mlme/dispatcher/inc/cfg_mlme.h index 5870ae46ecb1..fb26da30d9e2 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme.h +++ b/components/mlme/dispatcher/inc/cfg_mlme.h @@ -39,11 +39,13 @@ #include "cfg_mlme_sap.h" #include "cfg_mlme_scoring.h" #include "cfg_mlme_oce.h" +#include "cfg_mlme_feature_flag.h" /* Please Maintain Alphabetic Order here */ #define CFG_MLME_ALL \ CFG_CHAINMASK_ALL \ CFG_EDCA_PARAMS_ALL \ + CFG_FEATURE_FLAG_ALL \ CFG_GENERIC_ALL \ CFG_HT_CAPS_ALL \ CFG_HE_CAPS_ALL \ @@ -57,6 +59,6 @@ CFG_SAP_PROTECTION_ALL \ CFG_SCORING_ALL \ CFG_STA_ALL \ - CFG_VHT_CAPS_ALL + CFG_VHT_CAPS_ALL \ #endif /* __CFG_MLME_H */ diff --git a/components/mlme/dispatcher/inc/cfg_mlme_feature_flag.h b/components/mlme/dispatcher/inc/cfg_mlme_feature_flag.h new file mode 100644 index 000000000000..a27006344cf8 --- /dev/null +++ b/components/mlme/dispatcher/inc/cfg_mlme_feature_flag.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * DOC: This file contains centralized definitions of converged configuration. + */ + +#ifndef __CFG_MLME_FEATURE_FLAG_H +#define __CFG_MLME_FEATURE_FLAG_H + +#define CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY CFG_BOOL( \ + "accept_short_slot_assoc", \ + 0, \ + "Accept short slot assoc only") + +#define CFG_HCF_ENABLED CFG_BOOL( \ + "enable_hcf", \ + 0, \ + "HCF enabled") + +#define CFG_RSN_ENABLED CFG_BOOL( \ + "enable_rsn", \ + 0, \ + "RSN enabled") + +#define CFG_11G_SHORT_PREAMBLE_ENABLED CFG_BOOL( \ + "enable_short_preamble_11g", \ + 0, \ + "Short Preamble Enable") + +#define CFG_11G_SHORT_SLOT_TIME_ENABLED CFG_BOOL( \ + "enable_short_slot_time_11g", \ + 1, \ + "Short Slot time enable") + +#define CFG_CHANNEL_BONDING_MODE CFG_UINT( \ + "channel_bonding_mode", \ + 0, \ + 10, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "channel bonding mode") + +#define CFG_BLOCK_ACK_ENABLED CFG_UINT( \ + "enable_block_ack", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "enable block Ack") +/* + * + * gEnableAMPDUPS - Enable the AMPDUPS + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to set default AMPDUPS + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ + +#define CFG_ENABLE_AMPDUPS CFG_INI_BOOL( \ + "gEnableAMPDUPS", \ + 0, \ + "Enable AMPDU") + +#define CFG_FEATURE_FLAG_ALL \ + CFG(CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY) \ + CFG(CFG_HCF_ENABLED) \ + CFG(CFG_RSN_ENABLED) \ + CFG(CFG_11G_SHORT_PREAMBLE_ENABLED) \ + CFG(CFG_11G_SHORT_SLOT_TIME_ENABLED) \ + CFG(CFG_CHANNEL_BONDING_MODE) \ + CFG(CFG_BLOCK_ACK_ENABLED) \ + CFG(CFG_ENABLE_AMPDUPS) + +#endif /* __CFG_MLME_FEATURE_FLAG_H */ + diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 08632f719ad7..53010192ad97 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -453,6 +453,28 @@ struct wlan_mlme_rates { #define MLME_PROTECTION_ENABLED_OLBC_RIFS 14 #define MLME_PROTECTION_ENABLED_OLBC_OBSS 15 +/** + * struct wlan_mlme_feature_flag - feature related information + * @accept_short_slot_assoc: enable short sloc feature + * @enable_hcf: enable HCF feature + * @enable_rsn: enable RSN for connection + * @enable_short_preamble_11g: enable short preamble for 11g + * @channel_bonding_mode: channel bonding mode + * @enable_block_ack: enable block ack feature + * @enable_ampdu: Enable AMPDU feature + */ + +struct wlan_mlme_feature_flag { + bool accept_short_slot_assoc; + bool enable_hcf; + bool enable_rsn; + bool enable_short_preamble_11g; + bool enable_short_slot_time_11g; + uint32_t channel_bonding_mode; + uint32_t enable_block_ack; + bool enable_ampdu; +}; + /* * struct wlan_mlme_sap_protection_cfg - SAP erp protection config items * @@ -798,6 +820,7 @@ struct wlan_mlme_oce { * @sap_protection_cfg: SAP erp protection related CFG items * @sta: sta CFG Items * @scoring: BSS Scoring related CFG Items + * @feature_flags: Feature flag config items */ struct wlan_mlme_cfg { struct wlan_mlme_edca_params edca_params; @@ -816,6 +839,7 @@ struct wlan_mlme_cfg { struct wlan_mlme_sta_cfg sta; struct wlan_mlme_scoring_cfg scoring; struct wlan_mlme_oce oce; + struct wlan_mlme_feature_flag feature_flags; }; #endif diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 57473a51d4f2..2524295deb52 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -4261,29 +4261,6 @@ enum hdd_link_speed_rpt_type { #define CFG_VHT_ENABLE_GID_FEATURE_MAX (1) #define CFG_VHT_ENABLE_GID_FEATURE_DEFAULT (0) -/* - * - * gEnableAMPDUPS - Enable the AMPDUPS - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to set default AMPDUPS - * - * Related: None - * - * Supported Feature: STA - * - * Usage: Internal/External - * - * - */ - -#define CFG_ENABLE_AMPDUPS_FEATURE "gEnableAMPDUPS" -#define CFG_ENABLE_AMPDUPS_FEATURE_MIN (0) -#define CFG_ENABLE_AMPDUPS_FEATURE_MAX (1) -#define CFG_ENABLE_AMPDUPS_FEATURE_DEFAULT (0) - #define CFG_HT_ENABLE_SMPS_CAP_FEATURE "gEnableHtSMPS" #define CFG_HT_ENABLE_SMPS_CAP_FEATURE_MIN (0) #define CFG_HT_ENABLE_SMPS_CAP_FEATURE_MAX (1) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 355ad26207f5..18b302d7e78a 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1889,12 +1889,6 @@ struct reg_table_entry g_registry_table[] = { CFG_VHT_ENABLE_GID_FEATURE_MIN, CFG_VHT_ENABLE_GID_FEATURE_MAX), - REG_VARIABLE(CFG_ENABLE_AMPDUPS_FEATURE, WLAN_PARAM_Integer, - struct hdd_config, enableAmpduPs, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_ENABLE_AMPDUPS_FEATURE_DEFAULT, - CFG_ENABLE_AMPDUPS_FEATURE_MIN, - CFG_ENABLE_AMPDUPS_FEATURE_MAX), REG_VARIABLE(CFG_HT_ENABLE_SMPS_CAP_FEATURE, WLAN_PARAM_Integer, struct hdd_config, enableHtSmps, @@ -5921,7 +5915,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) smeConfig->csrConfig.enableMuBformee = pConfig->enableMuBformee; smeConfig->csrConfig.enableVhtpAid = pConfig->enableVhtpAid; smeConfig->csrConfig.enableVhtGid = pConfig->enableVhtGid; - smeConfig->csrConfig.enableAmpduPs = pConfig->enableAmpduPs; smeConfig->csrConfig.enableHtSmps = pConfig->enableHtSmps; smeConfig->csrConfig.htSmps = pConfig->htSmps; /* This param cannot be configured from INI */ diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h index 11121456b367..cda39c1d3b4e 100644 --- a/core/mac/inc/wni_cfg.h +++ b/core/mac/inc/wni_cfg.h @@ -58,10 +58,7 @@ enum { WNI_CFG_AUTHENTICATION_TYPE, WNI_CFG_PRIVACY_ENABLED, WNI_CFG_SHORT_PREAMBLE, - WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, WNI_CFG_QOS_ENABLED, - WNI_CFG_HCF_ENABLED, - WNI_CFG_RSN_ENABLED, WNI_CFG_HEART_BEAT_THRESHOLD, WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT, WNI_CFG_MANUFACTURER_NAME, @@ -87,9 +84,7 @@ enum { WNI_CFG_LOCAL_POWER_CONSTRAINT, WNI_CFG_ADMIT_POLICY, WNI_CFG_ADMIT_BWFACTOR, - WNI_CFG_CHANNEL_BONDING_MODE, WNI_CFG_SCAN_CONTROL_LIST, - WNI_CFG_BLOCK_ACK_ENABLED, WNI_CFG_HT_CAP_INFO, WNI_CFG_HT_AMPDU_PARAMS, WNI_CFG_SUPPORTED_MCS_SET, diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c index d0974c806fd9..cd3725390cb3 100644 --- a/core/mac/src/cfg/cfg_api.c +++ b/core/mac/src/cfg/cfg_api.c @@ -736,11 +736,6 @@ QDF_STATUS cfg_get_capability_info(tpAniSirGlobal pMac, uint16_t *pCap, if (LIM_IS_AP_ROLE(sessionEntry)) { pCapInfo->shortSlotTime = sessionEntry->shortSlotTimeSupported; } else { - if (wlan_cfg_get_int(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, - &val) != QDF_STATUS_SUCCESS) { - pe_err("cfg get WNI_CFG_11G_SHORT_SLOT_TIME failed"); - return QDF_STATUS_E_FAILURE; - } /* When in STA mode, we need to check if short slot is * enabled as well as check if the current operating * mode is short slot time and then decide whether to @@ -753,7 +748,7 @@ QDF_STATUS cfg_get_capability_info(tpAniSirGlobal pMac, uint16_t *pCap, * deleting the previous IBSS or in start BSS as part * of coalescing */ - if (val) { + if (pMac->mlme_cfg->feature_flags.enable_short_slot_time_11g) { pCapInfo->shortSlotTime = sessionEntry->shortSlotTimeSupported; } @@ -793,11 +788,7 @@ QDF_STATUS cfg_get_capability_info(tpAniSirGlobal pMac, uint16_t *pCap, /* FIXME : no config defined yet. */ /* Block ack bit */ - if (wlan_cfg_get_int(pMac, WNI_CFG_BLOCK_ACK_ENABLED, &val) != - QDF_STATUS_SUCCESS) { - pe_err("cfg get WNI_CFG_BLOCK_ACK_ENABLED failed"); - return QDF_STATUS_E_FAILURE; - } + val = pMac->mlme_cfg->feature_flags.enable_block_ack; pCapInfo->delayedBA = (uint16_t) ((val >> WNI_CFG_BLOCK_ACK_ENABLED_DELAYED) & 1); pCapInfo->immediateBA = diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c index f6343e1bc638..71ba52009215 100644 --- a/core/mac/src/cfg/cfg_param_name.c +++ b/core/mac/src/cfg/cfg_param_name.c @@ -73,10 +73,7 @@ const char *cfg_get_string(uint16_t cfg_id) CASE_RETURN_STRING(WNI_CFG_AUTHENTICATION_TYPE); CASE_RETURN_STRING(WNI_CFG_PRIVACY_ENABLED); CASE_RETURN_STRING(WNI_CFG_SHORT_PREAMBLE); - CASE_RETURN_STRING(WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY); CASE_RETURN_STRING(WNI_CFG_QOS_ENABLED); - CASE_RETURN_STRING(WNI_CFG_HCF_ENABLED); - CASE_RETURN_STRING(WNI_CFG_RSN_ENABLED); CASE_RETURN_STRING(WNI_CFG_HEART_BEAT_THRESHOLD); CASE_RETURN_STRING(WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT); CASE_RETURN_STRING(WNI_CFG_MANUFACTURER_NAME); @@ -102,9 +99,7 @@ const char *cfg_get_string(uint16_t cfg_id) CASE_RETURN_STRING(WNI_CFG_LOCAL_POWER_CONSTRAINT); CASE_RETURN_STRING(WNI_CFG_ADMIT_POLICY); CASE_RETURN_STRING(WNI_CFG_ADMIT_BWFACTOR); - CASE_RETURN_STRING(WNI_CFG_CHANNEL_BONDING_MODE); CASE_RETURN_STRING(WNI_CFG_SCAN_CONTROL_LIST); - CASE_RETURN_STRING(WNI_CFG_BLOCK_ACK_ENABLED); CASE_RETURN_STRING(WNI_CFG_HT_CAP_INFO); CASE_RETURN_STRING(WNI_CFG_HT_AMPDU_PARAMS); CASE_RETURN_STRING(WNI_CFG_SUPPORTED_MCS_SET); diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c index 856c5c4c35e0..0a34035afbbb 100644 --- a/core/mac/src/cfg/cfg_proc_msg.c +++ b/core/mac/src/cfg/cfg_proc_msg.c @@ -184,30 +184,12 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = { WNI_CFG_SHORT_PREAMBLE_STAMIN, WNI_CFG_SHORT_PREAMBLE_STAMAX, WNI_CFG_SHORT_PREAMBLE_STADEF}, - {WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | - CFG_CTL_RESTART, - WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STAMIN, - WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STAMAX, - WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY_STADEF}, {WNI_CFG_QOS_ENABLED, CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART, WNI_CFG_QOS_ENABLED_STAMIN, WNI_CFG_QOS_ENABLED_STAMAX, WNI_CFG_QOS_ENABLED_STADEF}, - {WNI_CFG_HCF_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | - CFG_CTL_RESTART, - WNI_CFG_HCF_ENABLED_STAMIN, - WNI_CFG_HCF_ENABLED_STAMAX, - WNI_CFG_HCF_ENABLED_STADEF}, - {WNI_CFG_RSN_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | - CFG_CTL_RESTART, - WNI_CFG_RSN_ENABLED_STAMIN, - WNI_CFG_RSN_ENABLED_STAMAX, - WNI_CFG_RSN_ENABLED_STADEF}, {WNI_CFG_HEART_BEAT_THRESHOLD, CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_NTF_LIM, @@ -328,22 +310,10 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = { WNI_CFG_ADMIT_BWFACTOR_STAMIN, WNI_CFG_ADMIT_BWFACTOR_STAMAX, WNI_CFG_ADMIT_BWFACTOR_STADEF}, - {WNI_CFG_CHANNEL_BONDING_MODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | - CFG_CTL_RESTART | CFG_CTL_NTF_LIM, - WNI_CFG_CHANNEL_BONDING_MODE_STAMIN, - WNI_CFG_CHANNEL_BONDING_MODE_STAMAX, - WNI_CFG_CHANNEL_BONDING_MODE_STADEF}, {WNI_CFG_SCAN_CONTROL_LIST, CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, 0, 0, 0}, - {WNI_CFG_BLOCK_ACK_ENABLED, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | - CFG_CTL_RESTART | CFG_CTL_NTF_LIM, - WNI_CFG_BLOCK_ACK_ENABLED_STAMIN, - WNI_CFG_BLOCK_ACK_ENABLED_STAMAX, - WNI_CFG_BLOCK_ACK_ENABLED_STADEF}, {WNI_CFG_HT_CAP_INFO, CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART | CFG_CTL_NTF_LIM, diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 5a7fe2b371a9..fea9633b5d27 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -283,11 +283,7 @@ static QDF_STATUS __lim_init_config(tpAniSirGlobal pMac) pMac->lim.gLimIbssStaLimit = val1; ht_cap_info = &pMac->mlme_cfg->ht_caps.ht_cap_info; - if (wlan_cfg_get_int(pMac, WNI_CFG_CHANNEL_BONDING_MODE, &val2) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve Channel Bonding CFG"); - return QDF_STATUS_E_FAILURE; - } + val2 = pMac->mlme_cfg->feature_flags.channel_bonding_mode; /* channel bonding mode could be set to anything from 0 to 4(Titan had these */ /* modes But for Taurus we have only two modes: enable(>0) or disable(=0) */ @@ -1902,16 +1898,10 @@ QDF_STATUS lim_update_short_slot(tpAniSirGlobal pMac, tSirSmeApNewCaps apNewCaps; uint32_t nShortSlot; - uint32_t val = 0; uint32_t phyMode; /* Check Admin mode first. If it is disabled just return */ - if (wlan_cfg_get_int(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val) - != QDF_STATUS_SUCCESS) { - pe_err("cfg get WNI_CFG_11G_SHORT_SLOT_TIME failed"); - return QDF_STATUS_E_FAILURE; - } - if (val == false) + if (!pMac->mlme_cfg->feature_flags.enable_short_slot_time_11g) return QDF_STATUS_SUCCESS; /* Check for 11a mode or 11b mode. In both cases return since slot time is constant and cannot/should not change in beacon */ diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 8d764e53674d..30781b14e6e2 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -105,8 +105,6 @@ lim_compare_capabilities(tpAniSirGlobal pMac, tSirMacCapabilityInfo *pLocalCapabs, tpPESession psessionEntry) { - uint32_t val; - if (LIM_IS_AP_ROLE(psessionEntry) && (pAssocReq->capabilityInfo.ibss)) { /* Requesting STA asserting IBSS capability. */ @@ -144,13 +142,7 @@ lim_compare_capabilities(tpAniSirGlobal pMac, */ if (LIM_IS_AP_ROLE(psessionEntry) && (pLocalCapabs->shortSlotTime == 1)) { - if (wlan_cfg_get_int - (pMac, WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, - &val) != QDF_STATUS_SUCCESS) { - pe_err("error getting WNI_CFG_FORCE_SHORT_SLOT_ASSOC_ONLY"); - return false; - } - if (val) { + if (pMac->mlme_cfg->feature_flags.accept_short_slot_assoc) { if (pAssocReq->capabilityInfo.shortSlotTime != pLocalCapabs->shortSlotTime) { pe_err("AP rejects association as station doesn't support shortslot time"); @@ -1252,8 +1244,7 @@ lim_decide_short_slot(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, mac_ctx->lim.gLimNoShortSlotParams.numNonShortSlotSta, sta_ds->staAddr); - wlan_cfg_get_int(mac_ctx, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, - &val); + val = mac_ctx->mlme_cfg->feature_flags.enable_short_slot_time_11g; if (LIM_IS_AP_ROLE(session_entry)) { non_short_slot_sta_count = diff --git a/core/mac/src/pe/lim/lim_process_cfg_updates.c b/core/mac/src/pe/lim/lim_process_cfg_updates.c index aa0d566bdbd1..d0c82430dba7 100644 --- a/core/mac/src/pe/lim/lim_process_cfg_updates.c +++ b/core/mac/src/pe/lim/lim_process_cfg_updates.c @@ -335,9 +335,7 @@ static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry) pe_err("cfg get qos enabled failed"); psessionEntry->limQosEnabled = (val) ? 1 : 0; } - if (wlan_cfg_get_int(pMac, WNI_CFG_HCF_ENABLED, &val) != QDF_STATUS_SUCCESS) - pe_err("cfg get hcf enabled failed"); - psessionEntry->limHcfEnabled = (val) ? 1 : 0; + psessionEntry->limHcfEnabled = pMac->mlme_cfg->feature_flags.enable_hcf; /* AP: WSM should enable HCF as well, for STA enable WSM only after */ /* association response is received */ diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c index 1d1f3e2fd022..a9c4ade22203 100644 --- a/core/mac/src/pe/lim/lim_sme_req_utils.c +++ b/core/mac/src/pe/lim/lim_sme_req_utils.c @@ -66,10 +66,7 @@ lim_is_rsn_ie_valid_in_sme_req_message(tpAniSirGlobal mac_ctx, tpSirRSNie rsn_ie &privacy) != QDF_STATUS_SUCCESS) pe_warn("Unable to retrieve POI from CFG"); - if (wlan_cfg_get_int(mac_ctx, WNI_CFG_RSN_ENABLED, &val) - != QDF_STATUS_SUCCESS) - pe_warn("Unable to retrieve RSN_ENABLED from CFG"); - + val = mac_ctx->mlme_cfg->feature_flags.enable_rsn; if (rsn_ie->length && (!privacy || !val)) { /* Privacy & RSN not enabled in CFG. * In order to allow mixed mode for Guest access @@ -231,10 +228,7 @@ lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(tpAniSirGlobal mac_ctx, &privacy) != QDF_STATUS_SUCCESS) pe_warn("Unable to retrieve POI from CFG"); - if (wlan_cfg_get_int(mac_ctx, WNI_CFG_RSN_ENABLED, - &val) != QDF_STATUS_SUCCESS) - pe_warn("Unable to retrieve RSN_ENABLED from CFG"); - + val = mac_ctx->mlme_cfg->feature_flags.enable_rsn; if (rsn_ie->length && (!privacy || !val)) { /* * Privacy & RSN not enabled in CFG. diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 22a9130488e1..14a4fcd74b38 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -1574,7 +1574,7 @@ lim_update_short_slot_time(tpAniSirGlobal mac_ctx, tSirMacAddr peer_mac_addr, mac_ctx->lim.gLimNoShortSlotParams. numNonShortSlotSta++; } - wlan_cfg_get_int(mac_ctx, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val); + val = mac_ctx->mlme_cfg->feature_flags.enable_short_slot_time_11g; /* * Here we check if we are AP role and short slot enabled * (both admin and oper modes) but we have atleast one STA @@ -4160,13 +4160,8 @@ lim_enable_short_preamble(tpAniSirGlobal pMac, uint8_t enable, if (!val) return QDF_STATUS_SUCCESS; - if (wlan_cfg_get_int(pMac, WNI_CFG_11G_SHORT_PREAMBLE_ENABLED, &val) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve 11G short preamble switching enabled flag"); - return QDF_STATUS_E_FAILURE; - } - - if (!val) /* 11G short preamble switching is disabled. */ + /* 11G short preamble switching is disabled. */ + if (!pMac->mlme_cfg->feature_flags.enable_short_preamble_11g) return QDF_STATUS_SUCCESS; if (LIM_IS_AP_ROLE(psessionEntry)) { diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index ebb0aa739bb4..a20a77d7e2bf 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -6048,7 +6048,7 @@ populate_dot11f_timing_advert_frame(tpAniSirGlobal mac_ctx, if (val) frame->Capabilities.apsd = 1; - wlan_cfg_get_int(mac_ctx, WNI_CFG_BLOCK_ACK_ENABLED, &val); + val = mac_ctx->mlme_cfg->feature_flags.enable_block_ack; frame->Capabilities.delayedBA = (uint16_t)((val >> WNI_CFG_BLOCK_ACK_ENABLED_DELAYED) & 1); frame->Capabilities.immediateBA = diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 3ce7476c018d..5ef949ba6616 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -499,7 +499,6 @@ struct csr_config { bool enableVhtFor24GHz; uint8_t enableVhtpAid; uint8_t enableVhtGid; - uint8_t enableAmpduPs; uint8_t enableHtSmps; uint8_t htSmps; bool send_smps_action; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index a021f3d32a11..c837955642c6 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -56,6 +56,8 @@ #include #include #include "wlan_mlme_public_struct.h" +#include "cfg_mlme.h" +#include "cfg_ucfg_api.h" #define MAX_PWR_FCC_CHAN_12 8 #define MAX_PWR_FCC_CHAN_13 2 @@ -1330,8 +1332,10 @@ void csr_set_global_cfgs(tpAniSirGlobal pMac) * Once session is established we will use the session related params * stored in PE session for CB mode */ - cfg_set_int(pMac, WNI_CFG_CHANNEL_BONDING_MODE, - !!(pMac->roam.configParam.channelBondingMode5GHz)); + if (cfg_in_range(CFG_CHANNEL_BONDING_MODE, + pMac->roam.configParam.channelBondingMode5GHz)) + pMac->mlme_cfg->feature_flags.channel_bonding_mode = + pMac->roam.configParam.channelBondingMode5GHz; cfg_set_int(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, pMac->roam.configParam.HeartbeatThresh24); @@ -3020,7 +3024,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pParam->enableVhtFor24GHz; pMac->roam.configParam.enableVhtpAid = pParam->enableVhtpAid; pMac->roam.configParam.enableVhtGid = pParam->enableVhtGid; - pMac->roam.configParam.enableAmpduPs = pParam->enableAmpduPs; pMac->roam.configParam.enableHtSmps = pParam->enableHtSmps; pMac->roam.configParam.htSmps = pParam->htSmps; pMac->roam.configParam.send_smps_action = @@ -4976,7 +4979,7 @@ void csr_set_cfg_privacy(tpAniSirGlobal pMac, struct csr_roam_profile *pProfile, } cfg_set_int(pMac, WNI_CFG_PRIVACY_ENABLED, PrivacyEnabled); - cfg_set_int(pMac, WNI_CFG_RSN_ENABLED, RsnEnabled); + pMac->mlme_cfg->feature_flags.enable_rsn = RsnEnabled; cfg_set_str(pMac, WNI_CFG_WEP_DEFAULT_KEY_1, Key0, Key0Length); cfg_set_str(pMac, WNI_CFG_WEP_DEFAULT_KEY_2, Key1, Key1Length); cfg_set_str(pMac, WNI_CFG_WEP_DEFAULT_KEY_3, Key2, Key2Length); @@ -5373,8 +5376,8 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal pMac, uint32_t sessionId, /* encryption type */ csr_set_cfg_privacy(pMac, pProfile, (bool) pBssConfig->BssCap.privacy); /* short slot time */ - cfg_set_int(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, - pBssConfig->uShortSlotTime); + pMac->mlme_cfg->feature_flags.enable_short_slot_time_11g = + pBssConfig->uShortSlotTime; /* 11d */ cfg_set_int(pMac, WNI_CFG_11D_ENABLED, ((pBssConfig->f11hSupport) ? pBssConfig->f11hSupport : @@ -16047,7 +16050,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, (uint8_t) pMac->roam.configParam.enableVhtGid; csr_join_req->enableAmpduPs = - (uint8_t) pMac->roam.configParam.enableAmpduPs; + (uint8_t)pMac->mlme_cfg->feature_flags.enable_ampdu; csr_join_req->enableHtSmps = (uint8_t) pMac->roam.configParam.enableHtSmps; diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 0abc73681794..12b0fd2222a7 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2714,13 +2714,8 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, selfCaps.pbcc = 0; selfCaps.channelAgility = 0; - if (wlan_cfg_get_int(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, - &val) != QDF_STATUS_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED"); - return QDF_STATUS_E_FAILURE; - } - if (val) + + if (pMac->mlme_cfg->feature_flags.enable_short_slot_time_11g) selfCaps.shortSlotTime = 1; if (wlan_cfg_get_int(pMac, WNI_CFG_11H_ENABLED, &val) != QDF_STATUS_SUCCESS) { @@ -2749,12 +2744,7 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, selfCaps.rrm = pMac->rrm.rrmSmeContext.rrmConfig.rrm_enabled; - if (wlan_cfg_get_int(pMac, WNI_CFG_BLOCK_ACK_ENABLED, &val) != - QDF_STATUS_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get WNI_CFG_BLOCK_ACK_ENABLED"); - return QDF_STATUS_E_FAILURE; - } + val = pMac->mlme_cfg->feature_flags.enable_block_ack; selfCaps.delayedBA = (uint16_t) ((val >> WNI_CFG_BLOCK_ACK_ENABLED_DELAYED) & 1); selfCaps.immediateBA =