diff --git a/Kbuild b/Kbuild index 03b4ac2f5b8f..3dd517623956 100644 --- a/Kbuild +++ b/Kbuild @@ -2286,6 +2286,12 @@ cppflags-$(CONFIG_MULTI_IF_LOG) += -DMULTI_IF_LOG #Set SLUB_MEM_OPTIMIZE cppflags-$(CONFIG_SLUB_MEM_OPTIMIZE) += -DSLUB_MEM_OPTIMIZE +#Set DFS_PRI_MULTIPLIER +cppflags-$(CONFIG_DFS_PRI_MULTIPLIER) += -DDFS_PRI_MULTIPLIER + +#Set DFS_OVERRIDE_RF_THRESHOLD +cppflags-$(CONFIG_DFS_OVERRIDE_RF_THRESHOLD) += -DDFS_OVERRIDE_RF_THRESHOLD + #Enable OL debug and wmi unified functions cppflags-$(CONFIG_ATH_PERF_PWR_OFFLOAD) += -DATH_PERF_PWR_OFFLOAD diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 8a3f1f48d205..4cf415c4e543 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -940,6 +940,8 @@ static void mlme_init_dfs_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_DISABLE_DFS_JAPAN_W53); dfs_cfg->sap_tx_leakage_threshold = cfg_get(psoc, CFG_SAP_TX_LEAKAGE_THRESHOLD); + dfs_cfg->dfs_pri_multiplier = + cfg_get(psoc, CFG_DFS_RADAR_PRI_MULTIPLIER); } 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 bfc476382689..e1a1eea334f2 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_dfs.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_dfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 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 @@ -47,6 +47,31 @@ CFG_VALUE_OR_DEFAULT, \ "sap tx leakage threshold") +/* + * + * gDFSradarMappingPriMultiplier - dfs pri multiplier + * @Min: 1 + * @Max: 10 + * @Default: 2 + * + * customer can set this value from 1 to 10 which means + * host could handle missing pulses while there is high + * channel loading, for example: 30% ETSI and 50% Japan W53 + * + * Related: none + * + * Usage: External + * + * + */ +#define CFG_DFS_RADAR_PRI_MULTIPLIER CFG_INI_UINT( \ + "gDFSradarMappingPriMultiplier", \ + 1, \ + 10, \ + 2, \ + CFG_VALUE_OR_DEFAULT, \ + "dfs pri multiplier") + /* * * gDfsBeaconTxEnhanced - beacon tx enhanced @@ -203,6 +228,7 @@ CFG(CFG_DISABLE_DFS_CH_SWITCH) \ CFG(CFG_DFS_BEACON_TX_ENHANCED) \ CFG(CFG_SAP_TX_LEAKAGE_THRESHOLD) \ + CFG(CFG_DFS_RADAR_PRI_MULTIPLIER) \ CFG(CFG_ENABLE_NON_DFS_CHAN_ON_RADAR) \ CFG(CFG_ENABLE_DFS_MASTER_CAPABILITY) \ CFG(CFG_DISABLE_DFS_JAPAN_W53) \ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 0bc87ae0ae5d..9cc0c92b1539 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -702,6 +702,7 @@ struct wlan_mlme_cfg_sap { * @dfs_prefer_non_dfs: perefer non dfs channel after radar * @dfs_disable_japan_w53: Disable W53 channels * @sap_tx_leakage_threshold: sap tx leakage threshold + * @dfs_pri_multiplier: dfs_pri_multiplier for handle missing pulses */ struct wlan_mlme_dfs_cfg { bool dfs_master_capable; @@ -712,6 +713,7 @@ struct wlan_mlme_dfs_cfg { bool dfs_prefer_non_dfs; bool dfs_disable_japan_w53; uint32_t sap_tx_leakage_threshold; + uint32_t dfs_pri_multiplier; }; /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 0e818596dafc..c87f15ea2742 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -751,6 +751,28 @@ QDF_STATUS ucfg_mlme_set_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc, uint32_t sap_tx_leakage_threshold); +/* + * ucfg_mlme_get_dfs_pri_multiplier() - Get dfs pri multiplier + * @psoc: pointer to psoc object + * @dfs_pri_multiplier: Pointer to the value which will be filled + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_dfs_pri_multiplier(struct wlan_objmgr_psoc *psoc, + uint32_t *dfs_pri_multiplier); + +/* + * ucfg_mlme_set_dfs_pri_multiplier() - Set dfs pri multiplier + * @psoc: pointer to psoc object + * @dfs_pri_multiplier: Value that needs to be set. + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_set_dfs_pri_multiplier(struct wlan_objmgr_psoc *psoc, + uint32_t dfs_pri_multiplier); + /* * ucfg_mlme_get_dfs_filter_offload() - Get the dfs filter offload * @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 3e79db0a69ae..d8f3a01761cb 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -325,6 +325,41 @@ ucfg_mlme_set_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +ucfg_mlme_get_dfs_pri_multiplier(struct wlan_objmgr_psoc *psoc, + uint32_t *dfs_pri_multiplier) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *dfs_pri_multiplier = + cfg_default(CFG_DFS_RADAR_PRI_MULTIPLIER); + return QDF_STATUS_E_INVAL; + } + + *dfs_pri_multiplier = + mlme_obj->cfg.dfs_cfg.dfs_pri_multiplier; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_set_dfs_pri_multiplier(struct wlan_objmgr_psoc *psoc, + uint32_t dfs_pri_multiplier) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_INVAL; + + mlme_obj->cfg.dfs_cfg.dfs_pri_multiplier = + dfs_pri_multiplier; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_dfs_filter_offload(struct wlan_objmgr_psoc *psoc, bool *dfs_filter_offload) diff --git a/configs/default_defconfig b/configs/default_defconfig index 14e8155d63ef..0ddd4a1c7401 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -106,6 +106,8 @@ ifeq ($(CONFIG_ARCH_QCS40X), y) CONFIG_RX_PERFORMANCE := y CONFIG_TGT_NUM_MSDU_DESC := 900 CONFIG_MULTI_IF_LOG := y + CONFIG_DFS_PRI_MULTIPLIER := y + CONFIG_DFS_OVERRIDE_RF_THRESHOLD := y endif CONFIG_WLAN_FEATURE_MBSSID := y diff --git a/configs/qcs40x.snoc.perf_defconfig b/configs/qcs40x.snoc.perf_defconfig index ce77021bf77d..9b6894afd24b 100644 --- a/configs/qcs40x.snoc.perf_defconfig +++ b/configs/qcs40x.snoc.perf_defconfig @@ -33,6 +33,8 @@ CONFIG_WLAN_SPECTRAL_ENABLE := y CONFIG_WMI_CMD_STRINGS := n CONFIG_SOFTAP_CHANNEL_RANGE := y CONFIG_FEATURE_WLAN_SCAN_PNO := y +CONFIG_DFS_PRI_MULTIPLIER := y +CONFIG_DFS_OVERRIDE_RF_THRESHOLD := y # Interface specific features CONFIG_ROME_IF = snoc diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 08b1b2c6951c..508269b13c45 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -1265,6 +1265,26 @@ static enum nl80211_dfs_regions dfs_reg_to_nl80211_dfs_regions( } } +/** + * hdd_set_dfs_pri_multiplier() - Set dfs_pri_multiplier for ETSI region + * @dfs_region: DFS region + * + * Return: none + */ +#ifdef DFS_PRI_MULTIPLIER +static void hdd_set_dfs_pri_multiplier(struct hdd_context *hdd_ctx, + enum dfs_reg dfs_region) +{ + if (dfs_region == DFS_ETSI_REGION) + wlan_sap_set_dfs_pri_multiplier(hdd_ctx->mac_handle); +} +#else +static inline void hdd_set_dfs_pri_multiplier(struct hdd_context *hdd_ctx, + enum dfs_reg dfs_region) +{ +} +#endif + void hdd_send_wiphy_regd_sync_event(struct hdd_context *hdd_ctx) { struct ieee80211_regdomain *regd; @@ -1302,6 +1322,9 @@ void hdd_send_wiphy_regd_sync_event(struct hdd_context *hdd_ctx) qdf_mem_copy(regd->alpha2, reg_rules->alpha2, REG_ALPHA2_LEN + 1); regd->dfs_region = dfs_reg_to_nl80211_dfs_regions(reg_rules->dfs_region); + + hdd_set_dfs_pri_multiplier(hdd_ctx, reg_rules->dfs_region); + regd_rules = regd->reg_rules; hdd_debug("Regulatory Domain %s", regd->alpha2); hdd_debug("start freq\tend freq\t@ max_bw\tant_gain\tpwr\tflags"); diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 7f3c9b0592b4..1594a38fa159 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1276,6 +1276,20 @@ static inline QDF_STATUS wlansap_set_dfs_nol(struct sap_context *sap_ctx, } #endif +/** + * wlan_sap_set_dfs_pri_multiplier() - Set dfs_pri_multiplier + * @mac_handle: Opaque handle to the global MAC context + * + * Return: none + */ +#ifdef DFS_PRI_MULTIPLIER +void wlan_sap_set_dfs_pri_multiplier(mac_handle_t mac_handle); +#else +static inline void wlan_sap_set_dfs_pri_multiplier(mac_handle_t mac_handle) +{ +} +#endif + /** * wlan_sap_set_vendor_acs() - Set vendor specific acs in sap context * @sap_context: SAP context diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 842923f05ab1..e6408baccba0 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -2625,6 +2625,19 @@ void wlan_sap_enable_phy_error_logs(mac_handle_t mac_handle, sizeof(uint32_t), NULL, NULL, &error); } +#ifdef DFS_PRI_MULTIPLIER +void wlan_sap_set_dfs_pri_multiplier(mac_handle_t mac_handle) +{ + int error; + + struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); + + tgt_dfs_control(mac_ctx->pdev, DFS_SET_PRI_MULTIPILER, + &mac_ctx->mlme_cfg->dfs_cfg.dfs_pri_multiplier, + sizeof(uint32_t), NULL, NULL, &error); +} +#endif + uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx) { return wlan_sap_get_vht_ch_width(sap_ctx);