qcacld-3.0: Enable configurable dfs_pri_multiplier
Enable configurable dfs_pri_multiplier. The ETSI typ2 type3 radar
detection ratio is lower than expected(>80%) while channel loading is
high(>30%). The host improvement for this are:
1. Add configurable dfs_pri_multiplier, controlled by
DFS_PRI_MULTIPLIER. Default value 2, min 1, max 10.
2. Lower adrastea ETSI type 2/3/4 radar filter rssi_threshold,
controlled by DFS_OVERRIDE_RF_THRESHOLD, dfs log shows that
QCS405 target report RSSI range [18, 45] while radar power
is 3 dbm. By using default rssi_threshold 24 will reject
many radar pulses, which leads to low detection ratio.
3. Calculate deltapri for each searchpri based on dfs_pri_multiplier
in dfs_count_the_other_delay_elements(), check deltapri
between [1, dfs_pri_multiplier] * refpri and searchpri, if
the primargin is desired, mark it as matched pulse.
4. Pick lowpri as refpri for the radar filter with
rf_ignore_pri_window equals to 0 while DFS_PRI_MULTIPLIER is
enabled. Observed original findref logic has some problems
which selects refpri is bigger than lowpri, which leads to
the lowpri pulses pri_match are set to 0, and in this case,
radar was not detected. Example for the issue, assume
rf->rf_pulseid 34 (ETSI type 2) has 7 pulses with pri:
1489, 2978, 2978, 2978, 1489, 2978, 1489 us in this case,
highscore is 4 (2978), scoreindex is 5, refpri is 2978, which
leads to: index 0, 4, 6 pulses with pri_match 0 in
dfs_count_the_other_delay_elements(). The fix is to select
lowpri as refpri(1489 in this case).
Change-Id: I1f3ca3298c9ab1f1e2651ad6b4a0a4810f83f8a1
CRs-Fixed: 2522506
diff --git a/Kbuild b/Kbuild
index 03b4ac2..3dd5176 100644
--- a/Kbuild
+++ b/Kbuild
@@ -2286,6 +2286,12 @@
#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 8a3f1f4..4cf415c 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -940,6 +940,8 @@
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 bfc4763..e1a1eea 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
@@ -49,6 +49,31 @@
/*
* <ini>
+ * 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
+ *
+ * </ini>
+ */
+#define CFG_DFS_RADAR_PRI_MULTIPLIER CFG_INI_UINT( \
+ "gDFSradarMappingPriMultiplier", \
+ 1, \
+ 10, \
+ 2, \
+ CFG_VALUE_OR_DEFAULT, \
+ "dfs pri multiplier")
+
+/*
+ * <ini>
* gDfsBeaconTxEnhanced - beacon tx enhanced
* @Min: 0
* @Max: 1
@@ -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 0bc87ae..9cc0c92 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 @@
* @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 @@
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 0e81859..c87f15e 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -752,6 +752,28 @@
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
* @dfs_filter_offload: Pointer to the value which will be filled
diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
index 3e79db0..d8f3a01 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
@@ -326,6 +326,41 @@
}
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 14e8155..0ddd4a1 100644
--- a/configs/default_defconfig
+++ b/configs/default_defconfig
@@ -106,6 +106,8 @@
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 ce77021..9b6894a 100644
--- a/configs/qcs40x.snoc.perf_defconfig
+++ b/configs/qcs40x.snoc.perf_defconfig
@@ -33,6 +33,8 @@
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 08b1b2c..508269b 100644
--- a/core/hdd/src/wlan_hdd_regulatory.c
+++ b/core/hdd/src/wlan_hdd_regulatory.c
@@ -1265,6 +1265,26 @@
}
}
+/**
+ * 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 @@
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 7f3c9b0..1594a38 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -1277,6 +1277,20 @@
#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
* @is_vendor_acs: if vendor specific acs is enabled
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 842923f..e6408ba 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -2625,6 +2625,19 @@
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);