diff --git a/core/hdd/inc/hdd_config.h b/core/hdd/inc/hdd_config.h
index a751e7cca6..96e42be62d 100644
--- a/core/hdd/inc/hdd_config.h
+++ b/core/hdd/inc/hdd_config.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
@@ -1035,6 +1035,30 @@ enum hdd_wext_control {
"Used to specify action OUIs to disable aggressive TX")
/* End of action oui inis */
+#ifdef ENABLE_MTRACE_LOG
+/*
+ *
+ * enable_mtrace - Enable Mtrace.
+ * @Default: 0
+ *
+ * This ini is used to enable MTRACE logging
+ *
+ * Related: None.
+ *
+ * Supported Feature: MTRACE
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_ENABLE_MTRACE CFG_INI_BOOL( \
+ "enable_mtrace", \
+ false, \
+ "Enable MTRACE")
+#define CFG_ENABLE_MTRACE_ALL CFG(CFG_ENABLE_MTRACE)
+#else
+#define CFG_ENABLE_MTRACE_ALL
+#endif
/*
* gEnableRTTsupport
@@ -1071,6 +1095,7 @@ enum hdd_wext_control {
CFG(CFG_ENABLE_FW_LOG) \
CFG(CFG_ENABLE_FW_UART_PRINT) \
CFG(CFG_ENABLE_MAC_PROVISION) \
+ CFG_ENABLE_MTRACE_ALL \
CFG(CFG_ENABLE_RAMDUMP_COLLECTION) \
CFG(CFG_ENABLE_RTT_SUPPORT) \
CFG(CFG_INTERFACE_CHANGE_WAIT) \
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 7878c7d6df..e664a4db42 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.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
@@ -792,16 +792,6 @@ enum hdd_dot11_mode {
#define CFG_ENABLE_DFS_CHNL_SCAN_MAX (1)
#define CFG_ENABLE_DFS_CHNL_SCAN_DEFAULT (1)
-#ifdef ENABLE_MTRACE_LOG
-/*
- * Enable MTRACE for all modules
- */
-#define CFG_ENABLE_MTRACE "enable_mtrace"
-#define CFG_ENABLE_MTRACE_MIN (0)
-#define CFG_ENABLE_MTRACE_MAX (1)
-#define CFG_ENABLE_MTRACE_DEFAULT (0)
-#endif
-
/*
*
* gEnableSNRMonitoring - Enables SNR Monitoring
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index eaa6e9419a..c828f24fb8 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -124,16 +124,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_RA_RATE_LIMIT_INTERVAL_MIN,
CFG_RA_RATE_LIMIT_INTERVAL_MAX),
#endif
-
-#ifdef ENABLE_MTRACE_LOG
- REG_VARIABLE(CFG_ENABLE_MTRACE, WLAN_PARAM_Integer,
- struct hdd_config, enable_mtrace,
- VAR_FLAGS_OPTIONAL,
- CFG_ENABLE_MTRACE_DEFAULT,
- CFG_ENABLE_MTRACE_MIN,
- CFG_ENABLE_MTRACE_MAX),
-#endif
-
REG_VARIABLE(CFG_ENABLE_DFS_CHNL_SCAN_NAME, WLAN_PARAM_Integer,
struct hdd_config, enableDFSChnlScan,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index ac3f273f97..d49a2f63da 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -9313,6 +9313,19 @@ static void hdd_init_packet_log(struct hdd_config *config,
}
#endif
+#ifdef ENABLE_MTRACE_LOG
+static void hdd_init_mtrace_log(struct hdd_config *config,
+ struct wlan_objmgr_psoc *psoc)
+{
+ config->enable_mtrace = cfg_get(psoc, CFG_ENABLE_MTRACE);
+}
+#else
+static void hdd_init_mtrace_log(struct hdd_config *config,
+ struct wlan_objmgr_psoc *psoc)
+{
+}
+#endif
+
#ifdef FEATURE_RUNTIME_PM
static void hdd_init_runtime_pm(struct hdd_config *config,
struct wlan_objmgr_psoc *psoc)
@@ -9379,7 +9392,6 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx)
config->enable_fw_log = cfg_get(psoc, CFG_ENABLE_FW_LOG);
config->operating_channel = cfg_get(psoc, CFG_OPERATING_CHANNEL);
config->num_vdevs = cfg_get(psoc, CFG_NUM_VDEV_ENABLE);
-
qdf_str_lcopy(config->enable_concurrent_sta,
cfg_get(psoc, CFG_ENABLE_CONCURRENT_STA),
CFG_CONCURRENT_IFACE_MAX_LEN);
@@ -9422,6 +9434,7 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx)
hdd_init_wlan_auto_shutdown(config, psoc);
hdd_init_wlan_logging_params(config, psoc);
hdd_init_packet_log(config, psoc);
+ hdd_init_mtrace_log(config, psoc);
hdd_dp_cfg_update(psoc, hdd_ctx);
}