diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index b9043bb8c5..880bb9ded1 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -1920,6 +1920,22 @@ static void mlme_init_powersave_params(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_DTIM_SELECTION_DIVERSITY);
}
+#ifdef MWS_COEX
+static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_mwc *mwc)
+{
+ mwc->mws_coex_4g_quick_tdm =
+ cfg_get(psoc, CFG_MWS_COEX_4G_QUICK_FTDM);
+ mwc->mws_coex_5g_nr_pwr_limit =
+ cfg_get(psoc, CFG_MWS_COEX_5G_NR_PWR_LIMIT);
+}
+#else
+static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_mwc *mwc)
+{
+}
+#endif
+
QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
{
struct wlan_mlme_psoc_obj *mlme_obj;
@@ -1966,6 +1982,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
mlme_init_btm_cfg(&mlme_cfg->btm);
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);
return status;
}
diff --git a/components/mlme/dispatcher/inc/cfg_mlme.h b/components/mlme/dispatcher/inc/cfg_mlme.h
index bc5e0e236d..92f7fad610 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme.h
@@ -55,6 +55,7 @@
#include "cfg_mlme_btm.h"
#include "cfg_mlme_fe_wlm.h"
#include "cfg_mlme_fe_rrm.h"
+#include "cfg_mlme_mwc.h"
/* Please Maintain Alphabetic Order here */
#define CFG_MLME_ALL \
@@ -73,13 +74,13 @@
CFG_MBO_ALL \
CFG_MLME_POWER_ALL \
CFG_MLME_PRODUCT_DETAILS_ALL \
+ CFG_MWC_ALL \
CFG_NSS_CHAINS_ALL \
CFG_OBSS_HT40_ALL \
CFG_OCE_ALL \
CFG_POWERSAVE_ALL \
CFG_QOS_ALL \
CFG_RATES_ALL \
- CFG_WMM_PARAMS_ALL\
CFG_SAP_ALL \
CFG_SAP_PROTECTION_ALL \
CFG_SCORING_ALL \
@@ -90,6 +91,7 @@
CFG_VHT_CAPS_ALL \
CFG_WEP_PARAMS_ALL \
CFG_WIFI_POS_ALL \
+ CFG_WMM_PARAMS_ALL\
CFG_WPS_ALL
#endif /* __CFG_MLME_H */
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_mwc.h b/components/mlme/dispatcher/inc/cfg_mlme_mwc.h
new file mode 100644
index 0000000000..291f3e102a
--- /dev/null
+++ b/components/mlme/dispatcher/inc/cfg_mlme_mwc.h
@@ -0,0 +1,90 @@
+/*
+ * 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 WMC.
+ */
+#ifndef CFG_MLME_MWC_H_
+#define CFG_MLME_MWC_H_
+
+#ifdef MWS_COEX
+/*
+ *
+ * gMwsCoex4gQuickTdm - Bitmap to control MWS-COEX 4G quick FTDM policy
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * It is a 32 bit value such that the various bits represent as below:
+ * Bit-0 : 0 - Don't allow quick FTDM policy (Default)
+ * 1 - Allow quick FTDM policy
+ * Bit 1-31 : reserved for future use
+ *
+ * It is used to enable or disable MWS-COEX 4G (LTE) Quick FTDM
+ *
+ * Usage: Internal
+ *
+ *
+ */
+
+#define CFG_MWS_COEX_4G_QUICK_FTDM CFG_INI_UINT( \
+ "gMwsCoex4gQuickTdm", \
+ 0x00000000, \
+ 0xFFFFFFFF, \
+ 0x00000000, \
+ CFG_VALUE_OR_DEFAULT, \
+ "set mws-coex 4g quick ftdm policy")
+
+/*
+ *
+ * gMwsCoex5gnrPwrLimit - Bitmap to set MWS-COEX 5G-NR power limit
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * It is a 32 bit value such that the various bits represent as below:
+ * Bit-0 : Don't apply user specific power limit,
+ * use internal power limit (Default)
+ * Bit 1-2 : Invalid value (Ignored)
+ * Bit 3-21 : Apply the specified value as the external power limit, in dBm
+ * Bit 22-31 : Invalid value (Ignored)
+ *
+ * It is used to set MWS-COEX 5G-NR power limit
+ *
+ * Usage: Internal
+ *
+ *
+ */
+
+#define CFG_MWS_COEX_5G_NR_PWR_LIMIT CFG_INI_UINT( \
+ "gMwsCoex5gnrPwrLimit", \
+ 0x00000000, \
+ 0xFFFFFFFF, \
+ 0x00000000, \
+ CFG_VALUE_OR_DEFAULT, \
+ "set mws-coex 5g-nr power limit")
+
+#define CFG_MWC_ALL \
+ CFG(CFG_MWS_COEX_4G_QUICK_FTDM) \
+ CFG(CFG_MWS_COEX_5G_NR_PWR_LIMIT)
+
+#else
+#define CFG_MWC_ALL
+#endif /* MWS_COEX */
+
+#endif /* CFG_MLME_MWC_H_ */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
index 8067d4bfb1..11ee238bdc 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
@@ -1750,6 +1750,21 @@ struct wlan_mlme_fe_rrm {
uint8_t rm_capability[MLME_RMENABLEDCAP_MAX_LEN];
};
+#ifdef MWS_COEX
+/*
+ * struct wlan_mlme_mwc - MWC related configs
+ * @mws_coex_4g_quick_tdm: bitmap to set mws-coex 5g-nr power limit
+ * @mws_coex_5g_nr_pwr_limit: bitmap to set mws-coex 5g-nr power limit
+ **/
+struct wlan_mlme_mwc {
+ uint32_t mws_coex_4g_quick_tdm;
+ uint32_t mws_coex_5g_nr_pwr_limit;
+};
+#else
+struct wlan_mlme_mwc {
+};
+#endif
+
/**
* struct wlan_mlme_cfg - MLME config items
* @chainmask_cfg: VHT chainmask related cfg items
@@ -1785,6 +1800,7 @@ struct wlan_mlme_fe_rrm {
* @btm: BTM related CFG itmes
* @wlm_config: WLM related CFG items
* @rrm_config: RRM related CFG items
+ * @mwc: MWC related CFG items
*/
struct wlan_mlme_cfg {
struct wlan_mlme_chainmask chainmask_cfg;
@@ -1822,6 +1838,7 @@ struct wlan_mlme_cfg {
struct wlan_mlme_btm btm;
struct wlan_mlme_fe_wlm wlm_config;
struct wlan_mlme_fe_rrm rrm_config;
+ struct wlan_mlme_mwc mwc;
};
#endif
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index 03e726ce40..bde4ce7675 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -3333,4 +3333,28 @@ ucfg_mlme_override_bmps_imps(struct wlan_objmgr_psoc *psoc)
return wlan_mlme_override_bmps_imps(psoc);
}
+#ifdef MWS_COEX
+/**
+ * ucfg_mlme_get_mws_coex_4g_quick_tdm() - Get mws coex 4g quick tdm
+ * @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_mws_coex_4g_quick_tdm(struct wlan_objmgr_psoc *psoc,
+ uint32_t *val);
+
+/**
+ * ucfg_mlme_get_mws_coex_5g_nr_pwr_limit() - Get mws coex 5g nr pwr limit
+ * @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_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
+ uint32_t *val);
+#endif
+
#endif /* _WLAN_MLME_UCFG_API_H_ */
diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
index 1cd3de9605..9bc700b919 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
@@ -1210,3 +1210,41 @@ ucfg_mlme_get_latency_enable(struct wlan_objmgr_psoc *psoc, bool *value)
*value = mlme_obj->cfg.wlm_config.latency_enable;
return QDF_STATUS_SUCCESS;
}
+
+#ifdef MWS_COEX
+QDF_STATUS
+ucfg_mlme_get_mws_coex_4g_quick_tdm(struct wlan_objmgr_psoc *psoc,
+ uint32_t *val)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj) {
+ *val = cfg_default(CFG_MWS_COEX_4G_QUICK_FTDM);
+ mlme_err("mlme obj null");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ *val = mlme_obj->cfg.mwc.mws_coex_4g_quick_tdm;
+
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
+ uint32_t *val)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj) {
+ *val = cfg_default(CFG_MWS_COEX_5G_NR_PWR_LIMIT);
+ mlme_err("mlme obj null");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ *val = mlme_obj->cfg.mwc.mws_coex_5g_nr_pwr_limit;
+
+ return QDF_STATUS_SUCCESS;
+}
+#endif
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index ad35ae073c..19b225a670 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -3224,58 +3224,6 @@ enum hdd_link_speed_rpt_type {
#define CFG_ENABLE_SECONDARY_RATE_MAX (0x3F)
#define CFG_ENABLE_SECONDARY_RATE_DEFAULT (0x17)
-#ifdef MWS_COEX
-/*
- *
- * gMwsCoex4gQuickTdm - Bitmap to control MWS-COEX 4G quick FTDM policy
- * @Min: 0x00000000
- * @Max: 0xFFFFFFFF
- * @Default: 0x00000000
- *
- * It is a 32 bit value such that the various bits represent as below:
- * Bit-0 : 0 - Don't allow quick FTDM policy (Default)
- * 1 - Allow quick FTDM policy
- * Bit 1-31 : reserved for future use
- *
- * It is used to enable or disable MWS-COEX 4G (LTE) Quick FTDM
- *
- * Usage: Internal
- *
- *
- */
-
-#define CFG_MWS_COEX_4G_QUICK_FTDM_NAME "gMwsCoex4gQuickTdm"
-#define CFG_MWS_COEX_4G_QUICK_FTDM_MIN (0x00000000)
-#define CFG_MWS_COEX_4G_QUICK_FTDM_MAX (0xFFFFFFFF)
-#define CFG_MWS_COEX_4G_QUICK_FTDM_DEFAULT (0x00000000)
-
-/*
- *
- * gMwsCoex5gnrPwrLimit - Bitmap to set MWS-COEX 5G-NR power limit
- * @Min: 0x00000000
- * @Max: 0xFFFFFFFF
- * @Default: 0x00000000
- *
- * It is a 32 bit value such that the various bits represent as below:
- * Bit-0 : Don't apply user specific power limit,
- * use internal power limit (Default)
- * Bit 1-2 : Invalid value (Ignored)
- * Bit 3-21 : Apply the specified value as the external power limit, in dBm
- * Bit 22-31 : Invalid value (Ignored)
- *
- * It is used to set MWS-COEX 5G-NR power limit
- *
- * Usage: Internal
- *
- *
- */
-
-#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_NAME "gMwsCoex5gnrPwrLimit"
-#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_MIN (0x00000000)
-#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_MAX (0xFFFFFFFF)
-#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_DEFAULT (0x00000000)
-#endif
-
/*
*
* gEnableChangeChannelBandWidth - Enable/Disable change
@@ -3347,14 +3295,6 @@ struct hdd_config {
uint32_t vc_mode_cfg_bitmap;
#endif
-#ifdef MWS_COEX
- /* Bitmap for MWS-COEX 4G Quick FTDM */
- uint32_t mws_coex_4g_quick_tdm;
-
- /* Bitmap for MWS-COEX 5G-NR power limit */
- uint32_t mws_coex_5g_nr_pwr_limit;
-#endif
-
/* Additional Handoff params */
uint32_t nPassiveMaxChnTime; /* in units of milliseconds */
uint32_t nActiveMaxChnTime; /* in units of milliseconds */
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index ac00990130..b7f0839a1f 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -852,20 +852,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT,
CFG_CHANGE_CHANNEL_BANDWIDTH_MIN,
CFG_CHANGE_CHANNEL_BANDWIDTH_MAX),
-#ifdef MWS_COEX
- REG_VARIABLE(CFG_MWS_COEX_4G_QUICK_FTDM_NAME, WLAN_PARAM_HexInteger,
- struct hdd_config, mws_coex_4g_quick_tdm,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_MWS_COEX_4G_QUICK_FTDM_DEFAULT,
- CFG_MWS_COEX_4G_QUICK_FTDM_MIN,
- CFG_MWS_COEX_4G_QUICK_FTDM_MAX),
- REG_VARIABLE(CFG_MWS_COEX_5G_NR_PWR_LIMIT_NAME, WLAN_PARAM_HexInteger,
- struct hdd_config, mws_coex_5g_nr_pwr_limit,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_MWS_COEX_5G_NR_PWR_LIMIT_DEFAULT,
- CFG_MWS_COEX_5G_NR_PWR_LIMIT_MIN,
- CFG_MWS_COEX_5G_NR_PWR_LIMIT_MAX),
-#endif
REG_VARIABLE(CFG_REMOVE_TIME_STAMP_SYNC_CMD_NAME, WLAN_PARAM_Integer,
struct hdd_config, remove_time_stamp_sync_cmd,
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 7938ceaca7..3fcd38ee74 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -10863,22 +10863,30 @@ static int hdd_set_auto_shutdown_cb(struct hdd_context *hdd_ctx)
static int hdd_init_mws_coex(struct hdd_context *hdd_ctx)
{
int ret = 0;
+ uint32_t mws_coex_4g_quick_tdm = 0, mws_coex_5g_nr_pwr_limit = 0;
+
+ ucfg_mlme_get_mws_coex_4g_quick_tdm(hdd_ctx->psoc,
+ &mws_coex_4g_quick_tdm);
ret = sme_cli_set_command(0, WMI_PDEV_PARAM_MWSCOEX_4G_ALLOW_QUICK_FTDM,
- hdd_ctx->config->mws_coex_4g_quick_tdm,
+ mws_coex_4g_quick_tdm,
PDEV_CMD);
if (ret) {
hdd_warn("Unable to send MWS-COEX 4G quick FTDM policy");
return ret;
}
+ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(hdd_ctx->psoc,
+ &mws_coex_5g_nr_pwr_limit);
+
ret = sme_cli_set_command(0, WMI_PDEV_PARAM_MWSCOEX_SET_5GNR_PWR_LIMIT,
- hdd_ctx->config->mws_coex_5g_nr_pwr_limit,
+ mws_coex_5g_nr_pwr_limit,
PDEV_CMD);
if (ret) {
hdd_warn("Unable to send MWS-COEX 4G quick FTDM policy");
return ret;
}
+
return ret;
}
#else