diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 25920de55a..214044646b 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1942,6 +1942,18 @@ static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc, } #endif +static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_reg *reg) +{ + reg->self_gen_frm_pwr = cfg_get(psoc, CFG_SELF_GEN_FRM_PWR); + reg->etsi13_srd_chan_in_master_mode = + cfg_get(psoc, CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE); + reg->restart_beaconing_on_ch_avoid = + cfg_get(psoc, CFG_RESTART_BEACONING_ON_CH_AVOID); + reg->indoor_channel_support = cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT); + reg->scan_11d_interval = cfg_get(psoc, CFG_SCAN_11D_INTERVAL); +} + QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) { struct wlan_mlme_psoc_obj *mlme_obj; @@ -1989,6 +2001,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) mlme_init_fe_wlm_in_cfg(psoc, &mlme_cfg->wlm_config); mlme_init_fe_rrm_in_cfg(psoc, &mlme_cfg->rrm_config); mlme_init_mwc_cfg(psoc, &mlme_cfg->mwc); + mlme_init_reg_cfg(psoc, &mlme_cfg->reg); return status; } diff --git a/components/mlme/dispatcher/inc/cfg_mlme.h b/components/mlme/dispatcher/inc/cfg_mlme.h index 92f7fad610..47c0c387a4 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme.h +++ b/components/mlme/dispatcher/inc/cfg_mlme.h @@ -56,6 +56,7 @@ #include "cfg_mlme_fe_wlm.h" #include "cfg_mlme_fe_rrm.h" #include "cfg_mlme_mwc.h" +#include "cfg_mlme_reg.h" /* Please Maintain Alphabetic Order here */ #define CFG_MLME_ALL \ @@ -81,6 +82,7 @@ CFG_POWERSAVE_ALL \ CFG_QOS_ALL \ CFG_RATES_ALL \ + CFG_REG_ALL \ CFG_SAP_ALL \ CFG_SAP_PROTECTION_ALL \ CFG_SCORING_ALL \ diff --git a/components/mlme/dispatcher/inc/cfg_mlme_reg.h b/components/mlme/dispatcher/inc/cfg_mlme_reg.h new file mode 100644 index 0000000000..ab3cefcf4d --- /dev/null +++ b/components/mlme/dispatcher/inc/cfg_mlme_reg.h @@ -0,0 +1,166 @@ +/* + * 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 configuration definitions for MLME REG. + */ + +#ifndef CFG_MLME_REG_H__ +#define CFG_MLME_REG_H__ + +/* + * + * gSelfGenFrmPwr - self-generated frame power in tx chain mask + * for CCK rates + * @Min: 0 + * @Max: 0xffff + * @Default: 0 + * + * gSelfGenFrmPwr is to set self-generated frame power in tx chain mask + * for CCK rates + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_SELF_GEN_FRM_PWR CFG_INI_UINT( \ + "gSelfGenFrmPwr", \ + 0, \ + 0xffff, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "set the self gen power value") + +/* + * + * etsi13_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in + * master mode PCL and ACS functionality + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * etsi13_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in + * master mode PCL and ACS functionality + * + * Related: None + * + * Supported Feature: SAP/P2P-GO + * + * Usage: Internal/External + * + * + */ +#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE CFG_INI_BOOL( \ + "etsi13_srd_chan_in_master_mode", \ + 0, \ + "enable/disable ETSI SRD channels in master mode") + +/* + * + * restart_beaconing_on_chan_avoid_event - control the beaconing entity to move + * away from active LTE channels + * @Min: 0 + * @Max: 2 + * @Default: 1 + * + * This ini is used to control the beaconing entity (SAP/GO) to move away from + * active LTE channels when channel avoidance event is received + * restart_beaconing_on_chan_avoid_event=0: Don't allow beaconing entity move + * from active LTE channels + * restart_beaconing_on_chan_avoid_event=1: Allow beaconing entity move from + * active LTE channels + * restart_beaconing_on_chan_avoid_event=2: Allow beaconing entity move from + * 2.4G active LTE channels only + * + * Related: None + * + * Supported Feature: channel avoidance + * + * Usage: Internal/External + * + * + */ +#define CFG_RESTART_BEACONING_ON_CH_AVOID CFG_INI_UINT( \ + "restart_beaconing_on_chan_avoid_event", \ + 0, \ + 2, \ + 1, \ + CFG_VALUE_OR_DEFAULT, \ + "control the beaconing entity to move away from active LTE channels") + +/* + * + * gindoor_channel_support - support to start sap in indoor channel + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is to support to start sap in indoor channel. + * Customer can config this item to enable/disable sap in indoor channel + * + * Related: None + * + * Supported Feature: SAP + * + * Usage: External + * + * + */ +#define CFG_INDOOR_CHANNEL_SUPPORT CFG_INI_BOOL( \ + "gindoor_channel_support", \ + 0, \ + "enable/disable sap in indoor channel") + +/* + * + * scan_11d_interval - 11d scan interval in ms + * @Min: 1 sec + * @Max: 10 hr + * @Default: 1 hr + * + * This ini sets the 11d scan interval in FW + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * + */ + +#define CFG_SCAN_11D_INTERVAL CFG_INI_UINT( \ + "scan_11d_interval", \ + 1000, \ + 36000000, \ + 3600000, \ + CFG_VALUE_OR_DEFAULT, \ + "set the 11d scan interval in FW") + +#define CFG_REG_ALL \ + CFG(CFG_SELF_GEN_FRM_PWR) \ + CFG(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE) \ + CFG(CFG_RESTART_BEACONING_ON_CH_AVOID) \ + CFG(CFG_INDOOR_CHANNEL_SUPPORT) \ + CFG(CFG_SCAN_11D_INTERVAL) + +#endif /* CFG_MLME_REG_H__ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 0d4035bafd..6b76247b6f 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2061,4 +2061,15 @@ QDF_STATUS wlan_mlme_is_imps_enabled(struct wlan_objmgr_psoc *psoc, void wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params, uint8_t *data); +/* + * wlan_mlme_get_self_gen_frm_pwr() - get self gen frm pwr + * @psoc: pointer to psoc object + * @val: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc, + uint32_t *value); + #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 4e76a0ecf2..b61635f8d5 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1767,6 +1767,24 @@ struct wlan_mlme_mwc { }; #endif +/** + * struct wlan_mlme_reg - REG related configs + * @self_gen_frm_pwr: self-generated frame power in tx chain mask + * for CCK rates + * @etsi13_srd_chan_in_master_mode: etsi13 srd chan in master mode + * @restart_beaconing_on_ch_avoid: restart beaconing on ch avoid + * @indoor_channel_support: indoor channel support + * @scan_11d_interval: scan 11d interval + */ +struct wlan_mlme_reg { + uint32_t self_gen_frm_pwr; + bool etsi13_srd_chan_in_master_mode; + enum restart_beaconing_on_ch_avoid_rule + restart_beaconing_on_ch_avoid; + bool indoor_channel_support; + uint32_t scan_11d_interval; +}; + /** * struct wlan_mlme_cfg - MLME config items * @chainmask_cfg: VHT chainmask related cfg items @@ -1803,6 +1821,7 @@ struct wlan_mlme_mwc { * @wlm_config: WLM related CFG items * @rrm_config: RRM related CFG items * @mwc: MWC related CFG items + * @reg: REG related CFG itmes */ struct wlan_mlme_cfg { struct wlan_mlme_chainmask chainmask_cfg; @@ -1841,6 +1860,7 @@ struct wlan_mlme_cfg { struct wlan_mlme_fe_wlm wlm_config; struct wlan_mlme_fe_rrm rrm_config; struct wlan_mlme_mwc mwc; + struct wlan_mlme_reg reg; }; #endif diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index bde4ce7675..e0140312cc 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -3357,4 +3357,49 @@ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc, uint32_t *val); #endif +/** + * ucfg_mlme_get_etsi13_srd_chan_in_master_mode - get etsi13 srd chan + * in master mode + * @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_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, + bool *value); + +/** + * ucfg_mlme_restart_beaconing_on_ch_avoid() - get restart beaconing on ch avoid + * @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_restart_beaconing_on_ch_avoid(struct wlan_objmgr_psoc *psoc, + uint32_t *value); + +/** + * ucfg_mlme_get_indoor_channel_support() - get indoor channel support + * @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_indoor_channel_support(struct wlan_objmgr_psoc *psoc, + bool *value); + +/** + * ucfg_mlme_get_scan_11d_interval() - get scan 11d interval + * @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_scan_11d_interval(struct wlan_objmgr_psoc *psoc, + uint32_t *value); + #endif /* _WLAN_MLME_UCFG_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 8b336092f9..a6c6ba5fdc 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -3020,3 +3020,21 @@ void wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params, wlan_mlme_get_cfg_str(data, &wps_params->wps_uuid, &len); } + +QDF_STATUS +wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc, + uint32_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_SELF_GEN_FRM_PWR); + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.reg.self_gen_frm_pwr; + + return QDF_STATUS_SUCCESS; +} diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 9bc700b919..f423c3f993 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1248,3 +1248,75 @@ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } #endif + +QDF_STATUS +ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE); + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_INVAL; + } + + *value = mlme_obj->cfg.reg.etsi13_srd_chan_in_master_mode; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_get_restart_beaconing_on_ch_avoid(struct wlan_objmgr_psoc *psoc, + uint32_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_RESTART_BEACONING_ON_CH_AVOID); + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_INVAL; + } + + *value = mlme_obj->cfg.reg.restart_beaconing_on_ch_avoid; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_get_indoor_channel_support(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_INDOOR_CHANNEL_SUPPORT); + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_INVAL; + } + + *value = mlme_obj->cfg.reg.indoor_channel_support; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc, + uint32_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_SCAN_11D_INTERVAL); + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_INVAL; + } + + *value = mlme_obj->cfg.reg.scan_11d_interval; + + return QDF_STATUS_SUCCESS; +} diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h index 761b3e1be2..51980eb567 100644 --- a/core/cds/inc/cds_config.h +++ b/core/cds/inc/cds_config.h @@ -79,7 +79,6 @@ enum active_apf_mode { * @enable_dp_rx_threads: enable dp rx threads * @is_lpass_enabled: Indicate whether LPASS is enabled or not * @tx_chain_mask_cck: Tx chain mask enabled or not - * @self_gen_frm_pwr: Self gen from power * @sub_20_channel_width: Sub 20 MHz ch width, ini intersected with fw cap * @is_fw_timeout: Indicate whether crash host when fw timesout or not * @active_uc_apf_mode: Setting that determines how APF is applied in active @@ -117,7 +116,6 @@ struct cds_config_info { #ifdef WLAN_FEATURE_LPSS bool is_lpass_enabled; #endif - uint16_t self_gen_frm_pwr; enum cfg_sub_20_channel_width sub_20_channel_width; uint8_t max_msdus_per_rxinorderind; bool self_recovery_enabled; diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 4ce1b62fa2..4ca3f084dd 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -99,11 +99,6 @@ struct hdd_context; #define CFG_ENABLE_11D_IN_WORLD_MODE_MAX (1) #define CFG_ENABLE_11D_IN_WORLD_MODE_DEFAULT (0) -#define CFG_REG_CHANGE_DEF_COUNTRY_NAME "gRegulatoryChangeCountry" -#define CFG_REG_CHANGE_DEF_COUNTRY_DEFAULT (0) -#define CFG_REG_CHANGE_DEF_COUNTRY_MIN (0) -#define CFG_REG_CHANGE_DEF_COUNTRY_MAX (1) - /* * * gAdvertiseConcurrentOperation - Iface combination advertising @@ -1738,39 +1733,6 @@ enum hdd_link_speed_rpt_type { #define CFG_GO_11AC_OVERRIDE_MAX (1) #define CFG_GO_11AC_OVERRIDE_DEFAULT (1) -/* - * set the self gen power value from - * 0 to 0xffff - */ -#define CFG_SELF_GEN_FRM_PWR "gSelfGenFrmPwr" -#define CFG_SELF_GEN_FRM_PWR_MIN (0) -#define CFG_SELF_GEN_FRM_PWR_MAX (0xffff) -#define CFG_SELF_GEN_FRM_PWR_DEFAULT (0) - -/* - * - * etsi13_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in - * master mode PCL and ACS functionality - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * etsi13_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in - * master mode PCL and ACS functionality - * - * Related: None - * - * Supported Feature: SAP/P2P-GO - * - * Usage: Internal/External - * - * - */ -#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE "etsi13_srd_chan_in_master_mode" -#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE_DEF (0) -#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE_MIN (0) -#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE_MAX (1) - /* * gPNOChannelPrediction will allow user to enable/disable the * PNO channel prediction feature. @@ -1893,46 +1855,6 @@ enum hdd_link_speed_rpt_type { #define CFG_ADAPT_DWELL_WIFI_THRESH_MAX (100) #define CFG_ADAPT_DWELL_WIFI_THRESH_DEFAULT (10) -/* - * - * restart_beaconing_on_chan_avoid_event - control the beaconing entity to move - * away from active LTE channels - * @Min: 0 - * @Max: 2 - * @Default: 1 - * - * This ini is used to control the beaconing entity (SAP/GO) to move away from - * active LTE channels when channel avoidance event is received - * restart_beaconing_on_chan_avoid_event=0: Don't allow beaconing entity move - * from active LTE channels - * restart_beaconing_on_chan_avoid_event=1: Allow beaconing entity move from - * active LTE channels - * restart_beaconing_on_chan_avoid_event=2: Allow beaconing entity move from - * 2.4G active LTE channels only - * - * Related: None - * - * Supported Feature: channel avoidance - * - * Usage: Internal/External - * - * - */ -#define CFG_RESTART_BEACONING_ON_CH_AVOID_NAME "restart_beaconing_on_chan_avoid_event" -#define CFG_RESTART_BEACONING_ON_CH_AVOID_MIN (CH_AVOID_RULE_DO_NOT_RESTART) -#define CFG_RESTART_BEACONING_ON_CH_AVOID_MAX (CH_AVOID_RULE_RESTART_24G_ONLY) -#define CFG_RESTART_BEACONING_ON_CH_AVOID_DEFAULT (CH_AVOID_RULE_RESTART) - -/* - * Support to start sap in indoor channel - * Customer can config this item to enable/disable sap in indoor channel - * Default: Disable - */ -#define CFG_INDOOR_CHANNEL_SUPPORT_NAME "gindoor_channel_support" -#define CFG_INDOOR_CHANNEL_SUPPORT_MIN (0) -#define CFG_INDOOR_CHANNEL_SUPPORT_MAX (1) -#define CFG_INDOOR_CHANNEL_SUPPORT_DEFAULT (0) - /* * * gActiveUcBpfMode - Control UC active APF mode @@ -2266,28 +2188,6 @@ enum hdd_link_speed_rpt_type { #define CFG_LPRx_MAX (1) #define CFG_LPRx_DEFAULT (1) -/* - * - * scan_11d_interval - 11d scan interval in ms - * @Min: 1 sec - * @Max: 10 hr - * @Default: 1 hr - * - * This ini sets the 11d scan interval in FW - * - * - * - * Supported Feature: STA - * - * Usage: External - * - * - */ - -#define CFG_SCAN_11D_INTERVAL_NAME "scan_11d_interval" -#define CFG_SCAN_11D_INTERVAL_DEFAULT (3600000) -#define CFG_SCAN_11D_INTERVAL_MIN (1000) -#define CFG_SCAN_11D_INTERVAL_MAX (36000000) /* * * is_bssid_hint_priority - Set priority for connection with bssid_hint @@ -2720,7 +2620,6 @@ struct hdd_config { uint32_t ibssTxSpEndInactivityTime; uint32_t ibssPsWarmupTime; uint32_t ibssPs1RxChainInAtimEnable; - bool fRegChangeDefCountry; bool advertiseConcurrentOperation; #ifdef DHCP_SERVER_OFFLOAD uint8_t dhcpServerIP[IPADDR_STRING_LENGTH]; @@ -2729,8 +2628,6 @@ struct hdd_config { uint8_t sap_11ac_override; uint8_t go_11ac_override; uint8_t max_scan_count; - bool etsi13_srd_chan_in_master_mode; - uint16_t self_gen_frm_pwr; #ifdef FEATURE_WLAN_SCAN_PNO bool pno_channel_prediction; uint8_t top_k_num_of_channels; @@ -2765,11 +2662,8 @@ struct hdd_config { uint8_t adapt_dwell_passive_mon_intval; uint8_t adapt_dwell_wifi_act_threshold; bool bug_report_for_no_scan_results; - bool indoor_channel_support; uint16_t sap_tx_leakage_threshold; bool sap_internal_restart; - enum restart_beaconing_on_ch_avoid_rule - restart_beaconing_on_chan_avoid_event; enum active_apf_mode active_uc_apf_mode; enum active_apf_mode active_mc_bc_apf_mode; uint8_t he_dynamic_frag_support; @@ -2791,7 +2685,6 @@ struct hdd_config { uint32_t mawc_nlo_max_scan_interval; bool enable_11d_in_world_mode; bool enable_lprx; - uint32_t scan_11d_interval; bool is_bssid_hint_priority; #ifdef WLAN_FEATURE_SAE bool is_sae_enabled; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b7f0839a1f..46a1f8aa54 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -353,13 +353,6 @@ struct reg_table_entry g_registry_table[] = { CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MIN, CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MAX), - REG_VARIABLE(CFG_REG_CHANGE_DEF_COUNTRY_NAME, WLAN_PARAM_Integer, - struct hdd_config, fRegChangeDefCountry, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_REG_CHANGE_DEF_COUNTRY_DEFAULT, - CFG_REG_CHANGE_DEF_COUNTRY_MIN, - CFG_REG_CHANGE_DEF_COUNTRY_MAX), - REG_VARIABLE(CFG_INITIAL_DWELL_TIME_NAME, WLAN_PARAM_Integer, struct hdd_config, nInitialDwellTime, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -428,13 +421,6 @@ struct reg_table_entry g_registry_table[] = { CFG_MAX_SCAN_COUNT_MIN, CFG_MAX_SCAN_COUNT_MAX), - REG_VARIABLE(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE, WLAN_PARAM_Integer, - struct hdd_config, etsi13_srd_chan_in_master_mode, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE_DEF, - CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE_MIN, - CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE_MAX), - #ifdef FEATURE_WLAN_SCAN_PNO REG_VARIABLE(CFG_PNO_CHANNEL_PREDICTION_NAME, WLAN_PARAM_Integer, struct hdd_config, pno_channel_prediction, @@ -473,12 +459,6 @@ struct reg_table_entry g_registry_table[] = { CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_MIN, CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_MAX), #endif - REG_VARIABLE(CFG_SELF_GEN_FRM_PWR, WLAN_PARAM_Integer, - struct hdd_config, self_gen_frm_pwr, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_SELF_GEN_FRM_PWR_DEFAULT, - CFG_SELF_GEN_FRM_PWR_MIN, - CFG_SELF_GEN_FRM_PWR_MAX), #ifdef FEATURE_LFR_SUBNET_DETECTION REG_VARIABLE(CFG_ENABLE_LFR_SUBNET_DETECTION, WLAN_PARAM_Integer, @@ -587,21 +567,6 @@ struct reg_table_entry g_registry_table[] = { CFG_ADAPT_DWELL_WIFI_THRESH_MIN, CFG_ADAPT_DWELL_WIFI_THRESH_MAX), - REG_VARIABLE(CFG_INDOOR_CHANNEL_SUPPORT_NAME, - WLAN_PARAM_Integer, - struct hdd_config, indoor_channel_support, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_INDOOR_CHANNEL_SUPPORT_DEFAULT, - CFG_INDOOR_CHANNEL_SUPPORT_MIN, - CFG_INDOOR_CHANNEL_SUPPORT_MAX), - - REG_VARIABLE(CFG_RESTART_BEACONING_ON_CH_AVOID_NAME, WLAN_PARAM_Integer, - struct hdd_config, restart_beaconing_on_chan_avoid_event, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_RESTART_BEACONING_ON_CH_AVOID_DEFAULT, - CFG_RESTART_BEACONING_ON_CH_AVOID_MIN, - CFG_RESTART_BEACONING_ON_CH_AVOID_MAX), - REG_VARIABLE(CFG_ACTIVE_UC_APF_MODE_NAME, WLAN_PARAM_Integer, struct hdd_config, active_uc_apf_mode, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -710,13 +675,6 @@ struct reg_table_entry g_registry_table[] = { CFG_LPRx_MIN, CFG_LPRx_MAX), - REG_VARIABLE(CFG_SCAN_11D_INTERVAL_NAME, WLAN_PARAM_Integer, - struct hdd_config, scan_11d_interval, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_SCAN_11D_INTERVAL_DEFAULT, - CFG_SCAN_11D_INTERVAL_MIN, - CFG_SCAN_11D_INTERVAL_MAX), - REG_VARIABLE(CFG_IS_BSSID_HINT_PRIORITY_NAME, WLAN_PARAM_Integer, struct hdd_config, is_bssid_hint_priority, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 172795ef64..1d3fb5bb57 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2538,6 +2538,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, cfg_default(CFG_EXTERNAL_ACS_POLICY); bool sap_force_11n_for_11ac = 0; bool go_force_11n_for_11ac = 0; + bool etsi13_srd_chan; /* ***Note*** Donot set SME config related to ACS operation here because * ACS operation is not synchronouse and ACS for Second AP may come when @@ -2715,8 +2716,10 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, goto out; } + ucfg_mlme_get_etsi13_srd_chan_in_master_mode(hdd_ctx->psoc, + &etsi13_srd_chan); skip_etsi13_srd_chan = - !hdd_ctx->config->etsi13_srd_chan_in_master_mode && + !etsi13_srd_chan && wlan_reg_is_etsi13_regdmn(hdd_ctx->pdev); if (skip_etsi13_srd_chan) { diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 58dcf3b342..e38539c2a2 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9931,7 +9931,6 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx) cds_cfg->max_scan = hdd_ctx->config->max_scan_count; cds_cfg->enable_rxthread = hdd_ctx->enable_rxthread; - cds_cfg->self_gen_frm_pwr = hdd_ctx->config->self_gen_frm_pwr; ucfg_mlme_get_sap_max_peers(hdd_ctx->psoc, &value); cds_cfg->max_station = value; cds_cfg->sub_20_channel_width = WLAN_SUB_20_CH_WIDTH_NONE; @@ -9992,10 +9991,6 @@ static int hdd_update_user_config(struct hdd_context *hdd_ctx) return -ENOMEM; user_config->dot11_mode = hdd_ctx->config->dot11Mode; - user_config->dual_mac_feature_disable = dual_mac_feature; - user_config->indoor_channel_support = - hdd_ctx->config->indoor_channel_support; - status = ucfg_mlme_is_11d_enabled(hdd_ctx->psoc, &value); if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("Invalid 11d_enable flag"); @@ -10006,7 +10001,6 @@ static int hdd_update_user_config(struct hdd_context *hdd_ctx) if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("Invalid 11h_enable flag"); user_config->is_11h_support_enabled = value; - cfg_p2p_get_skip_dfs_channel_p2p_search(hdd_ctx->psoc, &skip_dfs_in_p2p_search); user_config->skip_dfs_chnl_in_p2p_search = skip_dfs_in_p2p_search; @@ -10936,9 +10930,6 @@ static int hdd_features_init(struct hdd_context *hdd_ctx) /* FW capabilities received, Set the Dot11 mode */ mac_handle = hdd_ctx->mac_handle; sme_setdef_dot11mode(mac_handle); - sme_set_etsi13_srd_ch_in_master_mode(mac_handle, - cfg-> - etsi13_srd_chan_in_master_mode); ucfg_mlme_is_imps_enabled(hdd_ctx->psoc, &is_imps_enabled); hdd_set_idle_ps_config(hdd_ctx, is_imps_enabled); diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 7f7e0630bf..2c2f16d92a 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -209,6 +209,10 @@ static void reg_program_config_vars(struct hdd_context *hdd_ctx, struct reg_config_vars *config_vars) { uint8_t band_capability = 0, indoor_chnl_marking = 0; + uint32_t scan_11d_interval = 0; + bool indoor_chan_enabled = false; + uint32_t restart_beaconing = 0; + bool enable_srd_chan = false; QDF_STATUS status; bool country_priority = 0; bool value = false; @@ -227,19 +231,30 @@ static void reg_program_config_vars(struct hdd_context *hdd_ctx, hdd_err("Invalid 11d_enable flag"); config_vars->enable_11d_support = value; - config_vars->scan_11d_interval = hdd_ctx->config->scan_11d_interval; + ucfg_mlme_get_scan_11d_interval(hdd_ctx->psoc, &scan_11d_interval); + config_vars->scan_11d_interval = scan_11d_interval; + ucfg_mlme_get_sap_country_priority(hdd_ctx->psoc, &country_priority); config_vars->userspace_ctry_priority = country_priority; + config_vars->dfs_enabled = hdd_ctx->config->enableDFSChnlScan; - config_vars->indoor_chan_enabled = - hdd_ctx->config->indoor_channel_support; + + ucfg_mlme_get_indoor_channel_support(hdd_ctx->psoc, + &indoor_chan_enabled); + config_vars->indoor_chan_enabled = indoor_chan_enabled; + config_vars->force_ssc_disable_indoor_channel = indoor_chnl_marking; config_vars->band_capability = band_capability; - config_vars->restart_beaconing = hdd_ctx->config-> - restart_beaconing_on_chan_avoid_event; - config_vars->enable_srd_chan_in_master_mode = - hdd_ctx->config->etsi13_srd_chan_in_master_mode; + + ucfg_mlme_get_restart_beaconing_on_ch_avoid(hdd_ctx->psoc, + &restart_beaconing); + config_vars->restart_beaconing = restart_beaconing; + + ucfg_mlme_get_etsi13_srd_chan_in_master_mode(hdd_ctx->psoc, + &enable_srd_chan); + config_vars->enable_srd_chan_in_master_mode = enable_srd_chan; + config_vars->enable_11d_in_world_mode = hdd_ctx->config->enable_11d_in_world_mode; } @@ -266,9 +281,6 @@ static void hdd_regulatory_wiphy_init(struct hdd_context *hdd_ctx, if (hdd_is_world_regdomain(reg->reg_domain)) { reg_rules = hdd_get_world_regrules(reg); wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; - } else if (hdd_ctx->config->fRegChangeDefCountry) { - wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; - reg_rules = &hdd_world_regrules_60_61_62; } else { wiphy->regulatory_flags |= REGULATORY_STRICT_REG; reg_rules = &hdd_world_regrules_60_61_62; @@ -309,9 +321,6 @@ static void hdd_regulatory_wiphy_init(struct hdd_context *hdd_ctx, if (hdd_is_world_regdomain(reg->reg_domain)) { reg_rules = hdd_get_world_regrules(reg); wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; - } else if (hdd_ctx->config->fRegChangeDefCountry) { - wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; - reg_rules = &hdd_world_regrules_60_61_62; } else { wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; reg_rules = &hdd_world_regrules_60_61_62; @@ -430,6 +439,7 @@ static void hdd_process_regulatory_data(struct hdd_context *hdd_ctx, struct ieee80211_channel *wiphy_chan, *wiphy_chan_144 = NULL; struct regulatory_channel *cds_chan; uint8_t band_capability, indoor_chnl_marking = 0; + bool indoor; QDF_STATUS status; band_capability = hdd_ctx->curr_band; @@ -484,8 +494,10 @@ static void hdd_process_regulatory_data(struct hdd_context *hdd_ctx, IEEE80211_CHAN_INDOOR_ONLY) { cds_chan->chan_flags |= REGULATORY_CHAN_INDOOR_ONLY; - if (hdd_ctx->config->indoor_channel_support - == false) { + + ucfg_mlme_get_indoor_chan_enabled(hdd_ctx->psoc, + &indoor); + if (!indoor) { cds_chan->state = CHANNEL_STATE_DFS; wiphy_chan->flags |= IEEE80211_CHAN_PASSIVE_SCAN; @@ -598,7 +610,9 @@ void hdd_modify_indoor_channel_state_flags( struct regulatory_channel *cds_chan, enum channel_enum chan_enum, int chan_num, bool disable) { - bool indoor_support = hdd_ctx->config->indoor_channel_support; + bool indoor_support; + + ucfg_mlme_get_indoor_channel_support(hdd_ctx->psoc, &indoor_support); /* Mark indoor channel to disable in wiphy and cds */ if (disable) { diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 07c29ab4ed..8a29a052bf 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -713,7 +713,6 @@ typedef struct tagSapStruct { #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ bool acs_with_more_param; bool enable_dfs_phy_error_logs; - bool enable_etsi13_srd_chan_support; } tSapStruct, *tpSapStruct; #ifdef FEATURE_WLAN_CH_AVOID diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index c18a6f9a02..1271eaac06 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -671,7 +671,7 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle, if (wlan_reg_is_dsrc_chan(mac->pdev, *pChans)) continue; - if (!mac->sap.enable_etsi13_srd_chan_support && + if (!mac->mlme_cfg->reg.etsi13_srd_chan_in_master_mode && wlan_reg_is_etsi13_srd_chan(mac->pdev, *pChans)) continue; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 6c00065908..f4c71cfdbb 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1535,11 +1535,6 @@ QDF_STATUS sme_register_for_dcc_stats_event(mac_handle_t mac_handle, ocb_callback callback); QDF_STATUS sme_deregister_for_dcc_stats_event(mac_handle_t mac_handle); -static inline void -sme_set_etsi13_srd_ch_in_master_mode(mac_handle_t mac_handle, - bool etsi13_srd_chan_support) -{ -} #else static inline QDF_STATUS sme_ocb_set_config(mac_handle_t mac_handle, void *context, @@ -1620,17 +1615,6 @@ QDF_STATUS sme_deregister_for_dcc_stats_event(mac_handle_t mac_handle) return QDF_STATUS_SUCCESS; } -/** - * sme_set_etsi13_srd_ch_in_master_mode() - master mode UNI-III band ch support - * @mac_handle: Opaque handle to the global MAC context - * @srd_chan_support: ETSI SRD channel support - * - * This function set master ETSI SRD channel support - * - * Return: None - */ -void sme_set_etsi13_srd_ch_in_master_mode(mac_handle_t mac_handle, - bool etsi13_srd_chan_support); #endif void sme_add_set_thermal_level_callback(mac_handle_t mac_handle, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index ee0851b481..bf25dd6d8a 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -9301,16 +9301,6 @@ QDF_STATUS sme_deregister_for_dcc_stats_event(mac_handle_t mac_handle) return status; } -#else -void sme_set_etsi13_srd_ch_in_master_mode(mac_handle_t mac_handle, - bool etsi13_srd_chan_support) -{ - struct mac_context *mac; - - mac = MAC_CONTEXT(mac_handle); - mac->sap.enable_etsi13_srd_chan_support = etsi13_srd_chan_support; - sme_debug("srd_ch_support %d", mac->sap.enable_etsi13_srd_chan_support); -} #endif void sme_get_recovery_stats(mac_handle_t mac_handle) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 9b9de477a1..fb75827087 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -3166,6 +3166,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, target_resource_config *wlan_res_cfg; enum pmo_wow_enable_type wow_enable; uint8_t delay_before_vdev_stop; + uint32_t self_gen_frm_pwr = 0; WMA_LOGD("%s: Enter", __func__); @@ -3313,7 +3314,11 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, goto err_wma_handle; } wma_handle->tx_chain_mask_cck = val; - wma_handle->self_gen_frm_pwr = cds_cfg->self_gen_frm_pwr; + + qdf_status = wlan_mlme_get_self_gen_frm_pwr(psoc, &self_gen_frm_pwr); + if (qdf_status != QDF_STATUS_SUCCESS) + WMA_LOGE("%s: Failed to get self_gen_frm_pwr", __func__); + wma_handle->self_gen_frm_pwr = self_gen_frm_pwr; cds_cfg->max_bssid = WMA_MAX_SUPPORTED_BSS;