From 224d38154f3647584638503c30e9ce0baa23874f Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Fri, 16 Nov 2018 17:58:38 -0800 Subject: [PATCH] qcacld-3.0: Refactor more dfs cfg items Refactor following DFS cfg items CFG_DISABLE_DFS_CH_SWITCH CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_NAME CFG_IGNORE_CAC_NAME CFG_DFS_RADAR_PRI_MULTIPLIER_NAME CFG_SAP_TX_LEAKAGE_THRESHOLD_NAME CFG_DFS_BEACON_TX_ENHANCED CFG_DISABLE_DFS_JAPAN_W53 CFG_ENABLE_NON_DFS_CHAN_ON_RADAR Change-Id: I7f39ed0680919c6a383d9b8bae5864f979b6948c CRs-Fixed: 2351995 --- components/mlme/core/src/wlan_mlme_main.c | 15 +- components/mlme/dispatcher/inc/cfg_mlme_dfs.h | 138 +++++++++++++++- .../dispatcher/inc/wlan_mlme_public_struct.h | 12 ++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 87 +++++++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 147 ++++++++++++++++++ core/cds/inc/cds_config.h | 3 - core/hdd/inc/wlan_hdd_cfg.h | 135 ---------------- core/hdd/src/wlan_hdd_cfg.c | 72 --------- core/hdd/src/wlan_hdd_hostapd.c | 15 +- core/hdd/src/wlan_hdd_main.c | 21 +-- core/mac/inc/ani_global.h | 1 - core/mac/src/pe/lim/lim_utils.c | 2 +- core/sap/inc/sap_api.h | 28 ---- core/sap/src/sap_api_link_cntl.c | 4 +- core/sap/src/sap_fsm.c | 35 +---- core/sap/src/sap_internal.h | 15 -- core/sap/src/sap_module.c | 64 -------- core/sme/inc/csr_api.h | 2 - core/sme/src/csr/csr_api_roam.c | 5 - 19 files changed, 421 insertions(+), 380 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index f538a26d3f..b9a30f2ccd 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -850,8 +850,19 @@ static void mlme_init_rates_in_cfg(struct wlan_objmgr_psoc *psoc, 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); + dfs_cfg->dfs_ignore_cac = cfg_get(psoc, CFG_IGNORE_CAC); + dfs_cfg->dfs_master_capable = + cfg_get(psoc, CFG_ENABLE_DFS_MASTER_CAPABILITY); + dfs_cfg->dfs_disable_channel_switch = + cfg_get(psoc, CFG_DISABLE_DFS_CH_SWITCH); + dfs_cfg->dfs_filter_offload = + cfg_get(psoc, CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD); + dfs_cfg->dfs_prefer_non_dfs = + cfg_get(psoc, CFG_ENABLE_NON_DFS_CHAN_ON_RADAR); + dfs_cfg->dfs_beacon_tx_enhanced = + cfg_get(psoc, CFG_DFS_BEACON_TX_ENHANCED); + dfs_cfg->sap_tx_leakage_threshold = + cfg_get(psoc, CFG_SAP_TX_LEAKAGE_THRESHOLD); } static void mlme_init_feature_flag_in_cfg( diff --git a/components/mlme/dispatcher/inc/cfg_mlme_dfs.h b/components/mlme/dispatcher/inc/cfg_mlme_dfs.h index e3dd2c5838..0a5ce30c5d 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_dfs.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_dfs.h @@ -23,6 +23,136 @@ #ifndef __CFG_MLME_DFS_H #define __CFG_MLME_DFS_H +/* + * + * gsap_tx_leakage_threshold - sap tx leakage threshold + * @Min: 100 + * @Max: 1000 + * @Default: 310 + * + * customer can set this value from 100 to 1000 which means + * sap tx leakage threshold is -10db to -100db + * + * Related: none + * + * Usage: External + * + * + */ +#define CFG_SAP_TX_LEAKAGE_THRESHOLD CFG_INI_UINT( \ + "gsap_tx_leakage_threshold", \ + 100, \ + 1000, \ + 310, \ + CFG_VALUE_OR_DEFAULT, \ + "sap tx leakage threshold") + +/* + * + * gDfsBeaconTxEnhanced - beacon tx enhanced + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enhance dfs beacon tx + * + * Related: none + * + * Usage: External + * + * + */ +#define CFG_DFS_BEACON_TX_ENHANCED CFG_INI_BOOL( \ + "gDfsBeaconTxEnhanced", \ + 0, \ + "beacon tx enhanced") + +/* + * + * gPreferNonDfsChanOnRadar - During random channel selection prefer non dfs + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * During random channel selection prefer non dfs. + * + * Related: none + * + * Usage: External + * + * + */ +#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR CFG_INI_BOOL( \ + "gPreferNonDfsChanOnRadar", \ + 0, \ + "channel selection prefer non dfs") + +/* + * + * dfsPhyerrFilterOffload - Enable dfs phyerror filtering offload in FW + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to to enable dfs phyerror filtering offload to firmware + * Enabling it will cause basic phy error to be discarding in firmware. + * Related: NA. + * + * Supported Feature: DFS + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD CFG_INI_BOOL( \ + "dfsPhyerrFilterOffload", \ + 0, \ + "dfs phyerror filtering offload") + +/* + * + * gIgnoreCAC - Used to ignore CAC + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to set default CAC + * + * Related: None + * + * Supported Feature: DFS + * + * Usage: Internal/External + * + * + */ +#define CFG_IGNORE_CAC CFG_INI_BOOL( \ + "gIgnoreCAC", \ + 0, \ + "ignore CAC on DFS channel") + +/* + * + * gDisableDFSChSwitch - Disable channel switch if radar is found + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to disable channel switch if radar is found + * on that channel. + * Related: NA. + * + * Supported Feature: DFS + * + * Usage: Internal + * + * + */ +#define CFG_DISABLE_DFS_CH_SWITCH CFG_INI_BOOL( \ + "gDisableDFSChSwitch", \ + 0, \ + "Disable channel switch on radar") + /* * * gEnableDFSMasterCap - Enable DFS master capability @@ -47,6 +177,12 @@ "DFS master mode capability") #define CFG_DFS_ALL \ - CFG(CFG_ENABLE_DFS_MASTER_CAPABILITY) + CFG(CFG_IGNORE_CAC) \ + CFG(CFG_DISABLE_DFS_CH_SWITCH) \ + CFG(CFG_DFS_BEACON_TX_ENHANCED) \ + CFG(CFG_SAP_TX_LEAKAGE_THRESHOLD) \ + CFG(CFG_ENABLE_NON_DFS_CHAN_ON_RADAR) \ + CFG(CFG_ENABLE_DFS_MASTER_CAPABILITY) \ + CFG(CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD) #endif /* __CFG_MLME_DFS_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index a433c97c5f..e3cb559f26 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -573,9 +573,21 @@ struct wlan_mlme_cfg_sap { /** * struct wlan_mlme_dfs_cfg - DFS Capabilities related config items * @dfs_master_capable: Is DFS master mode support enabled + * @dfs_disable_channel_switch: disable channel switch on radar detection + * @dfs_ignore_cac: Disable cac + * @dfs_filter_offload: dfs filter offloaad + * @dfs_beacon_tx_enhanced: enhance dfs beacon tx + * @dfs_prefer_non_dfs: perefer non dfs channel after radar + * @sap_tx_leakage_threshold: sap tx leakage threshold */ struct wlan_mlme_dfs_cfg { bool dfs_master_capable; + bool dfs_disable_channel_switch; + bool dfs_ignore_cac; + bool dfs_filter_offload; + bool dfs_beacon_tx_enhanced; + bool dfs_prefer_non_dfs; + uint32_t sap_tx_leakage_threshold; }; /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 2dc36010df..7041c01c0b 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -702,6 +702,93 @@ QDF_STATUS ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc *psoc, bool *val); +/* + * ucfg_mlme_get_dfs_disable_channel_switch() - Get the dfs channel switch + * @psoc: pointer to psoc object + * @dfs_disable_channel_switch: Pointer to the value which will be filled + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_dfs_disable_channel_switch(struct wlan_objmgr_psoc *psoc, + bool *dfs_disable_channel_switch); + +/* + * ucfg_mlme_set_dfs_disable_channel_switch() - Set the dfs channel switch + * @psoc: pointer to psoc object + * @dfs_disable_channel_switch: Value that needs to be set. + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_set_dfs_disable_channel_switch(struct wlan_objmgr_psoc *psoc, + bool dfs_disable_channel_switch); +/* + * ucfg_mlme_get_dfs_ignore_cac() - GSet the dfs ignore cac + * @psoc: pointer to psoc object + * @dfs_ignore_cac: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_dfs_ignore_cac(struct wlan_objmgr_psoc *psoc, + bool *dfs_ignore_cac); + +/* + * ucfg_mlme_set_dfs_ignore_cac() - Set the dfs ignore cac + * @psoc: pointer to psoc object + * @dfs_ignore_cac: Value that needs to be set. + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_set_dfs_ignore_cac(struct wlan_objmgr_psoc *psoc, + bool dfs_ignore_cac); + +/* + * ucfg_mlme_get_sap_tx_leakage_threshold() - Get sap tx leakage threshold + * @psoc: pointer to psoc object + * @sap_tx_leakage_threshold: Pointer to the value which will be filled + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc, + uint32_t *sap_tx_leakage_threshold); + +/* + * ucfg_mlme_set_sap_tx_leakage_threshold() - Set sap tx leakage threshold + * @psoc: pointer to psoc object + * @sap_tx_leakage_threshold: Value that needs to be set. + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_set_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc, + uint32_t sap_tx_leakage_threshold); + +/* + * ucfg_mlme_get_dfs_filter_offload() - Get the dfs filter offload + * @psoc: pointer to psoc object + * @dfs_filter_offload: Pointer to the value which will be filled + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_dfs_filter_offload(struct wlan_objmgr_psoc *psoc, + bool *dfs_filter_offload); + +/* + * ucfg_mlme_set_dfs_filter_offload() - Set the dfs filter offload + * @psoc: pointer to psoc object + * @dfs_filter_offload: Value that needs to be set. + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_set_dfs_filter_offload(struct wlan_objmgr_psoc *psoc, + bool dfs_filter_offload); + /** * ucfg_mlme_get_pmkid_modes() - Get PMKID modes * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 9ec2246a36..abe96955e6 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -206,6 +206,153 @@ ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +ucfg_mlme_get_dfs_disable_channel_switch(struct wlan_objmgr_psoc *psoc, + bool *dfs_disable_channel_switch) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *dfs_disable_channel_switch = + cfg_default(CFG_DISABLE_DFS_CH_SWITCH); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + *dfs_disable_channel_switch = + mlme_obj->cfg.dfs_cfg.dfs_disable_channel_switch; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_set_dfs_disable_channel_switch(struct wlan_objmgr_psoc *psoc, + bool dfs_disable_channel_switch) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.dfs_cfg.dfs_disable_channel_switch = + dfs_disable_channel_switch; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_get_dfs_ignore_cac(struct wlan_objmgr_psoc *psoc, + bool *dfs_ignore_cac) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *dfs_ignore_cac = cfg_default(CFG_IGNORE_CAC); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + *dfs_ignore_cac = mlme_obj->cfg.dfs_cfg.dfs_ignore_cac; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_set_dfs_ignore_cac(struct wlan_objmgr_psoc *psoc, + bool dfs_ignore_cac) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.dfs_cfg.dfs_ignore_cac = dfs_ignore_cac; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_get_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc, + uint32_t *sap_tx_leakage_threshold) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *sap_tx_leakage_threshold = + cfg_default(CFG_SAP_TX_LEAKAGE_THRESHOLD); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + *sap_tx_leakage_threshold = + mlme_obj->cfg.dfs_cfg.sap_tx_leakage_threshold; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_set_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc, + uint32_t sap_tx_leakage_threshold) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.dfs_cfg.sap_tx_leakage_threshold = + sap_tx_leakage_threshold; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_get_dfs_filter_offload(struct wlan_objmgr_psoc *psoc, + bool *dfs_filter_offload) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *dfs_filter_offload = + cfg_default(CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + *dfs_filter_offload = mlme_obj->cfg.dfs_cfg.dfs_filter_offload; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_set_dfs_filter_offload(struct wlan_objmgr_psoc *psoc, + bool dfs_filter_offload) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.dfs_cfg.dfs_filter_offload = dfs_filter_offload; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_pmkid_modes(struct wlan_objmgr_psoc *psoc, uint32_t *val) diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h index 4e66afe2e5..6eb627f0cb 100644 --- a/core/cds/inc/cds_config.h +++ b/core/cds/inc/cds_config.h @@ -63,7 +63,6 @@ enum active_apf_mode { * @sta_maxlimod_dtim: station max listen interval * @driver_type: Enumeration of Driver Type whether FTM or Mission mode * currently rest of bits are not used - * @dfs_phyerr_filter_offload: DFS Phyerror Filtering offload status from ini * Indicates whether support is enabled or not * @ap_disable_intrabss_fwd: pass intra-bss-fwd info to txrx module * @ap_maxoffload_peers: max offload peer @@ -110,7 +109,6 @@ struct cds_config_info { uint16_t max_bssid; uint8_t sta_maxlimod_dtim; enum qdf_driver_type driver_type; - uint8_t dfs_phyerr_filter_offload; uint8_t ap_maxoffload_peers; uint8_t ap_maxoffload_reorderbuffs; #ifdef FEATURE_WLAN_RA_FILTERING @@ -118,7 +116,6 @@ struct cds_config_info { bool is_ra_ratelimit_enabled; #endif uint8_t reorder_offload; - int32_t dfs_pri_multiplier; uint8_t uc_offload_enabled; uint32_t uc_txbuf_count; uint32_t uc_txbuf_size; diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index ab98bda4f0..881ea4502f 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2201,70 +2201,6 @@ enum hdd_link_speed_rpt_type { eHDD_LINK_SPEED_REPORT_MAX_SCALED = 2, }; -/* - * - * gDisableDFSChSwitch - Disable channel switch if radar is found - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to disable channel switch if radar is found - * on that channel. - * Related: NA. - * - * Supported Feature: DFS - * - * Usage: Internal - * - * - */ -#define CFG_DISABLE_DFS_CH_SWITCH "gDisableDFSChSwitch" -#define CFG_DISABLE_DFS_CH_SWITCH_MIN (0) -#define CFG_DISABLE_DFS_CH_SWITCH_MAX (1) -#define CFG_DISABLE_DFS_CH_SWITCH_DEFAULT (0) - -/* - * - * gDisableDfsJapanW53 - Block W53 channels in random channel selection - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to block W53 Japan channel in random channel selection - * Related: NA. - * - * Supported Feature: DFS - * - * Usage: Internal/External - * - * - */ -#define CFG_DISABLE_DFS_JAPAN_W53 "gDisableDfsJapanW53" -#define CFG_DISABLE_DFS_JAPAN_W53_MIN (0) -#define CFG_DISABLE_DFS_JAPAN_W53_MAX (1) -#define CFG_DISABLE_DFS_JAPAN_W53_DEFAULT (0) - -/* - * - * dfsPhyerrFilterOffload - DFS PHY error filter offload - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to enable firmware to do DFS PHY error filtering. - * Related: NA. - * - * Supported Feature: DFS - * - * Usage: Internal/External - * - * - */ -#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_NAME "dfsPhyerrFilterOffload" -#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MIN (0) -#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MAX (1) -#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_DEFAULT (0) - /* * * gReportMaxLinkSpeed - Reporting of max link speed @@ -2936,34 +2872,6 @@ enum hdd_link_speed_rpt_type { #endif /* MSM_PLATFORM */ -/* - * - * gIgnoreCAC - Used to ignore CAC - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to set default CAC - * - * Related: None - * - * Supported Feature: STA - * - * Usage: Internal/External - * - * - */ - -#define CFG_IGNORE_CAC_NAME "gIgnoreCAC" -#define CFG_IGNORE_CAC_MIN (0) -#define CFG_IGNORE_CAC_MAX (1) -#define CFG_IGNORE_CAC_DEFAULT (0) - -#define CFG_DFS_RADAR_PRI_MULTIPLIER_NAME "gDFSradarMappingPriMultiplier" -#define CFG_DFS_RADAR_PRI_MULTIPLIER_DEFAULT (4) -#define CFG_DFS_RADAR_PRI_MULTIPLIER_MIN (0) -#define CFG_DFS_RADAR_PRI_MULTIPLIER_MAX (10) - #define CFG_ENABLE_SAP_SUSPEND "gEnableSapSuspend" #define CFG_ENABLE_SAP_SUSPEND_MIN (0) #define CFG_ENABLE_SAP_SUSPEND_MAX (1) @@ -3101,11 +3009,6 @@ enum hdd_link_speed_rpt_type { #define CFG_GO_11AC_OVERRIDE_MAX (1) #define CFG_GO_11AC_OVERRIDE_DEFAULT (1) -#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR "gPreferNonDfsChanOnRadar" -#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MIN (0) -#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MAX (1) -#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_DEFAULT (0) - /* * set the self gen power value from * 0 to 0xffff @@ -3461,16 +3364,6 @@ enum hdd_link_speed_rpt_type { #define CFG_MARK_INDOOR_AS_DISABLE_MAX (1) #define CFG_MARK_INDOOR_AS_DISABLE_DEFAULT (0) -/* - * sap tx leakage threshold - * customer can set this value from 100 to 1000 which means - * sap tx leakage threshold is -10db to -100db - */ -#define CFG_SAP_TX_LEAKAGE_THRESHOLD_NAME "gsap_tx_leakage_threshold" -#define CFG_SAP_TX_LEAKAGE_THRESHOLD_MIN (100) -#define CFG_SAP_TX_LEAKAGE_THRESHOLD_MAX (1000) -#define CFG_SAP_TX_LEAKAGE_THRESHOLD_DEFAULT (310) - /* * * enable_5g_band_pref - Enable preference for 5G from INI. @@ -4231,26 +4124,6 @@ enum hdd_link_speed_rpt_type { #define CFG_ENABLE_PACKET_FILTERS_MAX (63) #endif /* WLAN_FEATURE_PACKET_FILTERING */ -/* - * - * gDfsBeaconTxEnhanced - beacon tx enhanced - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to enhance dfs beacon tx - * - * Related: none - * - * Usage: External - * - * - */ -#define CFG_DFS_BEACON_TX_ENHANCED "gDfsBeaconTxEnhanced" -#define CFG_DFS_BEACON_TX_ENHANCED_MIN (0) -#define CFG_DFS_BEACON_TX_ENHANCED_MAX (1) -#define CFG_DFS_BEACON_TX_ENHANCED_DEFAULT (0) - /* * * btm_offload_config - Configure BTM @@ -5241,8 +5114,6 @@ struct hdd_config { uint32_t ibssPs1RxChainInAtimEnable; uint32_t IpaConfig; bool IpaClkScalingEnable; - uint8_t disableDFSChSwitch; - bool fDfsPhyerrFilterOffload; uint8_t gDisableDfsJapanW53; bool gEnableOverLapCh; bool fRegChangeDefCountry; @@ -5250,12 +5121,8 @@ struct hdd_config { uint8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; - uint8_t ignoreCAC; - bool enable_sap_mandatory_chan_list; - int32_t dfsRadarPriMultiplier; - #ifdef FEATURE_WLAN_FORCE_SAP_SCC uint8_t SapSccChanAvoidance; #endif /* FEATURE_WLAN_FORCE_SAP_SCC */ @@ -5273,7 +5140,6 @@ struct hdd_config { #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ uint8_t sap_11ac_override; uint8_t go_11ac_override; - uint8_t prefer_non_dfs_on_radar; /* parameter for defer timer for enabling TDLS on p2p listen */ uint32_t fine_time_meas_cap; uint8_t max_scan_count; @@ -5367,7 +5233,6 @@ struct hdd_config { #ifdef WLAN_FEATURE_PACKET_FILTERING uint8_t packet_filters_bitmap; #endif - uint8_t dfs_beacon_tx_enhanced; uint32_t btm_offload_config; #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 ea772992f7..8f1f6d7602 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -48,14 +48,6 @@ #include "cfg_ucfg_api.h" #include "hdd_dp_cfg.h" -static void ch_notify_set_g_disable_dfs_japan_w53(struct hdd_context *hdd_ctx, - unsigned long notify_id) -{ - bool disabled = hdd_ctx->config->gDisableDfsJapanW53; - - wlansap_set_dfs_restrict_japan_w53(hdd_ctx->mac_handle, disabled); -} - struct reg_table_entry g_registry_table[] = { REG_VARIABLE(CFG_ENABLE_CONNECTED_SCAN_NAME, WLAN_PARAM_Integer, struct hdd_config, enable_connected_scan, @@ -495,22 +487,6 @@ struct reg_table_entry g_registry_table[] = { CFG_THROTTLE_DUTY_CYCLE_LEVEL3_MIN, CFG_THROTTLE_DUTY_CYCLE_LEVEL3_MAX), - REG_VARIABLE(CFG_DISABLE_DFS_CH_SWITCH, WLAN_PARAM_Integer, - struct hdd_config, disableDFSChSwitch, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_DISABLE_DFS_CH_SWITCH_DEFAULT, - CFG_DISABLE_DFS_CH_SWITCH_MIN, - CFG_DISABLE_DFS_CH_SWITCH_MAX), - - REG_DYNAMIC_VARIABLE(CFG_DISABLE_DFS_JAPAN_W53, WLAN_PARAM_Integer, - struct hdd_config, gDisableDfsJapanW53, - VAR_FLAGS_OPTIONAL | - VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_DISABLE_DFS_JAPAN_W53_DEFAULT, - CFG_DISABLE_DFS_JAPAN_W53_MIN, - CFG_DISABLE_DFS_JAPAN_W53_MAX, - ch_notify_set_g_disable_dfs_japan_w53, 0), - REG_VARIABLE(CFG_ENABLE_FIRST_SCAN_2G_ONLY_NAME, WLAN_PARAM_Integer, struct hdd_config, enableFirstScan2GOnly, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -640,14 +616,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_ENABLE_DFS_PHYERR_FILTEROFFLOAD_NAME, - WLAN_PARAM_Integer, - struct hdd_config, fDfsPhyerrFilterOffload, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_DEFAULT, - CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MIN, - CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MAX), - REG_VARIABLE(CFG_ENABLE_OVERLAP_CH, WLAN_PARAM_Integer, struct hdd_config, gEnableOverLapCh, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -698,20 +666,6 @@ struct reg_table_entry g_registry_table[] = { VAR_FLAGS_OPTIONAL, (void *)CFG_ENABLE_FW_MODULE_LOG_DEFAULT), - REG_VARIABLE(CFG_IGNORE_CAC_NAME, WLAN_PARAM_Integer, - struct hdd_config, ignoreCAC, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_IGNORE_CAC_DEFAULT, - CFG_IGNORE_CAC_MIN, - CFG_IGNORE_CAC_MAX), - - REG_VARIABLE(CFG_DFS_RADAR_PRI_MULTIPLIER_NAME, WLAN_PARAM_Integer, - struct hdd_config, dfsRadarPriMultiplier, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_DFS_RADAR_PRI_MULTIPLIER_DEFAULT, - CFG_DFS_RADAR_PRI_MULTIPLIER_MIN, - CFG_DFS_RADAR_PRI_MULTIPLIER_MAX), - REG_VARIABLE(CFG_ENABLE_SAP_SUSPEND, WLAN_PARAM_Integer, struct hdd_config, enable_sap_suspend, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -773,13 +727,6 @@ struct reg_table_entry g_registry_table[] = { CFG_GO_11AC_OVERRIDE_MIN, CFG_GO_11AC_OVERRIDE_MAX), - REG_VARIABLE(CFG_ENABLE_NON_DFS_CHAN_ON_RADAR, WLAN_PARAM_Integer, - struct hdd_config, prefer_non_dfs_on_radar, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_DEFAULT, - CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MIN, - CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MAX), - REG_VARIABLE(CFG_FINE_TIME_MEAS_CAPABILITY, WLAN_PARAM_HexInteger, struct hdd_config, fine_time_meas_cap, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -996,14 +943,6 @@ struct reg_table_entry g_registry_table[] = { CFG_MARK_INDOOR_AS_DISABLE_MIN, CFG_MARK_INDOOR_AS_DISABLE_MAX), - REG_VARIABLE(CFG_SAP_TX_LEAKAGE_THRESHOLD_NAME, - WLAN_PARAM_Integer, - struct hdd_config, sap_tx_leakage_threshold, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_SAP_TX_LEAKAGE_THRESHOLD_DEFAULT, - CFG_SAP_TX_LEAKAGE_THRESHOLD_MIN, - CFG_SAP_TX_LEAKAGE_THRESHOLD_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, @@ -1223,14 +1162,6 @@ struct reg_table_entry g_registry_table[] = { CFG_LATENCY_FLAGS_ULTRALOW_MIN, CFG_LATENCY_FLAGS_ULTRALOW_MAX), - - REG_VARIABLE(CFG_DFS_BEACON_TX_ENHANCED, WLAN_PARAM_Integer, - struct hdd_config, dfs_beacon_tx_enhanced, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_DFS_BEACON_TX_ENHANCED_DEFAULT, - CFG_DFS_BEACON_TX_ENHANCED_MIN, - CFG_DFS_BEACON_TX_ENHANCED_MAX), - REG_VARIABLE(CFG_BTM_ENABLE_NAME, WLAN_PARAM_HexInteger, struct hdd_config, btm_offload_config, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3029,9 +2960,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) hdd_ctx->config->sap_channel_avoidance; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ - smeConfig->csrConfig.f_prefer_non_dfs_on_radar = - hdd_ctx->config->prefer_non_dfs_on_radar; - smeConfig->csrConfig.is_ps_enabled = hdd_ctx->config->is_ps_enabled; smeConfig->csrConfig.auto_bmps_timer_val = hdd_ctx->config->auto_bmps_timer_val; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 3e1b6c66e6..2e115e7120 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -4628,10 +4628,11 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, uint16_t prev_rsn_length = 0; enum dfs_mode mode; struct hdd_adapter *sta_adapter; - uint8_t ignore_cac = 0; + bool ignore_cac = 0; uint8_t beacon_fixed_len; int value; bool val; + uint32_t tx_leakage_threshold = 0; uint32_t auto_channel_select_weight = cfg_default(CFG_AUTO_CHANNEL_SELECT_WEIGHT); uint8_t pref_chan_location = 0; @@ -4768,7 +4769,6 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, hdd_err("ucfg_mlme_get_auto_channel_weight failed, set def"); pConfig->auto_channel_select_weight = auto_channel_select_weight; - pConfig->disableDFSChSwitch = iniConfig->disableDFSChSwitch; ucfg_mlme_get_sap_chn_switch_bcn_count(hdd_ctx->psoc, &value); pConfig->sap_chanswitch_beacon_cnt = value; ucfg_mlme_get_sap_channel_switch_mode(hdd_ctx->psoc, &val); @@ -4793,7 +4793,6 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, ucfg_mlme_get_sap_reduces_beacon_interval(hdd_ctx->psoc, &value); pConfig->dtim_period = pBeacon->dtim_period; - pConfig->dfs_beacon_tx_enhanced = iniConfig->dfs_beacon_tx_enhanced; pConfig->reduced_beacon_interval = value; hdd_debug("acs_mode %d", pConfig->acs_cfg.acs_mode); @@ -4866,14 +4865,13 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, goto error; } - if (iniConfig->ignoreCAC || + ucfg_mlme_get_dfs_ignore_cac(hdd_ctx->psoc, &ignore_cac); + if (ignore_cac || ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && iniConfig->sta_sap_scc_on_dfs_chan)) ignore_cac = 1; wlansap_set_dfs_ignore_cac(mac_handle, ignore_cac); - wlansap_set_dfs_restrict_japan_w53(mac_handle, - iniConfig->gDisableDfsJapanW53); ucfg_mlme_get_pref_chan_location(hdd_ctx->psoc, &pref_chan_location); wlansap_set_dfs_preferred_channel_location(mac_handle, @@ -4890,8 +4888,9 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, pConfig->ieee80211d = 0; } - wlansap_set_tx_leakage_threshold(mac_handle, - iniConfig->sap_tx_leakage_threshold); + ucfg_mlme_get_sap_tx_leakage_threshold(hdd_ctx->psoc, + &tx_leakage_threshold); + tgt_dfs_set_tx_leakage_threshold(hdd_ctx->pdev, tx_leakage_threshold); capab_info = pMgmt_frame->u.beacon.capab_info; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7f5b17d330..f5093a7ba8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2126,15 +2126,18 @@ bool hdd_dfs_indicate_radar(struct hdd_context *hdd_ctx) { struct hdd_adapter *adapter; struct hdd_ap_ctx *ap_ctx; + bool dfs_disable_channel_switch = false; if (!hdd_ctx) { hdd_info("Couldn't get hdd_ctx"); return true; } - if (hdd_ctx->config->disableDFSChSwitch) { + ucfg_mlme_get_dfs_disable_channel_switch(hdd_ctx->psoc, + &dfs_disable_channel_switch); + if (dfs_disable_channel_switch) { hdd_info("skip tx block hdd_ctx=%pK, disableDFSChSwitch=%d", - hdd_ctx, hdd_ctx->config->disableDFSChSwitch); + hdd_ctx, dfs_disable_channel_switch); return true; } @@ -9712,14 +9715,6 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx) ucfg_mlme_get_sap_max_modulated_dtim(hdd_ctx->psoc, &cds_cfg->sta_maxlimod_dtim); - /* - * Copy the DFS Phyerr Filtering Offload status. - * This parameter reflects the value of the - * dfs_phyerr_filter_offload flag as set in the ini. - */ - cds_cfg->dfs_phyerr_filter_offload = - hdd_ctx->config->fDfsPhyerrFilterOffload; - status = ucfg_mlme_get_crash_inject(hdd_ctx->psoc, &crash_inject); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Failed to get crash inject ini config"); @@ -9754,8 +9749,6 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx) &value); cds_cfg->ap_maxoffload_reorderbuffs = value; - cds_cfg->dfs_pri_multiplier = - hdd_ctx->config->dfsRadarPriMultiplier; cds_cfg->reorder_offload = cfg_get(hdd_ctx->psoc, CFG_DP_REORDER_OFFLOAD_SUPPORT); @@ -14229,11 +14222,11 @@ QDF_STATUS hdd_update_score_config( static int hdd_update_dfs_config(struct hdd_context *hdd_ctx) { struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; - struct hdd_config *cfg = hdd_ctx->config; struct dfs_user_config dfs_cfg; QDF_STATUS status; - dfs_cfg.dfs_is_phyerr_filter_offload = !!cfg->fDfsPhyerrFilterOffload; + ucfg_mlme_get_dfs_filter_offload(hdd_ctx->psoc, + &dfs_cfg.dfs_is_phyerr_filter_offload); status = ucfg_dfs_update_config(psoc, &dfs_cfg); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("failed dfs psoc configuration"); diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index b80009a417..d267aca8b0 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -834,7 +834,6 @@ struct mac_context { uint8_t beacon_offload; bool pmf_offload; bool is_fils_roaming_supported; - uint8_t f_prefer_non_dfs_on_radar; uint32_t f_sta_miracast_mcc_rest_time_val; #ifdef WLAN_FEATURE_EXTWOW_SUPPORT csr_readyToExtWoWCallback readyToExtWoWCallback; diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 5c2a2b5f33..cd96b2a8df 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7936,7 +7936,7 @@ void lim_process_ap_ecsa_timeout(void *data) ch = session->gLimChannelSwitch.primaryChannel; ch_width = session->gLimChannelSwitch.ch_width; - if (mac_ctx->sap.SapDfsInfo.dfs_beacon_tx_enhanced) + if (mac_ctx->mlme_cfg->dfs_cfg.dfs_beacon_tx_enhanced) /* Send Action frame after updating beacon */ lim_send_chan_switch_action_frame(mac_ctx, ch, ch_width, session); diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 47afecf703..0794f9fa17 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -587,7 +587,6 @@ typedef struct sap_config { uint32_t ap_table_expiration_time; uint32_t ht_op_mode_fixed; enum QDF_OPMODE persona; /* Tells us which persona, GO or AP */ - uint8_t disableDFSChSwitch; bool enOverLapCh; #ifdef WLAN_FEATURE_11W bool mfpRequired; @@ -625,7 +624,6 @@ typedef struct sap_config { uint8_t sap_chanswitch_beacon_cnt; uint8_t sap_chanswitch_mode; bool chan_switch_hostapd_rate_enabled; - bool dfs_beacon_tx_enhanced; uint16_t reduced_beacon_interval; } tsap_config_t; @@ -720,7 +718,6 @@ typedef struct sSapDfsInfo { /* beacon count before channel switch */ uint8_t sap_ch_switch_beacon_cnt; uint8_t sap_ch_switch_mode; - bool dfs_beacon_tx_enhanced; uint16_t reduced_beacon_interval; } tSapDfsInfo; @@ -1268,19 +1265,6 @@ QDF_STATUS wlansap_get_dfs_ignore_cac(mac_handle_t mac_handle, QDF_STATUS wlansap_set_dfs_ignore_cac(mac_handle_t mac_handle, uint8_t ignore_cac); -/** - * wlansap_set_dfs_restrict_japan_w53() - enable/disable dfS for japan - * @mac_handle: Opaque handle to the global MAC context - * @disable_dfs_w53: Indicates if Japan W53 is disabled when set to 1 - * Indicates if Japan W53 is enabled when set to 0 - * - * This API is used to enable or disable Japan W53 Band - * Return: The QDF_STATUS code associated with performing the operation - * QDF_STATUS_SUCCESS: Success - */ -QDF_STATUS wlansap_set_dfs_restrict_japan_w53(mac_handle_t mac_handle, - uint8_t disable_dfs_w53); - #ifdef FEATURE_AP_MCC_CH_AVOIDANCE QDF_STATUS wlan_sap_set_channel_avoidance(mac_handle_t mac_handle, @@ -1438,18 +1422,6 @@ QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context, */ uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx); -/** - * wlansap_set_tx_leakage_threshold() - set sap tx leakage threshold. - * @mac_handle: Opaque handle to the global MAC context - * @tx_leakage_threshold: sap tx leakage threshold - * - * This function set sap tx leakage threshold. - * - * Return: QDF_STATUS. - */ -QDF_STATUS wlansap_set_tx_leakage_threshold(mac_handle_t mac_handle, - uint16_t tx_leakage_threshold); - /* * wlansap_set_invalid_session() - set session ID to invalid * @sap_ctx: pointer to the SAP context diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 74d06117ba..96e267147f 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -419,7 +419,7 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle, uint8_t dfs_beacon_start_req = 0; bool sap_scc_dfs; - if (sap_ctx->csr_roamProfile.disableDFSChSwitch) { + if (mac_ctx->mlme_cfg->dfs_cfg.dfs_disable_channel_switch) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("sapdfs: DFS channel switch disabled")); @@ -582,7 +582,7 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx, tWLAN_SAPEvent sap_event; if (sap_is_dfs_cac_wait_state(sap_ctx)) { - if (sap_ctx->csr_roamProfile.disableDFSChSwitch) { + if (mac_ctx->mlme_cfg->dfs_cfg.dfs_disable_channel_switch) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "sapdfs: DFS channel switch disabled"); diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 2e65f68f95..828c6e09b3 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -193,7 +193,7 @@ static uint8_t sap_random_channel_sel(struct sap_context *sap_ctx) uint8_t ch_wd; struct wlan_objmgr_pdev *pdev = NULL; struct ch_params *ch_params; - uint32_t hw_mode; + uint32_t hw_mode, flag = 0; struct mac_context *mac_ctx; struct dfs_acs_info acs_info = {0}; @@ -226,8 +226,12 @@ static uint8_t sap_random_channel_sel(struct sap_context *sap_ctx) } else { acs_info.acs_mode = false; } + + if (mac_ctx->mlme_cfg->dfs_cfg.dfs_prefer_non_dfs) + flag |= DFS_RANDOM_CH_FLAG_NO_DFS_CH; + if (QDF_IS_STATUS_ERROR(utils_dfs_get_random_channel( - pdev, 0, ch_params, &hw_mode, &ch, &acs_info))) { + pdev, flag, ch_params, &hw_mode, &ch, &acs_info))) { /* No available channel found */ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("No available channel found!!!")); @@ -544,34 +548,12 @@ void sap_dfs_set_current_channel(void *ctx) tgt_dfs_get_radars(pdev); } tgt_dfs_set_phyerr_filter_offload(pdev); - if (sap_ctx->csr_roamProfile.disableDFSChSwitch) + if (mac_ctx->mlme_cfg->dfs_cfg.dfs_disable_channel_switch) tgt_dfs_control(pdev, DFS_SET_USENOL, &use_nol, sizeof(uint32_t), NULL, NULL, &error); } } -bool sap_dfs_is_w53_invalid(mac_handle_t mac_handle, uint8_t channel_id) -{ - tpAniSirGlobal mac; - - mac = MAC_CONTEXT(mac_handle); - if (NULL == mac) { - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, - FL("invalid mac")); - return false; - } - - /* - * Check for JAPAN W53 Channel operation capability - */ - if (true == mac->sap.SapDfsInfo.is_dfs_w53_disabled && - true == IS_CHAN_JAPAN_W53(channel_id)) { - return true; - } - - return false; -} - bool sap_dfs_is_channel_in_preferred_location(mac_handle_t mac_handle, uint8_t channel_id) { @@ -2826,7 +2808,6 @@ sapconvert_to_csr_profile(tsap_config_t *pconfig_params, eCsrRoamBssType bssType profile->BSSType = eCSR_BSS_TYPE_INFRA_AP; profile->SSIDs.numOfSSIDs = 1; profile->csrPersona = pconfig_params->persona; - profile->disableDFSChSwitch = pconfig_params->disableDFSChSwitch; qdf_mem_zero(profile->SSIDs.SSIDList[0].SSID.ssId, sizeof(profile->SSIDs.SSIDList[0].SSID.ssId)); @@ -3462,7 +3443,7 @@ uint8_t sap_indicate_radar(struct sap_context *sap_ctx) if (sap_ctx->fsm_state == SAP_STARTED) mac->sap.SapDfsInfo.csaIERequired = true; - if (sap_ctx->csr_roamProfile.disableDFSChSwitch) + if (mac->mlme_cfg->dfs_cfg.dfs_disable_channel_switch) return sap_ctx->channel; /* set the Radar Found flag in SapDfsInfo */ diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index 764fd4f98a..a3544eca5f 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -387,21 +387,6 @@ bool sap_is_conc_sap_doing_scc_dfs(mac_handle_t mac_handle, uint8_t sap_get_total_number_sap_intf(mac_handle_t mac_handle); -/** - * sap_dfs_is_w53_invalid() - Check to see if invalid W53 operation requested - * @mac_handle: Opaque handle to the global MAC context - * @channel_id: Channel number to be verified - * - * This function checks if the passed channel is W53 and, if so, if - * SAP W53 operation is allowed. - * - * Return: - * * true - operation is invalid because the channel is W53 and W53 - * operation has been disabled - * * false - operation is valid - */ -bool sap_dfs_is_w53_invalid(mac_handle_t mac_handle, uint8_t channel_id); - /** * sap_dfs_is_channel_in_preferred_location() - Verify a channel is valid * with respect to indoor/outdoor location setting diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index e9fb64f5ad..54b2468a98 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -721,8 +721,6 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, * Copy the DFS Test Mode setting to pmac for * access in lower layers */ - pmac->sap.SapDfsInfo.disable_dfs_ch_switch = - pConfig->disableDFSChSwitch; pmac->sap.SapDfsInfo.sap_ch_switch_beacon_cnt = pConfig->sap_chanswitch_beacon_cnt; pmac->sap.SapDfsInfo.sap_ch_switch_mode = @@ -733,8 +731,6 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, sap_ctx->csr_roamProfile.csrPersona; pmac->sap.sapCtxList[sap_ctx->sessionId].sessionID = sap_ctx->sessionId; - pmac->sap.SapDfsInfo.dfs_beacon_tx_enhanced = - pConfig->dfs_beacon_tx_enhanced; pmac->sap.SapDfsInfo.reduced_beacon_interval = pConfig->reduced_beacon_interval; @@ -1857,47 +1853,6 @@ QDF_STATUS wlansap_set_dfs_ignore_cac(mac_handle_t mac_handle, return QDF_STATUS_SUCCESS; } -QDF_STATUS -wlansap_set_dfs_restrict_japan_w53(mac_handle_t mac_handle, - uint8_t disable_dfs_w53) -{ - tpAniSirGlobal mac = NULL; - QDF_STATUS status; - enum dfs_reg dfs_region; - - if (NULL != mac_handle) { - mac = MAC_CONTEXT(mac_handle); - } else { - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, - "%s: Invalid mac_handle pointer", __func__); - return QDF_STATUS_E_FAULT; - } - - wlan_reg_get_dfs_region(mac->pdev, &dfs_region); - - /* - * Set the JAPAN W53 restriction only if the current - * regulatory domain is JAPAN. - */ - if (DFS_MKK_REGION == dfs_region) { - mac->sap.SapDfsInfo.is_dfs_w53_disabled = disable_dfs_w53; - QDF_TRACE(QDF_MODULE_ID_SAP, - QDF_TRACE_LEVEL_INFO_LOW, - FL("sapdfs: SET DFS JAPAN W53 DISABLED = %d"), - mac->sap.SapDfsInfo.is_dfs_w53_disabled); - - status = QDF_STATUS_SUCCESS; - } else { - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, - FL - ("Regdomain not japan, set disable JP W53 not valid")); - - status = QDF_STATUS_E_FAULT; - } - - return status; -} - bool sap_is_auto_channel_select(struct sap_context *sapcontext) { if (NULL == sapcontext) { @@ -2448,25 +2403,6 @@ uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx) return wlan_sap_get_vht_ch_width(sap_ctx); } -QDF_STATUS wlansap_set_tx_leakage_threshold(mac_handle_t mac_handle, - uint16_t tx_leakage_threshold) -{ - tpAniSirGlobal mac; - - if (NULL == mac_handle) { - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, - "%s: Invalid mac_handle pointer", __func__); - return QDF_STATUS_E_FAULT; - } - - mac = MAC_CONTEXT(mac_handle); - tgt_dfs_set_tx_leakage_threshold(mac->pdev, tx_leakage_threshold); - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, - "%s: leakage_threshold %d", __func__, - tx_leakage_threshold); - return QDF_STATUS_SUCCESS; -} - QDF_STATUS wlansap_set_invalid_session(struct sap_context *sap_ctx) { if (NULL == sap_ctx) { diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 8a85c17141..a40b923312 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -880,7 +880,6 @@ struct csr_roam_profile { uint8_t wps_state; tCsrMobilityDomainInfo MDID; enum QDF_OPMODE csrPersona; - uint8_t disableDFSChSwitch; /* addIe params */ tSirAddIeParams addIeParams; uint16_t beacon_tx_rate; @@ -1119,7 +1118,6 @@ typedef struct tagCsrConfigParam { #ifdef FEATURE_AP_MCC_CH_AVOIDANCE bool sap_channel_avoidance; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ - uint8_t f_prefer_non_dfs_on_radar; bool is_ps_enabled; uint32_t auto_bmps_timer_val; uint32_t dual_mac_feature_disable; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 35b1c245d8..0c14f40d95 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2721,9 +2721,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal mac, pParam->sap_channel_avoidance; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ - mac->f_prefer_non_dfs_on_radar = - pParam->f_prefer_non_dfs_on_radar; - mac->sme.ps_global_info.ps_enabled = pParam->is_ps_enabled; mac->sme.ps_global_info.auto_bmps_timer_val = @@ -2888,8 +2885,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal mac, tCsrConfigParam *pParam) pParam->sap_channel_avoidance = mac->sap.sap_channel_avoidance; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ pParam->max_intf_count = mac->sme.max_intf_count; - pParam->f_prefer_non_dfs_on_radar = - mac->f_prefer_non_dfs_on_radar; pParam->dual_mac_feature_disable = mac->dual_mac_feature_disable; pParam->sta_sap_scc_on_dfs_chan =