diff --git a/mlme/core/src/wlan_mlme_main.c b/mlme/core/src/wlan_mlme_main.c index 882055520c..f54da9d90f 100644 --- a/mlme/core/src/wlan_mlme_main.c +++ b/mlme/core/src/wlan_mlme_main.c @@ -549,6 +549,13 @@ static void mlme_init_rates_in_cfg(struct wlan_objmgr_psoc *psoc, CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2); } +static void mlme_init_dfs_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_dfs_cfg *dfs_cfg) +{ + dfs_cfg->dfs_master_capable = cfg_get(psoc, + CFG_ENABLE_DFS_MASTER_CAPABILITY); +} + static void mlme_init_feature_flag_in_cfg( struct wlan_objmgr_psoc *psoc, struct wlan_mlme_feature_flag *feature_flags) @@ -1169,6 +1176,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) mlme_init_mbo_cfg(psoc, &mlme_cfg->mbo_cfg); mlme_init_qos_cfg(psoc, &mlme_cfg->qos_mlme_params); mlme_init_rates_in_cfg(psoc, &mlme_cfg->rates); + mlme_init_dfs_cfg(psoc, &mlme_cfg->dfs_cfg); mlme_init_sap_protection_cfg(psoc, &mlme_cfg->sap_protection_cfg); mlme_init_vht_cap_cfg(psoc, &mlme_cfg->vht_caps.vht_cap_info); mlme_init_chainmask_cfg(psoc, &mlme_cfg->chainmask_cfg); diff --git a/mlme/dispatcher/inc/cfg_mlme.h b/mlme/dispatcher/inc/cfg_mlme.h index b58556b5bc..2bcb0e0291 100644 --- a/mlme/dispatcher/inc/cfg_mlme.h +++ b/mlme/dispatcher/inc/cfg_mlme.h @@ -31,6 +31,7 @@ #include "cfg_mlme_he_caps.h" #include "cfg_mlme_lfr.h" #include "cfg_mlme_obss_ht40.h" +#include "cfg_mlme_dfs.h" #include "cfg_mlme_mbo.h" #include "cfg_mlme_vht_caps.h" #include "cfg_qos.h" @@ -51,6 +52,7 @@ #define CFG_MLME_ALL \ CFG_ACS_ALL \ CFG_CHAINMASK_ALL \ + CFG_DFS_ALL \ CFG_EDCA_PARAMS_ALL \ CFG_FEATURE_FLAG_ALL \ CFG_GENERIC_ALL \ diff --git a/mlme/dispatcher/inc/cfg_mlme_dfs.h b/mlme/dispatcher/inc/cfg_mlme_dfs.h new file mode 100644 index 0000000000..e3dd2c5838 --- /dev/null +++ b/mlme/dispatcher/inc/cfg_mlme_dfs.h @@ -0,0 +1,52 @@ +/* + * 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_DFS_H +#define __CFG_MLME_DFS_H + +/* + * + * gEnableDFSMasterCap - Enable DFS master capability + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable the DFS master capability. + * Disabling it will cause driver to not advertise the spectrum + * management capability + * Related: NA. + * + * upported Feature: DFS + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_DFS_MASTER_CAPABILITY CFG_INI_BOOL( \ + "gEnableDFSMasterCap", \ + 0, \ + "DFS master mode capability") + +#define CFG_DFS_ALL \ + CFG(CFG_ENABLE_DFS_MASTER_CAPABILITY) + +#endif /* __CFG_MLME_DFS_H */ diff --git a/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 0243a343d3..01fb13782d 100644 --- a/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -266,6 +266,14 @@ struct wlan_mlme_cfg_sap { uint8_t reduced_beacon_interval; }; +/** + * struct wlan_mlme_dfs_cfg - DFS Capabilities related config items + * @dfs_master_capable: Is DFS master mode support enabled + */ +struct wlan_mlme_dfs_cfg { + bool dfs_master_capable; +}; + /** * struct wlan_mlme_mbo - Multiband Operation related ini configs * @mbo_candidate_rssi_thres: @@ -1096,6 +1104,7 @@ struct wlan_mlme_wep_cfg { * @qos_mlme_params: QOS CFG Items * @rates: Rates related cfg items * @product_details: product details related CFG Items + * @dfs_cfg: DFS related CFG Items * @sap_protection_cfg: SAP erp protection related CFG items * @sap_cfg: sap CFG items * @sta: sta CFG Items @@ -1121,6 +1130,7 @@ struct wlan_mlme_cfg { struct wlan_mlme_qos qos_mlme_params; struct wlan_mlme_rates rates; struct wlan_mlme_product_details_cfg product_details; + struct wlan_mlme_dfs_cfg dfs_cfg; struct wlan_mlme_sap_protection sap_protection_cfg; struct wlan_mlme_cfg_sap sap_cfg; struct wlan_mlme_sta_cfg sta; diff --git a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 4678966978..633bf26cbb 100644 --- a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -524,6 +524,17 @@ QDF_STATUS ucfg_mlme_get_sta_keep_alive_period(struct wlan_objmgr_psoc *psoc, uint32_t *val); +/* + * ucfg_mlme_get_dfs_master_capability() - Get the dfs master capability + * @psoc: pointer to psoc object + * @val: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc *psoc, + bool *val); + /** * ucfg_mlme_get_pmkid_modes() - Get PMKID modes * @psoc: pointer to psoc object diff --git a/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 09ddc0e467..4114d7ade0 100644 --- a/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -121,6 +121,24 @@ ucfg_mlme_get_sta_keep_alive_period(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc *psoc, + bool *val) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *val = cfg_default(CFG_ENABLE_DFS_MASTER_CAPABILITY); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + *val = mlme_obj->cfg.dfs_cfg.dfs_master_capable; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_pmkid_modes(struct wlan_objmgr_psoc *psoc, uint32_t *val)