qcacmn: Use module level logging in Spectral

Current Spectral module uses qdf_print. To improve the control over
logging, use module level logging

CRs-Fixed: 2165341
Change-Id: I205991347453c4dcc424ba1958e309b7c5fb71a0
diff --git a/spectral/core/spectral_common.c b/spectral/core/spectral_common.c
index cbaf7f6..e89ddfb 100644
--- a/spectral/core/spectral_common.c
+++ b/spectral/core/spectral_common.c
@@ -60,7 +60,7 @@
 	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev, 0, WLAN_SPECTRAL_ID);
 
 	if (!vdev) {
-		qdf_print("%s: Unable to get first vdev of pdev.\n", __func__);
+		spectral_warn("Unable to get first vdev of pdev");
 		return NULL;
 	}
 
@@ -128,13 +128,13 @@
 	uint8_t vdev_rxchainmask = 0;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL!\n");
+		spectral_err("PDEV is NULL!");
 		error = -EINVAL;
 		goto bad;
 	}
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc) {
-		spectral_err("atf context is NULL!\n");
+		spectral_err("atf context is NULL!");
 		error = -EINVAL;
 		goto bad;
 	}
@@ -331,10 +331,7 @@
 							     WLAN_SPECTRAL_ID);
 
 				if (!(sp_in->ss_chn_mask & vdev_rxchainmask)) {
-					qdf_print
-					    ("Invalid Spectral Chainmask - "
-					     "Inactive Rx antenna chain cannot "
-					     "be an active spectral chain\n");
+					spectral_err("Invalid Spectral Chainmask - Inactive Rx antenna chain cannot be an active spectral chain");
 					error = -EINVAL;
 					break;
 				} else if (sc->sptrlc_set_spectral_config(
@@ -532,13 +529,13 @@
 	struct spectral_context *sc = NULL;
 
 	if (!psoc) {
-		spectral_err("PSOC is NULL\n");
+		spectral_err("PSOC is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 	sc = (struct spectral_context *)
 	    qdf_mem_malloc(sizeof(struct spectral_context));
 	if (!sc) {
-		spectral_err("Failed to allocate spectral_ctx object\n");
+		spectral_err("Failed to allocate spectral_ctx object");
 		return QDF_STATUS_E_NOMEM;
 	}
 	qdf_mem_zero(sc, sizeof(struct spectral_context));
@@ -562,7 +559,7 @@
 	struct spectral_context *sc = NULL;
 
 	if (!psoc) {
-		spectral_err("PSOC is NULL\n");
+		spectral_err("PSOC is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 	sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
@@ -587,18 +584,18 @@
 	void *target_handle = NULL;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL\n");
+		spectral_err("PDEV is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 	ps = (struct pdev_spectral *)
 	    qdf_mem_malloc(sizeof(struct pdev_spectral));
 	if (!ps) {
-		spectral_err("Failed to allocate pdev_spectral object\n");
+		spectral_err("Failed to allocate pdev_spectral object");
 		return QDF_STATUS_E_NOMEM;
 	}
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc) {
-		spectral_err("Spectral context is NULL!\n");
+		spectral_err("Spectral context is NULL!");
 		goto cleanup;
 	}
 
@@ -609,7 +606,7 @@
 	if (sc->sptrlc_pdev_spectral_init) {
 		target_handle = sc->sptrlc_pdev_spectral_init(pdev);
 		if (!target_handle) {
-			spectral_err("Spectral lmac object is NULL!\n");
+			spectral_err("Spectral lmac object is NULL!");
 			goto cleanup;
 		}
 		ps->psptrl_target_handle = target_handle;
@@ -631,12 +628,12 @@
 	struct spectral_context *sc = NULL;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL\n");
+		spectral_err("PDEV is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc) {
-		spectral_err("Spectral context is NULL!\n");
+		spectral_err("Spectral context is NULL!");
 		return QDF_STATUS_E_FAILURE;
 	}
 	ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
diff --git a/spectral/core/spectral_direct_attach.c b/spectral/core/spectral_direct_attach.c
index 8087760..22177fb 100644
--- a/spectral/core/spectral_direct_attach.c
+++ b/spectral/core/spectral_direct_attach.c
@@ -41,12 +41,12 @@
 	int error = 0;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL!\n");
+		spectral_err("PDEV is NULL!");
 		return -EPERM;
 	}
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc) {
-		spectral_err("spectral context is NULL!\n");
+		spectral_err("spectral context is NULL!");
 		return -EPERM;
 	}
 
@@ -325,7 +325,7 @@
 spectral_ctx_init_da(struct spectral_context *sc)
 {
 	if (!sc) {
-		spectral_err("spectral context is null!\n");
+		spectral_err("spectral context is null!");
 		return;
 	}
 	sc->sptrlc_spectral_control = spectral_control_da;
diff --git a/spectral/core/spectral_module.c b/spectral/core/spectral_module.c
index 153a8c5..3596ebc 100644
--- a/spectral/core/spectral_module.c
+++ b/spectral/core/spectral_module.c
@@ -21,6 +21,7 @@
 #include <wlan_spectral_utils_api.h>
 #include <qdf_types.h>
 #include<wlan_global_lmac_if_api.h>
+#include "spectral_defs_i.h"
 
 MODULE_LICENSE("Dual BSD/GPL");
 
@@ -32,7 +33,7 @@
 static int __init
 spectral_init_module(void)
 {
-	qdf_print("qca_spectral module loaded\n");
+	spectral_info("qca_spectral module loaded");
 	wlan_spectral_init();
 	/* register spectral rxops */
 	wlan_lmac_if_sptrl_set_rx_ops_register_cb
@@ -49,7 +50,7 @@
 spectral_exit_module(void)
 {
 	wlan_spectral_deinit();
-	qdf_print("qca_spectral module unloaded\n");
+	spectral_info("qca_spectral module unloaded");
 }
 
 module_init(spectral_init_module);
diff --git a/spectral/core/spectral_offload.c b/spectral/core/spectral_offload.c
index 3c43f9c..83feac8 100644
--- a/spectral/core/spectral_offload.c
+++ b/spectral/core/spectral_offload.c
@@ -43,12 +43,12 @@
 	struct spectral_context *sc;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL!\n");
+		spectral_err("PDEV is NULL!");
 		return -EPERM;
 	}
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc) {
-		spectral_err("spectral context is NULL!\n");
+		spectral_err("spectral context is NULL!");
 		return -EPERM;
 	}
 	return spectral_control_cmn(pdev, id, indata, insize, outdata, outsize);
@@ -304,7 +304,7 @@
 spectral_ctx_init_ol(struct spectral_context *sc)
 {
 	if (!sc) {
-		spectral_err("spectral context is null!\n");
+		spectral_err("spectral context is null!");
 		return;
 	}
 	sc->sptrlc_spectral_control = spectral_control_ol;
diff --git a/spectral/dispatcher/inc/wlan_spectral_public_structs.h b/spectral/dispatcher/inc/wlan_spectral_public_structs.h
index c4d2a46..5c7106b 100644
--- a/spectral/dispatcher/inc/wlan_spectral_public_structs.h
+++ b/spectral/dispatcher/inc/wlan_spectral_public_structs.h
@@ -344,7 +344,7 @@
 };
 
 /**
- * struct INTERF_RSP - Interference record
+ * struct interf_rsp - Interference record
  * @interf_type:         eINTERF_TYPE giving type of interference
  * @interf_min_freq:     Minimum frequency in MHz at which interference has been
  * found
@@ -352,20 +352,20 @@
  * found
  * @advncd_spectral_cap: Advanced spectral capability
  */
-struct INTERF_RSP {
+struct interf_rsp {
 	uint8_t interf_type;
 	uint16_t interf_min_freq;
 	uint16_t interf_max_freq;
 } __ATTRIB_PACKED;
 
 /**
- * struct INTERF_SRC_RSP - List of interference sources
+ * struct interf_src_rsp - List of interference sources
  * @count: Number of interference records
  * @interf: Array of interference records
  */
-struct INTERF_SRC_RSP {
+struct interf_src_rsp {
 	uint16_t count;
-	struct INTERF_RSP interf[MAX_INTERF];
+	struct interf_rsp interf[MAX_INTERF];
 } __ATTRIB_PACKED;
 
 /**
@@ -472,7 +472,7 @@
 	uint16_t bin_pwr_count_sec80;
 	uint8_t bin_pwr[MAX_NUM_BINS];
 	uint8_t bin_pwr_sec80[MAX_NUM_BINS];
-	struct INTERF_SRC_RSP interf_list;
+	struct interf_src_rsp interf_list;
 	int16_t noise_floor;
 	int16_t noise_floor_sec80;
 	uint32_t ch_width;
diff --git a/spectral/dispatcher/src/wlan_spectral_tgt_api.c b/spectral/dispatcher/src/wlan_spectral_tgt_api.c
index 2d7578a..001f33c 100644
--- a/spectral/dispatcher/src/wlan_spectral_tgt_api.c
+++ b/spectral/dispatcher/src/wlan_spectral_tgt_api.c
@@ -33,13 +33,13 @@
 	struct pdev_spectral *ps;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL!\n");
+		spectral_err("PDEV is NULL!");
 		return NULL;
 	}
 	ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
 						   WLAN_UMAC_COMP_SPECTRAL);
 	if (!ps) {
-		spectral_err("PDEV SPECTRAL object is NULL!\n");
+		spectral_err("PDEV SPECTRAL object is NULL!");
 		return NULL;
 	}
 	return ps->psptrl_target_handle;
diff --git a/spectral/dispatcher/src/wlan_spectral_ucfg_api.c b/spectral/dispatcher/src/wlan_spectral_ucfg_api.c
index 3ed6756..9d58104 100644
--- a/spectral/dispatcher/src/wlan_spectral_ucfg_api.c
+++ b/spectral/dispatcher/src/wlan_spectral_ucfg_api.c
@@ -30,12 +30,12 @@
 	struct spectral_context *sc;
 
 	if (!pdev) {
-		spectral_err("PDEV is NULL!\n");
+		spectral_err("PDEV is NULL!");
 		return -EPERM;
 	}
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc) {
-		spectral_err("spectral context is NULL!\n");
+		spectral_err("spectral context is NULL!");
 		return -EPERM;
 	}
 
diff --git a/spectral/dispatcher/src/wlan_spectral_utils_api.c b/spectral/dispatcher/src/wlan_spectral_utils_api.c
index 8bad6bf..9ae3be9 100644
--- a/spectral/dispatcher/src/wlan_spectral_utils_api.c
+++ b/spectral/dispatcher/src/wlan_spectral_utils_api.c
@@ -164,11 +164,11 @@
 	struct spectral_context *sc;
 
 	if (!pdev)
-		spectral_err("PDEV is NULL!\n");
+		spectral_err("PDEV is NULL!");
 
 	sc = spectral_get_spectral_ctx_from_pdev(pdev);
 	if (!sc)
-		spectral_err("spectral context is NULL!\n");
+		spectral_err("spectral context is NULL!");
 
 	return sc->sptrlc_register_wmi_spectral_cmd_ops(pdev, cmd_ops);
 }
diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c
index e387dfb..ebd1224 100644
--- a/target_if/spectral/target_if_spectral.c
+++ b/target_if/spectral/target_if_spectral.c
@@ -54,7 +54,7 @@
 
 	if (wlan_objmgr_pdev_try_get_ref(pdev, WLAN_SPECTRAL_ID) !=
 	    QDF_STATUS_SUCCESS) {
-		qdf_print("%s: Unable to get pdev reference.\n", __func__);
+		spectral_err("Unable to get pdev reference.");
 		return NULL;
 	}
 
@@ -63,7 +63,7 @@
 	wlan_objmgr_pdev_release_ref(pdev, WLAN_SPECTRAL_ID);
 
 	if (!vdev) {
-		qdf_print("%s: Unable to get first vdev of pdev.\n", __func__);
+		spectral_warn("Unable to get first vdev of pdev.");
 		return NULL;
 	}
 
@@ -117,7 +117,7 @@
 	sparam.pwr_format = param->ss_pwr_format;
 	sparam.rpt_mode = param->ss_rpt_mode;
 	sparam.bin_scale = param->ss_bin_scale;
-	sparam.dBm_adj = param->ss_dbm_adj;
+	sparam.dbm_adj = param->ss_dbm_adj;
 	sparam.chn_mask = param->ss_chn_mask;
 
 	return spectral->param_wmi_cmd_ops.wmi_spectral_configure_cmd_send(
@@ -272,9 +272,8 @@
 	const char *function_name,
 	unsigned char output)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_ACTIVE. "
-		  "Returning val=%u\n",
-		  function_name, output);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_ACTIVE. Returning val=%u",
+		       function_name, output);
 }
 
 /**
@@ -292,9 +291,8 @@
 	const char *function_name,
 	unsigned char output)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_ENABLED. "
-		  "Returning val=%u\n",
-		  function_name, output);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_ENABLED. Returning val=%u",
+		       function_name, output);
 }
 
 /**
@@ -312,45 +310,26 @@
 	const char *function_name,
 	struct spectral_config *pparam)
 {
-	qdf_print
-	    ("%s: TARGET_IF_SPECTRAL_INFO_PARAMS. "
-	     "Returning following params:\n"
-	     "ss_count = %u\n"
-	     "ss_period = %u\n"
-	     "ss_spectral_pri = %u\n"
-	     "ss_fft_size = %u\n"
-	     "ss_gc_ena = %u\n"
-	     "ss_restart_ena = %u\n"
-	     "ss_noise_floor_ref = %d\n"
-	     "ss_init_delay = %u\n"
-	     "ss_nb_tone_thr = %u\n"
-	     "ss_str_bin_thr = %u\n"
-	     "ss_wb_rpt_mode = %u\n"
-	     "ss_rssi_rpt_mode = %u\n"
-	     "ss_rssi_thr = %d\n"
-	     "ss_pwr_format = %u\n"
-	     "ss_rpt_mode = %u\n"
-	     "ss_bin_scale = %u\n"
-	     "ss_dbm_adj = %u\n"
-	     "ss_chn_mask = %u\n\n", function_name,
-	     pparam->ss_count,
-	     pparam->ss_period,
-	     pparam->ss_spectral_pri,
-	     pparam->ss_fft_size,
-	     pparam->ss_gc_ena,
-	     pparam->ss_restart_ena,
-	     (int8_t)pparam->ss_noise_floor_ref,
-	     pparam->ss_init_delay,
-	     pparam->ss_nb_tone_thr,
-	     pparam->ss_str_bin_thr,
-	     pparam->ss_wb_rpt_mode,
-	     pparam->ss_rssi_rpt_mode,
-	     (int8_t)pparam->ss_rssi_thr,
-	     pparam->ss_pwr_format,
-	     pparam->ss_rpt_mode,
-	     pparam->ss_bin_scale,
-	     pparam->ss_dbm_adj,
-	     pparam->ss_chn_mask);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_PARAMS. Returning following params:\nss_count = %u\nss_period = %u\nss_spectral_pri = %u\nss_fft_size = %u\nss_gc_ena = %u\nss_restart_ena = %u\nss_noise_floor_ref = %d\nss_init_delay = %u\nss_nb_tone_thr = %u\nss_str_bin_thr = %u\nss_wb_rpt_mode = %u\nss_rssi_rpt_mode = %u\nss_rssi_thr = %d\nss_pwr_format = %u\nss_rpt_mode = %u\nss_bin_scale = %u\nss_dbm_adj = %u\nss_chn_mask = %u\n",
+		       function_name,
+		       pparam->ss_count,
+		       pparam->ss_period,
+		       pparam->ss_spectral_pri,
+		       pparam->ss_fft_size,
+		       pparam->ss_gc_ena,
+		       pparam->ss_restart_ena,
+		       (int8_t)pparam->ss_noise_floor_ref,
+		       pparam->ss_init_delay,
+		       pparam->ss_nb_tone_thr,
+		       pparam->ss_str_bin_thr,
+		       pparam->ss_wb_rpt_mode,
+		       pparam->ss_rssi_rpt_mode,
+		       (int8_t)pparam->ss_rssi_thr,
+		       pparam->ss_pwr_format,
+		       pparam->ss_rpt_mode,
+		       pparam->ss_bin_scale,
+		       pparam->ss_dbm_adj,
+		       pparam->ss_chn_mask);
 }
 
 /**
@@ -368,10 +347,8 @@
 	const char *function_name,
 	unsigned char output)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_ACTIVE on "
-		  "initial cache validation\n"
-		  "Returning val=%u\n",
-		  function_name, output);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_ACTIVE on initial cache validation\nReturning val=%u",
+		       function_name, output);
 }
 
 /**
@@ -389,10 +366,8 @@
 	const char *function_name,
 	unsigned char output)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_ENABLED on "
-		  "initial cache validation\n"
-		  "Returning val=%u\n",
-		  function_name, output);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_ENABLED on initial cache validation\nReturning val=%u\n",
+		       function_name, output);
 }
 
 /**
@@ -410,45 +385,25 @@
 	const char *function_name,
 	struct spectral_config *pparam)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_PARAMS on "
-		  "initial cache validation\n"
-		  "Returning following params:\n"
-		  "ss_count = %u\n"
-		  "ss_period = %u\n"
-		  "ss_spectral_pri = %u\n"
-		  "ss_fft_size = %u\n"
-		  "ss_gc_ena = %u\n"
-		  "ss_restart_ena = %u\n"
-		  "ss_noise_floor_ref = %d\n"
-		  "ss_init_delay = %u\n"
-		  "ss_nb_tone_thr = %u\n"
-		  "ss_str_bin_thr = %u\n"
-		  "ss_wb_rpt_mode = %u\n"
-		  "ss_rssi_rpt_mode = %u\n"
-		  "ss_rssi_thr = %d\n"
-		  "ss_pwr_format = %u\n"
-		  "ss_rpt_mode = %u\n"
-		  "ss_bin_scale = %u\n"
-		  "ss_dbm_adj = %u\n"
-		  "ss_chn_mask = %u\n\n",
-		  function_name,
-		  pparam->ss_count,
-		  pparam->ss_period,
-		  pparam->ss_spectral_pri,
-		  pparam->ss_fft_size,
-		  pparam->ss_gc_ena,
-		  pparam->ss_restart_ena,
-		  (int8_t)pparam->ss_noise_floor_ref,
-		  pparam->ss_init_delay,
-		  pparam->ss_nb_tone_thr,
-		  pparam->ss_str_bin_thr,
-		  pparam->ss_wb_rpt_mode,
-		  pparam->ss_rssi_rpt_mode,
-		  (int8_t)pparam->ss_rssi_thr,
-		  pparam->ss_pwr_format,
-		  pparam->ss_rpt_mode,
-		  pparam->ss_bin_scale,
-		  pparam->ss_dbm_adj, pparam->ss_chn_mask);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_PARAMS on initial cache validation\nReturning following params:\nss_count = %u\nss_period = %u\nss_spectral_pri = %u\nss_fft_size = %u\nss_gc_ena = %u\nss_restart_ena = %u\nss_noise_floor_ref = %d\nss_init_delay = %u\nss_nb_tone_thr = %u\nss_str_bin_thr = %u\nss_wb_rpt_mode = %u\nss_rssi_rpt_mode = %u\nss_rssi_thr = %d\nss_pwr_format = %u\nss_rpt_mode = %u\nss_bin_scale = %u\nss_dbm_adj = %u\nss_chn_mask = %u",
+		       function_name,
+		       pparam->ss_count,
+		       pparam->ss_period,
+		       pparam->ss_spectral_pri,
+		       pparam->ss_fft_size,
+		       pparam->ss_gc_ena,
+		       pparam->ss_restart_ena,
+		       (int8_t)pparam->ss_noise_floor_ref,
+		       pparam->ss_init_delay,
+		       pparam->ss_nb_tone_thr,
+		       pparam->ss_str_bin_thr,
+		       pparam->ss_wb_rpt_mode,
+		       pparam->ss_rssi_rpt_mode,
+		       (int8_t)pparam->ss_rssi_thr,
+		       pparam->ss_pwr_format,
+		       pparam->ss_rpt_mode,
+		       pparam->ss_bin_scale,
+		       pparam->ss_dbm_adj, pparam->ss_chn_mask);
 }
 
 #else
@@ -546,8 +501,7 @@
 		break;
 
 	default:
-		qdf_print("%s: Unknown target_if_spectral_info specifier\n",
-			  __func__);
+		spectral_err("Unknown target_if_spectral_info specifier");
 		return -EINVAL;
 	}
 
@@ -673,9 +627,8 @@
 	uint8_t pval,
 	int ret)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_ACTIVE with "
-		  "val=%u status=%d\n",
-		  function_name, pval, ret);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_ACTIVE with val=%u status=%d",
+		       function_name, pval, ret);
 }
 
 /**
@@ -694,9 +647,8 @@
 	uint8_t pval,
 	int ret)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_ENABLED with "
-		  "val=%u status=%d\n",
-		  function_name, pval, ret);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_ENABLED with val=%u status=%d",
+		       function_name, pval, ret);
 }
 
 /**
@@ -715,45 +667,25 @@
 	const char *function_name,
 	int ret)
 {
-	qdf_print("%s: TARGET_IF_SPECTRAL_INFO_PARAMS. "
-		  "Params:\n"
-		  "ss_count = %u\n"
-		  "ss_period = %u\n"
-		  "ss_spectral_pri = %u\n"
-		  "ss_fft_size = %u\n"
-		  "ss_gc_ena = %u\n"
-		  "ss_restart_ena = %u\n"
-		  "ss_noise_floor_ref = %d\n"
-		  "ss_init_delay = %u\n"
-		  "ss_nb_tone_thr = %u\n"
-		  "ss_str_bin_thr = %u\n"
-		  "ss_wb_rpt_mode = %u\n"
-		  "ss_rssi_rpt_mode = %u\n"
-		  "ss_rssi_thr = %d\n"
-		  "ss_pwr_format = %u\n"
-		  "ss_rpt_mode = %u\n"
-		  "ss_bin_scale = %u\n"
-		  "ss_dbm_adj = %u\n"
-		  "ss_chn_mask = %u\n"
-		  "status = %d\n\n",
-		  function_name,
-		  param->ss_count,
-		  param->ss_period,
-		  param->ss_spectral_pri,
-		  param->ss_fft_size,
-		  param->ss_gc_ena,
-		  param->ss_restart_ena,
-		  (int8_t)param->ss_noise_floor_ref,
-		  param->ss_init_delay,
-		  param->ss_nb_tone_thr,
-		  param->ss_str_bin_thr,
-		  param->ss_wb_rpt_mode,
-		  param->ss_rssi_rpt_mode,
-		  (int8_t)param->ss_rssi_thr,
-		  param->ss_pwr_format,
-		  param->ss_rpt_mode,
-		  param->ss_bin_scale,
-		  param->ss_dbm_adj, param->ss_chn_mask, ret);
+	spectral_debug("%s: TARGET_IF_SPECTRAL_INFO_PARAMS. Params:\nss_count = %u\nss_period = %u\nss_spectral_pri = %u\nss_fft_size = %u\nss_gc_ena = %u\nss_restart_ena = %u\nss_noise_floor_ref = %d\nss_init_delay = %u\nss_nb_tone_thr = %u\nss_str_bin_thr = %u\nss_wb_rpt_mode = %u\nss_rssi_rpt_mode = %u\nss_rssi_thr = %d\nss_pwr_format = %u\nss_rpt_mode = %u\nss_bin_scale = %u\nss_dbm_adj = %u\nss_chn_mask = %u\nstatus = %d",
+		       function_name,
+		       param->ss_count,
+		       param->ss_period,
+		       param->ss_spectral_pri,
+		       param->ss_fft_size,
+		       param->ss_gc_ena,
+		       param->ss_restart_ena,
+		       (int8_t)param->ss_noise_floor_ref,
+		       param->ss_init_delay,
+		       param->ss_nb_tone_thr,
+		       param->ss_str_bin_thr,
+		       param->ss_wb_rpt_mode,
+		       param->ss_rssi_rpt_mode,
+		       (int8_t)param->ss_rssi_thr,
+		       param->ss_pwr_format,
+		       param->ss_rpt_mode,
+		       param->ss_bin_scale,
+		       param->ss_dbm_adj, param->ss_chn_mask, ret);
 }
 #else
 static void
@@ -828,8 +760,8 @@
 			ret);
 
 		if (ret < 0) {
-			qdf_print("%s: target_if_send_vdev_spectral_enable_cmd "
-				  "failed with error=%d\n", __func__, ret);
+			spectral_err("target_if_send_vdev_spectral_enable_cmd failed with error=%d",
+				     ret);
 			qdf_spin_unlock(&info->osps_lock);
 			return ret;
 		}
@@ -854,8 +786,8 @@
 			ret);
 
 		if (ret < 0) {
-			qdf_print("%s: target_if_send_vdev_spectral_enable_cmd "
-				  "failed with error=%d\n", __func__, ret);
+			spectral_err("target_if_send_vdev_spectral_enable_cmd failed with error=%d",
+				     ret);
 			qdf_spin_unlock(&info->osps_lock);
 			return ret;
 		}
@@ -880,9 +812,8 @@
 			ret);
 
 		if (ret < 0) {
-			qdf_print("%s: "
-				  "target_if_send_vdev_spectral_configure_cmd "
-				  "failed with error=%d\n", __func__, ret);
+			spectral_err("target_if_send_vdev_spectral_configure_cmd failed with error=%d",
+				     ret);
 			qdf_spin_unlock(&info->osps_lock);
 			return ret;
 		}
@@ -893,8 +824,7 @@
 		break;
 
 	default:
-		qdf_print("%s: Unknown target_if_spectral_info "
-			  "specifier\n", __func__);
+		spectral_err("Unknown target_if_spectral_info specifier");
 		return -EINVAL;
 	}
 
@@ -1524,7 +1454,7 @@
 	else if (spectral->spectral_gen == SPECTRAL_GEN3)
 		target_if_init_spectral_ops_gen3();
 	else
-		qdf_print("Invalid spetral generation\n");
+		spectral_err("Invalid Spectral generation");
 }
 
 /*
@@ -1792,14 +1722,14 @@
 
 	if (p_sops->get_capability(spectral, SPECTRAL_CAP_PHYDIAG) == false) {
 		is_spectral_supported = false;
-		qdf_print("SPECTRAL : No PHYDIAG support\n");
+		spectral_info("SPECTRAL : No PHYDIAG support");
 		return is_spectral_supported;
 	}
 	pcap->phydiag_cap = 1;
 
 	if (p_sops->get_capability(spectral, SPECTRAL_CAP_RADAR) == false) {
 		is_spectral_supported = false;
-		qdf_print("SPECTRAL : No RADAR support\n");
+		spectral_info("SPECTRAL : No RADAR support");
 		return is_spectral_supported;
 	}
 	pcap->radar_cap = 1;
@@ -1807,14 +1737,14 @@
 	if (p_sops->get_capability(spectral,
 				   SPECTRAL_CAP_SPECTRAL_SCAN) == false) {
 		is_spectral_supported = false;
-		qdf_print("SPECTRAL : No SPECTRAL SUPPORT\n");
+		spectral_info("SPECTRAL : No SPECTRAL SUPPORT");
 		return is_spectral_supported;
 	}
 	pcap->spectral_cap = 1;
 
 	if (p_sops->get_capability(spectral, SPECTRAL_CAP_ADVNCD_SPECTRAL_SCAN)
 	    == false) {
-		qdf_print("SPECTRAL : No ADVANCED SPECTRAL SUPPORT\n");
+		spectral_info("SPECTRAL : No ADVANCED SPECTRAL SUPPORT");
 	} else {
 		pcap->advncd_spectral_cap = 1;
 	}
@@ -1904,7 +1834,7 @@
 static void
 target_if_spectral_detach(struct target_if_spectral *spectral)
 {
-	qdf_print("spectral detach\n");
+	spectral_info("spectral detach");
 	qdf_spinlock_destroy(&spectral->param_info.osps_lock);
 
 	target_if_spectral_detach_simulation(spectral);
@@ -1973,13 +1903,13 @@
 #endif
 
 	if (!pdev) {
-		qdf_print("SPECTRAL: pdev is NULL!\n");
+		spectral_err("SPECTRAL: pdev is NULL!");
 		return NULL;
 	}
 	spectral = (struct target_if_spectral *)qdf_mem_malloc(
 			sizeof(struct target_if_spectral));
 	if (!spectral) {
-		qdf_print("SPECTRAL : Memory allocation failed\n");
+		spectral_err("SPECTRAL : Memory allocation failed");
 		return spectral;
 	}
 	qdf_mem_zero(spectral, sizeof(struct target_if_spectral));
@@ -2013,16 +1943,16 @@
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
 	/* TODO : Should this be called here of after ath_attach ? */
 	if (p_sops->get_capability(spectral, SPECTRAL_CAP_PHYDIAG))
-		qdf_print(KERN_INFO "HAL_CAP_PHYDIAG : Capable\n");
+		spectral_info("HAL_CAP_PHYDIAG : Capable");
 
 	SPECTRAL_TODO("Need to fix the capablity check for RADAR");
 	if (p_sops->get_capability(spectral, SPECTRAL_CAP_RADAR))
-		qdf_print(KERN_INFO "HAL_CAP_RADAR   : Capable\n");
+		spectral_info("HAL_CAP_RADAR   : Capable");
 
 	SPECTRAL_TODO("Need to fix the capablity check for SPECTRAL\n");
 	/* TODO : Should this be called here of after ath_attach ? */
 	if (p_sops->get_capability(spectral, SPECTRAL_CAP_SPECTRAL_SCAN))
-		qdf_print(KERN_INFO "HAL_CAP_SPECTRAL_SCAN : Capable\n");
+		spectral_info("HAL_CAP_SPECTRAL_SCAN : Capable");
 
 	qdf_spinlock_create(&spectral->spectral_lock);
 	qdf_spinlock_create(&spectral->noise_pwr_reports_lock);
@@ -2125,7 +2055,7 @@
 
 	spectral = get_target_if_spectral_handle_from_pdev(pdev);
 	if (!spectral) {
-		qdf_print("SPECTRAL : Module doesn't exist\n");
+		spectral_err("SPECTRAL : Module doesn't exist");
 		return;
 	}
 	target_if_spectral_detach(spectral);
@@ -2154,7 +2084,7 @@
 	spectral = get_target_if_spectral_handle_from_pdev(pdev);
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
 	if (!spectral) {
-		qdf_print("%s: spectral object is NULL\n", __func__);
+		spectral_err("spectral object is NULL");
 		return -EPERM;
 	}
 
@@ -2356,14 +2286,14 @@
 	struct wlan_objmgr_vdev *vdev = NULL;
 
 	if (!spectral) {
-		qdf_print("SPECTRAL : Spectral is NULL\n");
+		spectral_err("SPECTRAL : Spectral is NULL");
 		return 1;
 	}
 
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
 
 	if (!p_sops) {
-		qdf_print("SPECTRAL : p_sops is NULL\n");
+		spectral_err("SPECTRAL : p_sops is NULL");
 		return 1;
 	}
 
@@ -2649,8 +2579,7 @@
 
 	spectral = get_target_if_spectral_handle_from_pdev(pdev);
 	if (!spectral) {
-		qdf_print("SPECTRAL : Spectral LMAC object is NUll  (%s)\n",
-			  __func__);
+		spectral_err("SPECTRAL : Spectral LMAC object is NUll");
 		return -EPERM;
 	}
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
@@ -2670,8 +2599,7 @@
 
 	spectral = get_target_if_spectral_handle_from_pdev(pdev);
 	if (!spectral) {
-		qdf_print("SPECTRAL : Spectral LMAC object is NUll  (%s)\n",
-			  __func__);
+		spectral_err("SPECTRAL : Spectral LMAC object is NUll ");
 		return;
 	}
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h
index 7ac3861..acbe158 100644
--- a/target_if/spectral/target_if_spectral.h
+++ b/target_if/spectral/target_if_spectral.h
@@ -56,16 +56,20 @@
 
 #define STATUS_PASS       1
 #define STATUS_FAIL       0
-#define line()   \
-	qdf_print("----------------------------------------------------\n")
+#undef spectral_dbg_line
+#define spectral_dbg_line() \
+	spectral_debug("----------------------------------------------------\n")
+#undef SPECTRAL_TODO
 #define SPECTRAL_TODO(str) \
-	qdf_print(KERN_INFO "SPECTRAL : %s (%s : %d)\n", \
-		  (str), __func__, __LINE__)
+	spectral_info("SPECTRAL : %s (%s : %d)\n", \
+		      (str), __func__, __LINE__)
+#undef spectral_ops_not_registered
 #define spectral_ops_not_registered(str) \
-	qdf_print(KERN_INFO "SPECTRAL : %s not registered\n", (str))
+	spectral_info("SPECTRAL : %s not registered\n", (str))
+#undef not_yet_implemented
 #define not_yet_implemented() \
-	qdf_print("SPECTRAL : %s : %d Not yet implemented\n", \
-		  __func__, __LINE__)
+	spectral_info("SPECTRAL : %s : %d Not yet implemented\n", \
+		      __func__, __LINE__)
 
 #define SPECTRAL_HT20_NUM_BINS               56
 #define SPECTRAL_HT20_FFT_LEN                56
@@ -863,7 +867,7 @@
 	uint16_t   freq_loading;
 	int16_t     noise_floor;
 	int16_t     noise_floor_sec80;
-	struct INTERF_SRC_RSP interf_list;
+	struct interf_src_rsp interf_list;
 	struct spectral_classifier_params classifier_params;
 	struct ath_softc *sc;
 };
diff --git a/target_if/spectral/target_if_spectral_netlink.c b/target_if/spectral/target_if_spectral_netlink.c
index 1c31de7..c4a5484 100644
--- a/target_if/spectral/target_if_spectral_netlink.c
+++ b/target_if/spectral/target_if_spectral_netlink.c
@@ -35,14 +35,14 @@
 void
 target_if_spectral_nl_data_ready(struct sock *sk, int len)
 {
-	qdf_print("%s %d\n", __func__, __LINE__);
+	spectral_debug("%d", __LINE__);
 }
 
 #else
 void
 target_if_spectral_nl_data_ready(struct sk_buff *skb)
 {
-	qdf_print("%s %d\n", __func__, __LINE__);
+	spectral_debug("%d", __LINE__);
 }
 #endif				/* VERSION */
 
@@ -141,7 +141,7 @@
 	target_if_spectral_init_nl_cfg(&cfg);
 
 	if (!spectral) {
-		qdf_print("%s: sc_spectral is NULL\n", __func__);
+		spectral_err("sc_spectral is NULL");
 		return -EIO;
 	}
 
@@ -151,8 +151,7 @@
 		target_if_spectral_create_nl_sock(&cfg);
 
 		if (!target_if_spectral_nl_sock) {
-			qdf_print("%s NETLINK_KERNEL_CREATE FAILED\n",
-				  __func__);
+			spectral_err("NETLINK_KERNEL_CREATE FAILED");
 			return -ENODEV;
 		}
 	}
@@ -160,12 +159,13 @@
 	spectral->spectral_sock = target_if_spectral_nl_sock;
 
 	if ((!spectral) || (!spectral->spectral_sock)) {
-		qdf_print("%s NULL pointers (spectral=%d) (sock=%d)\n",
-			  __func__, (!spectral), (!spectral->spectral_sock));
+		spectral_err("NULL pointers (spectral=%d) (sock=%d)",
+			     (!spectral),
+			     (!spectral->spectral_sock));
 		return -ENODEV;
 	}
 	if (!spectral->spectral_skb)
-		qdf_print(KERN_ERR "%s %d NULL SKB\n", __func__, __LINE__);
+		spectral_err("%d NULL SKB", __LINE__);
 
 	return 0;
 }
@@ -252,7 +252,7 @@
 {
 	if (params->interf_list.count)
 		OS_MEMCPY(&data->interf_list,
-			  &params->interf_list, sizeof(struct INTERF_SRC_RSP));
+			  &params->interf_list, sizeof(struct interf_src_rsp));
 	else
 		data->interf_list.count = 0;
 }
@@ -466,7 +466,7 @@
 		OS_FREE(msg);
 		msg = NULL;
 	} else {
-		qdf_print("No buffer\n");
+		spectral_err("No buffer");
 	}
 #endif				/* SPECTRAL_USE_NETLINK_SOCKETS */
 
@@ -541,12 +541,12 @@
 target_if_spectral_unicast_msg(struct target_if_spectral *spectral)
 {
 	if (!spectral) {
-		qdf_print("%s Spectral is NULL\n", __func__);
+		spectral_err("Spectral is NULL");
 		return;
 	}
 
 	if (!spectral->spectral_sock) {
-		qdf_print("%s Spectral Socket is invalid\n", __func__);
+		spectral_err("Spectral Socket is invalid");
 		dev_kfree_skb(spectral->spectral_skb);
 		spectral->spectral_skb = NULL;
 		return;
diff --git a/target_if/spectral/target_if_spectral_phyerr.c b/target_if/spectral/target_if_spectral_phyerr.c
index c88ea8a..21b1443 100644
--- a/target_if/spectral/target_if_spectral_phyerr.c
+++ b/target_if/spectral/target_if_spectral_phyerr.c
@@ -49,9 +49,9 @@
 	int i = 0;
 
 	for (i = 0; i < len; i++) {
-		qdf_print("%02X ", pbuf[i]);
+		spectral_debug("%02X ", pbuf[i]);
 		if (i % 32 == 31)
-			qdf_print("\n");
+			spectral_debug("\n");
 	}
 }
 
@@ -64,12 +64,12 @@
 	 * TODO : Do not delete the following print
 	 *        The scripts used to validate Spectral depend on this Print
 	 */
-	qdf_print("SPECTRAL : FFT Length is 0x%x (%d)\n", fftlen, fftlen);
+	spectral_debug("SPECTRAL : FFT Length is 0x%x (%d)", fftlen, fftlen);
 
-	qdf_print("fft_data # ");
+	spectral_debug("fft_data # ");
 	for (i = 0; i < fftlen; i++)
-		qdf_print("%d ", pfft[i]);
-	qdf_print("\n");
+		spectral_debug("%d ", pfft[i]);
+	spectral_debug("\n");
 	return 0;
 }
 
@@ -104,14 +104,12 @@
 void
 target_if_dbg_print_samp_param(struct target_if_samp_msg_params *p)
 {
-	qdf_print("\nSAMP Packet : -------------------- START --------------"
-		  "------\n");
-	qdf_print("Freq        = %d\n", p->freq);
-	qdf_print("RSSI        = %d\n", p->rssi);
-	qdf_print("Bin Count   = %d\n", p->pwr_count);
-	qdf_print("Timestamp   = %d\n", p->tstamp);
-	qdf_print("SAMP Packet : -------------------- END ------------------"
-		  "-----\n");
+	spectral_debug("\nSAMP Packet : -------------------- START --------------------");
+	spectral_debug("Freq        = %d", p->freq);
+	spectral_debug("RSSI        = %d", p->rssi);
+	spectral_debug("Bin Count   = %d", p->pwr_count);
+	spectral_debug("Timestamp   = %d", p->tstamp);
+	spectral_debug("SAMP Packet : -------------------- END -----------------------");
 }
 
 void
@@ -121,51 +119,52 @@
 
 	struct spectral_samp_data *p = &ss_msg->samp_data;
 	struct spectral_classifier_params *pc = &p->classifier_params;
-	struct INTERF_SRC_RSP *pi = &p->interf_list;
+	struct interf_src_rsp *pi = &p->interf_list;
 
-	line();
-	qdf_print("Spectral Message\n");
-	line();
-	qdf_print("Signature   :   0x%x\n", ss_msg->signature);
-	qdf_print("Freq        :   %d\n", ss_msg->freq);
-	qdf_print("Freq load   :   %d\n", ss_msg->freq_loading);
-	qdf_print("Intfnc type :   %d\n", ss_msg->int_type);
-	line();
-	qdf_print("Spectral Data info\n");
-	line();
-	qdf_print("data length     :   %d\n", p->spectral_data_len);
-	qdf_print("rssi            :   %d\n", p->spectral_rssi);
-	qdf_print("combined rssi   :   %d\n", p->spectral_combined_rssi);
-	qdf_print("upper rssi      :   %d\n", p->spectral_upper_rssi);
-	qdf_print("lower rssi      :   %d\n", p->spectral_lower_rssi);
-	qdf_print("bw info         :   %d\n", p->spectral_bwinfo);
-	qdf_print("timestamp       :   %d\n", p->spectral_tstamp);
-	qdf_print("max index       :   %d\n", p->spectral_max_index);
-	qdf_print("max exp         :   %d\n", p->spectral_max_exp);
-	qdf_print("max mag         :   %d\n", p->spectral_max_mag);
-	qdf_print("last timstamp   :   %d\n", p->spectral_last_tstamp);
-	qdf_print("upper max idx   :   %d\n", p->spectral_upper_max_index);
-	qdf_print("lower max idx   :   %d\n", p->spectral_lower_max_index);
-	qdf_print("bin power count :   %d\n", p->bin_pwr_count);
-	line();
-	qdf_print("Classifier info\n");
-	line();
-	qdf_print("20/40 Mode      :   %d\n", pc->spectral_20_40_mode);
-	qdf_print("dc index        :   %d\n", pc->spectral_dc_index);
-	qdf_print("dc in MHz       :   %d\n", pc->spectral_dc_in_mhz);
-	qdf_print("upper channel   :   %d\n", pc->upper_chan_in_mhz);
-	qdf_print("lower channel   :   %d\n", pc->lower_chan_in_mhz);
-	line();
-	qdf_print("Interference info\n");
-	line();
-	qdf_print("inter count     :   %d\n", pi->count);
+	spectral_dbg_line();
+	spectral_debug("Spectral Message");
+	spectral_dbg_line();
+	spectral_debug("Signature   :   0x%x", ss_msg->signature);
+	spectral_debug("Freq        :   %d", ss_msg->freq);
+	spectral_debug("Freq load   :   %d", ss_msg->freq_loading);
+	spectral_debug("Intfnc type :   %d", ss_msg->int_type);
+	spectral_dbg_line();
+	spectral_debug("Spectral Data info");
+	spectral_dbg_line();
+	spectral_debug("data length     :   %d", p->spectral_data_len);
+	spectral_debug("rssi            :   %d", p->spectral_rssi);
+	spectral_debug("combined rssi   :   %d", p->spectral_combined_rssi);
+	spectral_debug("upper rssi      :   %d", p->spectral_upper_rssi);
+	spectral_debug("lower rssi      :   %d", p->spectral_lower_rssi);
+	spectral_debug("bw info         :   %d", p->spectral_bwinfo);
+	spectral_debug("timestamp       :   %d", p->spectral_tstamp);
+	spectral_debug("max index       :   %d", p->spectral_max_index);
+	spectral_debug("max exp         :   %d", p->spectral_max_exp);
+	spectral_debug("max mag         :   %d", p->spectral_max_mag);
+	spectral_debug("last timstamp   :   %d", p->spectral_last_tstamp);
+	spectral_debug("upper max idx   :   %d", p->spectral_upper_max_index);
+	spectral_debug("lower max idx   :   %d", p->spectral_lower_max_index);
+	spectral_debug("bin power count :   %d", p->bin_pwr_count);
+	spectral_dbg_line();
+	spectral_debug("Classifier info");
+	spectral_dbg_line();
+	spectral_debug("20/40 Mode      :   %d", pc->spectral_20_40_mode);
+	spectral_debug("dc index        :   %d", pc->spectral_dc_index);
+	spectral_debug("dc in MHz       :   %d", pc->spectral_dc_in_mhz);
+	spectral_debug("upper channel   :   %d", pc->upper_chan_in_mhz);
+	spectral_debug("lower channel   :   %d", pc->lower_chan_in_mhz);
+	spectral_dbg_line();
+	spectral_debug("Interference info");
+	spectral_dbg_line();
+	spectral_debug("inter count     :   %d", pi->count);
 
 	for (i = 0; i < pi->count; i++) {
-		qdf_print("inter type  :   %d\n", pi->interf[i].interf_type);
-		qdf_print("min freq    :   %d\n",
-			  pi->interf[i].interf_min_freq);
-		qdf_print("max freq    :   %d\n",
-			  pi->interf[i].interf_max_freq);
+		spectral_debug("inter type  :   %d",
+			       pi->interf[i].interf_type);
+		spectral_debug("min freq    :   %d",
+			       pi->interf[i].interf_min_freq);
+		spectral_debug("max freq    :   %d",
+			       pi->interf[i].interf_max_freq);
 	}
 }
 
@@ -238,13 +237,12 @@
 		(uint8_t *)ptlv +
 		sizeof(struct spectral_phyerr_tlv_gen2));
 
-	qdf_print("SPECTRAL : SPECTRAL SUMMARY REPORT\n");
+	spectral_debug("SPECTRAL : SPECTRAL SUMMARY REPORT");
 
 	if (is_160_format) {
 		if (tlvlen != 20) {
-			qdf_print
-			    ("SPECTRAL : Unexpected TLV length %d for Spectral "
-			     "Summary Report! Hexdump follows\n", tlvlen);
+			spectral_err("Unexpected TLV length %d for Spectral Summary Report! Hexdump follows",
+				     tlvlen);
 			target_if_print_buf((uint8_t *)ptlv, tlvlen + 4);
 			return -EPERM;
 		}
@@ -271,8 +269,8 @@
 
 		recent_rfsat = ((ss_summary_A >> 8) & 0x1);
 		sscan_gidx = (ss_summary_A & 0xff);
-		qdf_print("sscan_gidx=%d, is_recent_rfsat=%d\n",
-			  sscan_gidx, recent_rfsat);
+		spectral_debug("sscan_gidx=%d, is_recent_rfsat=%d",
+			       sscan_gidx, recent_rfsat);
 
 		/* First segment */
 		agc_mb_gain = ((ss_summary_B >> 10) & 0x7f);
@@ -284,12 +282,10 @@
 			peak_inx = peak_inx - 4096;
 		peak_mag = ((ss_summary_C >> 12) & 0x3ff);
 
-		qdf_print
-		    ("agc_total_gain_segid0 = 0x%.2x, agc_mb_gain_segid0=%d\n",
-		     agc_total_gain, agc_mb_gain);
-		qdf_print("nb_mask_segid0 = 0x%.2x, ob_flag_segid0=%d, "
-			  "peak_index_segid0=%d, peak_mag_segid0=%d\n", nb_mask,
-			  ob_flag, peak_inx, peak_mag);
+		spectral_debug("agc_total_gain_segid0 = 0x%.2x, agc_mb_gain_segid0=%d",
+			       agc_total_gain, agc_mb_gain);
+		spectral_debug("nb_mask_segid0 = 0x%.2x, ob_flag_segid0=%d, peak_index_segid0=%d, peak_mag_segid0=%d",
+			       nb_mask, ob_flag, peak_inx, peak_mag);
 
 		/* Second segment */
 		agc_mb_gain = ((ss_summary_D >> 10) & 0x7f);
@@ -301,17 +297,14 @@
 			peak_inx = peak_inx - 4096;
 		peak_mag = ((ss_summary_E >> 12) & 0x3ff);
 
-		qdf_print
-		    ("agc_total_gain_segid1 = 0x%.2x, agc_mb_gain_segid1=%d\n",
-		     agc_total_gain, agc_mb_gain);
-		qdf_print("nb_mask_segid1 = 0x%.2x, ob_flag_segid1=%d, "
-			  "peak_index_segid1=%d, peak_mag_segid1=%d\n", nb_mask,
-			  ob_flag, peak_inx, peak_mag);
+		spectral_debug("agc_total_gain_segid1 = 0x%.2x, agc_mb_gain_segid1=%d",
+			       agc_total_gain, agc_mb_gain);
+		spectral_debug("nb_mask_segid1 = 0x%.2x, ob_flag_segid1=%d, peak_index_segid1=%d, peak_mag_segid1=%d",
+			       nb_mask, ob_flag, peak_inx, peak_mag);
 	} else {
 		if (tlvlen != 8) {
-			qdf_print
-			    ("SPECTRAL : Unexpected TLV length %d for Spectral "
-			     "Summary Report! Hexdump follows\n", tlvlen);
+			spectral_err("Unexpected TLV length %d for Spectral Summary Report! Hexdump follows",
+				     tlvlen);
 			target_if_print_buf((uint8_t *)ptlv, tlvlen + 4);
 			return -EPERM;
 		}
@@ -335,12 +328,10 @@
 		sscan_gidx = ((ss_summary_A >> 16) & 0xff);
 		recent_rfsat = ((ss_summary_B >> 31) & 0x1);
 
-		qdf_print
-		    ("nb_mask = 0x%.2x, ob_flag=%d, peak_index=%d, "
-		     "peak_mag=%d, "
-		     "agc_mb_gain=%d, agc_total_gain=%d, sscan_gidx=%d, "
-		     "recent_rfsat=%d\n", nb_mask, ob_flag, peak_inx, peak_mag,
-		     agc_mb_gain, agc_total_gain, sscan_gidx, recent_rfsat);
+		spectral_debug("nb_mask = 0x%.2x, ob_flag=%d, peak_index=%d, peak_mag=%d, agc_mb_gain=%d, agc_total_gain=%d, sscan_gidx=%d, recent_rfsat=%d",
+			       nb_mask, ob_flag, peak_inx, peak_mag,
+			       agc_mb_gain, agc_total_gain, sscan_gidx,
+			       recent_rfsat);
 	}
 
 	return 0;
@@ -390,8 +381,8 @@
 
 	/* Relook this */
 	if (tlvlen < 8) {
-		qdf_print("SPECTRAL : Unexpected TLV length %d for Spectral "
-			  "Summary Report! Hexdump follows\n", tlvlen);
+		spectral_err("Unexpected TLV length %d for Spectral Summary Report! Hexdump follows",
+			     tlvlen);
 		target_if_print_buf((uint8_t *)ptlv, tlvlen + 4);
 		return -EPERM;
 	}
@@ -462,12 +453,12 @@
 
 	uint8_t *ptmp = (uint8_t *)ptlv;
 
-	qdf_print("SPECTRAL : ADC REPORT\n");
+	spectral_debug("SPECTRAL : ADC REPORT");
 
 	/* Relook this */
 	if (tlvlen < 4) {
-		qdf_print("Unexpected TLV length %d for ADC Report! Hexdump"
-			  " follows\n", tlvlen);
+		spectral_err("Unexpected TLV length %d for ADC Report! Hexdump follows",
+			     tlvlen);
 		target_if_print_buf((uint8_t *)ptlv, tlvlen + 4);
 		return -EPERM;
 	}
@@ -480,9 +471,9 @@
 	agc_mb_gain = ((adc_summary >> 16) & 0x7f);
 	agc_total_gain = adc_summary & 0x3ff;
 
-	qdf_print("samp_fmt= %u, chn_idx= %u, recent_rfsat= %u, agc_mb_gain=%u"
-		  " agc_total_gain=%u\n", samp_fmt, chn_idx, recent_rfsat,
-		  agc_mb_gain, agc_total_gain);
+	spectral_debug("samp_fmt= %u, chn_idx= %u, recent_rfsat= %u, agc_mb_gain=%u agc_total_gain=%u",
+		       samp_fmt, chn_idx, recent_rfsat, agc_mb_gain,
+		       agc_total_gain);
 
 	for (i = 0; i < (tlvlen / 4); i++) {
 		pdata = (uint32_t *)(ptmp + 4 + i * 4);
@@ -524,12 +515,11 @@
 			else
 				sq2 = q2;
 
-			qdf_print
-			    ("SPECTRAL ADC : Interpreting capture format 1\n");
-			qdf_print("adc_data_format_1 # %d %d %d\n", 2 * i, si1,
-				  sq1);
-			qdf_print("adc_data_format_1 # %d %d %d\n", 2 * i + 1,
-				  si2, sq2);
+			spectral_debug("SPECTRAL ADC : Interpreting capture format 1");
+			spectral_debug("adc_data_format_1 # %d %d %d",
+				       2 * i, si1, sq1);
+			spectral_debug("adc_data_format_1 # %d %d %d",
+				       2 * i + 1, si2, sq2);
 		}
 
 		/* Interpreting capture format 0 */
@@ -550,14 +540,13 @@
 				sq1 = q1 - 65536;
 			else
 				sq1 = q1;
-			qdf_print
-			    ("SPECTRAL ADC : Interpreting capture format 0\n");
-			qdf_print("adc_data_format_2 # %d %d %d\n", i, si1,
-				  sq1);
+			spectral_debug("SPECTRAL ADC : Interpreting capture format 0");
+			spectral_debug("adc_data_format_2 # %d %d %d",
+				       i, si1, sq1);
 		}
 	}
 
-	qdf_print("\n");
+	spectral_debug("\n");
 
 	return 0;
 }
@@ -611,12 +600,12 @@
 	if (is_160_format)
 		segid_skiplen = sizeof(SPECTRAL_SEGID_INFO);
 
-	qdf_print("SPECTRAL : SEARCH FFT REPORT\n");
+	spectral_debug("SPECTRAL : SEARCH FFT REPORT");
 
 	/* Relook this */
 	if (tlvlen < (8 + segid_skiplen)) {
-		qdf_print("SPECTRAL : Unexpected TLV length %d for Spectral "
-			  "Summary Report! Hexdump follows\n", tlvlen);
+		spectral_err("Unexpected TLV length %d for Spectral Summary Report! Hexdump follows",
+			     tlvlen);
 		target_if_print_buf((uint8_t *)ptlv, tlvlen + 4);
 		return -EPERM;
 	}
@@ -645,24 +634,23 @@
 	avgpwr_db = ((fft_summary_B >> 18) & 0xff);
 	peak_mag = ((fft_summary_B >> 8) & 0x3ff);
 
-	qdf_print("Header A = 0x%x Header B = 0x%x\n",
-		  phdr->hdr_a, phdr->hdr_b);
-	qdf_print("Base Power= 0x%x, Total Gain= %d, relpwr_db=%d, "
-		  "num_str_bins_ib=%d fft_chn_idx=%d peak_inx=%d avgpwr_db=%d "
-		  "peak_mag=%d\n", base_pwr, total_gain_info, relpwr_db,
-		  num_str_bins_ib, fft_chn_idx, peak_inx, avgpwr_db, peak_mag);
+	spectral_debug("Header A = 0x%x Header B = 0x%x",
+		       phdr->hdr_a, phdr->hdr_b);
+	spectral_debug("Base Power= 0x%x, Total Gain= %d, relpwr_db=%d, num_str_bins_ib=%d fft_chn_idx=%d peak_inx=%d avgpwr_db=%d peak_mag=%d",
+		       base_pwr, total_gain_info, relpwr_db, num_str_bins_ib,
+		       fft_chn_idx, peak_inx, avgpwr_db, peak_mag);
 	if (is_160_format) {
 		segid = fft_summary_C & 0x1;
-		qdf_print("Segment ID: %hhu\n", segid);
+		spectral_debug("Segment ID: %hhu", segid);
 	}
 
-	qdf_print("FFT bins:\n");
+	spectral_debug("FFT bins:");
 	for (i = 0; i < (tlvlen - 8 - segid_skiplen); i++) {
 		fft_mag = ((uint8_t *)ptlv)[12 + segid_skiplen + i];
-		qdf_print("%d %d, ", i, fft_mag);
+		spectral_debug("%d %d, ", i, fft_mag);
 	}
 
-	qdf_print("\n");
+	spectral_debug("\n");
 
 	return 0;
 }
@@ -1019,8 +1007,8 @@
 		     (uint8_t *)((uint8_t *)phdr + sizeof(int)),
 		     sizeof(int));
 
-	qdf_print("SPECTRAL : HEADER A 0x%x (%d)\n", a, a);
-	qdf_print("SPECTRAL : HEADER B 0x%x (%d)\n", b, b);
+	spectral_debug("SPECTRAL : HEADER A 0x%x (%d)", a, a);
+	spectral_debug("SPECTRAL : HEADER B 0x%x (%d)", b, b);
 	return 0;
 }
 
@@ -1057,8 +1045,8 @@
 	 * TODO : Do not delete the following print
 	 *        The scripts used to validate Spectral depend on this Print
 	 */
-	qdf_print("SPECTRAL : TLV Length is 0x%x (%d)\n",
-		  ptlv->length, ptlv->length);
+	spectral_debug("SPECTRAL : TLV Length is 0x%x (%d)",
+		       ptlv->length, ptlv->length);
 
 	switch (ptlv->tag) {
 	case TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN2:
@@ -1078,7 +1066,7 @@
 		break;
 
 	default:
-		qdf_print("SPECTRAL : INVALID TLV\n");
+		spectral_warn("INVALID TLV");
 		ret = -1;
 		break;
 	}
@@ -1096,17 +1084,15 @@
 	uint32_t curr_tlv_complete_size = 0;
 
 	if (datalen < sizeof(struct spectral_phyerr_tlv_gen2)) {
-		qdf_print
-		    ("DRIVER: Total PHY error data length %u too short to "
-		     "contain any TLVs\n", datalen);
+		spectral_err("Total PHY error data length %u too short to contain any TLVs",
+			     datalen);
 		return -EPERM;
 	}
 
 	while (bytes_processed < datalen) {
 		if (bytes_remaining < sizeof(struct spectral_phyerr_tlv_gen2)) {
-			qdf_print
-			    ("DRIVER: Remaining PHY error data length %u too "
-			     "short to contain a TLV\n", bytes_remaining);
+			spectral_err("Remaining PHY error data length %u too short to contain a TLV",
+				     bytes_remaining);
 			return -EPERM;
 		}
 
@@ -1114,8 +1100,8 @@
 							   bytes_processed);
 
 		if (ptlv->signature != SPECTRAL_PHYERR_SIGNATURE_GEN2) {
-			qdf_print("DRIVER : Invalid signature 0x%x!\n",
-				  ptlv->signature);
+			spectral_err("Invalid signature 0x%x!",
+				     ptlv->signature);
 			return -EPERM;
 		}
 
@@ -1124,11 +1110,8 @@
 			ptlv->length;
 
 		if (curr_tlv_complete_size > bytes_remaining) {
-			qdf_print
-			    ("DRIVER : Current indicated complete TLV size %u "
-			     "greater than number of bytes remaining to be "
-			     "processed %u", curr_tlv_complete_size,
-			     bytes_remaining);
+			spectral_err("Current indicated complete TLV size %u greater than number of bytes remaining to be processed %u",
+				     curr_tlv_complete_size, bytes_remaining);
 			return -EPERM;
 		}
 
@@ -1201,57 +1184,42 @@
 	int report_len = (fft_hdr_length + 8);
 	int fft_bin_len = (fft_hdr_length - 16);
 
-	qdf_print("##############################################"
-		  "###############\n");
-	qdf_print("Spectral search fft_report\n");
-	qdf_print("fft_timestamp  = 0x%x\n"
-		  "fft_hdr_length = %d(32 bit words)\n"
-		  "fft_hdr_tag    = 0x%x\n"
-		  "fft_hdr_sig    = 0x%x\n",
-		  p_fft_report->fft_timestamp,
-		  p_fft_report->fft_hdr_length,
-		  p_fft_report->fft_hdr_tag, p_fft_report->fft_hdr_sig);
+	spectral_debug("#############################################################");
+	spectral_debug("Spectral search fft_report");
+	spectral_debug("fft_timestamp  = 0x%x\nfft_hdr_length = %d(32 bit words)\nfft_hdr_tag    = 0x%x\nfft_hdr_sig    = 0x%x",
+		       p_fft_report->fft_timestamp,
+		       p_fft_report->fft_hdr_length,
+		       p_fft_report->fft_hdr_tag, p_fft_report->fft_hdr_sig);
 
-	qdf_print("Length field in search fft report is %d(0x%x) bytes\n",
-		  fft_hdr_length, fft_hdr_length);
-	qdf_print("Total length of search fft report is %d(0x%x) bytes\n",
-		  report_len, report_len);
-	qdf_print("Number of fftbins in report is %d(0x%x)\n", fft_bin_len,
-		  fft_bin_len);
+	spectral_debug("Length field in search fft report is %d(0x%x) bytes",
+		       fft_hdr_length, fft_hdr_length);
+	spectral_debug("Total length of search fft report is %d(0x%x) bytes",
+		       report_len, report_len);
+	spectral_debug("Number of fftbins in report is %d(0x%x)", fft_bin_len,
+		       fft_bin_len);
 
-	qdf_print("fft_detector_id     = %u\n"
-		  "fft_num             = %u\n"
-		  "fft_radar_check     = %u\n"
-		  "fft_peak_sidx       = %d\n"
-		  "fft_chn_idx         = %u\n"
-		  "fft_base_pwr_db     = %u\n"
-		  "fft_total_gain_db   = %u\n"
-		  "fft_num_str_bins_ib = %u\n"
-		  "fft_peak_mag        = %d\n"
-		  "fft_avgpwr_db       = %u\n"
-		  "fft_relpwr_db       = %u\n",
-		  p_sfft->fft_detector_id,
-		  p_sfft->fft_num,
-		  p_sfft->fft_radar_check,
-		  p_sfft->fft_peak_sidx,
-		  p_sfft->fft_chn_idx,
-		  p_sfft->fft_base_pwr_db,
-		  p_sfft->fft_total_gain_db,
-		  p_sfft->fft_num_str_bins_ib,
-		  p_sfft->fft_peak_mag,
-		  p_sfft->fft_avgpwr_db, p_sfft->fft_relpwr_db);
+	spectral_debug("fft_detector_id = %u\nfft_num = %u\nfft_radar_check = %u\nfft_peak_sidx = %d\nfft_chn_idx = %u\nfft_base_pwr_db = %u\nfft_total_gain_db   = %u\nfft_num_str_bins_ib = %u\nfft_peak_mag   = %d\nfft_avgpwr_db  = %u\nfft_relpwr_db  = %u",
+		       p_sfft->fft_detector_id,
+		       p_sfft->fft_num,
+		       p_sfft->fft_radar_check,
+		       p_sfft->fft_peak_sidx,
+		       p_sfft->fft_chn_idx,
+		       p_sfft->fft_base_pwr_db,
+		       p_sfft->fft_total_gain_db,
+		       p_sfft->fft_num_str_bins_ib,
+		       p_sfft->fft_peak_mag,
+		       p_sfft->fft_avgpwr_db, p_sfft->fft_relpwr_db);
 
-	qdf_print("FFT bins:\n");
+	spectral_debug("FFT bins:");
 	for (i = 0; i < (fft_hdr_length - 16); i++) {
 		fft_mag =
 		    ((uint8_t *)p_fft_report)[SPECTRAL_FFT_BINS_POS + i];
-		qdf_print("%d: %d, ", i, fft_mag);
+		spectral_debug("%d: %d, ", i, fft_mag);
 		if (i % 16 == 0)
-			qdf_print("\n");
+			spectral_debug("\n");
 	}
-	qdf_print("\n");
-	qdf_print("###########################################################"
-		  "##\n");
+	spectral_debug("\n");
+	spectral_debug("#############################################################");
 
 	return 0;
 }
@@ -1324,26 +1292,24 @@
 
 	fft_hdr_length = p_fft_report->fft_hdr_length * 4;
 	if (fft_hdr_length < 16) {
-		qdf_print
-		    ("SPECTRAL : Unexpected TLV length %u for FFT Report! "
-		     "Hexdump follows\n", fft_hdr_length);
+		spectral_err("Unexpected TLV length %u for FFT Report! Hexdump follows",
+			     fft_hdr_length);
 		goto fail;
 	}
 
 	report_len = (fft_hdr_length + 8);
 	fft_bin_len = (fft_hdr_length - 16);
 	if (datalen < report_len) {
-		qdf_print("DRIVER: Total PHY error data length %u too short to"
-			  " contain the search fft report of length %u\n",
-			  datalen, report_len);
+		spectral_err("Total PHY error data length %u too short to contain the search fft report of length %u",
+			     datalen, report_len);
 		goto fail;
 	}
 
 	target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
 
 	if (p_sfft->fft_detector_id != 0) {
-		qdf_print("Expected segid is 0 but we got %d\n",
-			  p_sfft->fft_detector_id);
+		spectral_err("Expected segid is 0 but we got %d",
+			     p_sfft->fft_detector_id);
 		spectral->diag_stats.spectral_vhtseg1id_mismatch++;
 		goto fail;
 	}
@@ -1474,8 +1440,8 @@
 		target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
 
 		if (p_sfft->fft_detector_id != 1) {
-			qdf_print("Expected segid is 1 but we got %d\n",
-				  p_sfft->fft_detector_id);
+			spectral_err("Expected segid is 1 but we got %d",
+				     p_sfft->fft_detector_id);
 			spectral->diag_stats.spectral_vhtseg2id_mismatch++;
 			goto fail;
 		}
@@ -1524,8 +1490,7 @@
 	return 0;
 
  fail:
-	qdf_print("Error in function %s while processing search fft report\n",
-		  __func__);
+	spectral_err("Error in function while processing search fft report");
 	target_if_print_buf((uint8_t *)p_fft_report, fft_hdr_length + 8);
 	return -EPERM;
 }
@@ -1557,10 +1522,9 @@
 	pinfo.acs_stats = acs_stats;
 
 	if (spectral_debug_level & (DEBUG_SPECTRAL2 | DEBUG_SPECTRAL4)) {
-		qdf_print("Printing the spectral phyerr buffer for debug "
-			  "purpose\n");
-		qdf_print("Dalalength of buffer = 0x%x(%d)\n",
-			  datalen, datalen);
+		spectral_debug("Printing the spectral phyerr buffer for debug purpose");
+		spectral_debug("Dalalength of buffer = 0x%x(%d)",
+			       datalen, datalen);
 #ifdef CONFIG_WIN
 		RAWSIM_PKT_HEXDUMP(data, datalen);
 #endif
@@ -1575,8 +1539,8 @@
 	signature = *(data + PHYERR_HDR_SIG_POS);
 
 	if (signature != SPECTRAL_PHYERR_SIGNATURE_GEN3) {
-		qdf_print("Unexpected signature %x in spectral phyerror "
-			  "event\n", signature);
+		spectral_err("Unexpected signature %x in spectral phyerror event",
+			     signature);
 		spectral->diag_stats.spectral_mismatch++;
 		ret = -1;
 		goto end;
@@ -1595,7 +1559,8 @@
 		break;
 
 	default:
-		qdf_print("Unknown tag %x in spectral phyerror event\n", tag);
+		spectral_warn("Unknown tag %x in spectral phyerror event",
+			      tag);
 		break;
 	}
 
diff --git a/target_if/spectral/target_if_spectral_sim.c b/target_if/spectral/target_if_spectral_sim.c
index dd8958e..8c51868 100644
--- a/target_if/spectral/target_if_spectral_sim.c
+++ b/target_if/spectral/target_if_spectral_sim.c
@@ -85,9 +85,7 @@
 		    qdf_mem_malloc(sizeof(reportdata_20_gen2));
 
 		if (!report->data) {
-			qdf_print
-			    ("Spectral simulation: Could not allocate memory "
-			     "for report data\n");
+			spectral_err("Spectral simulation: Could not allocate memory for report data");
 			goto bad;
 		}
 
@@ -108,9 +106,7 @@
 		    qdf_mem_malloc(sizeof(reportdata_40_gen2));
 
 		if (!report->data) {
-			qdf_print
-			    ("Spectral simulation: Could not allocate memory "
-			     "for report data\n");
+			spectral_err("Spectral simulation: Could not allocate memory for report data");
 			goto bad;
 		}
 
@@ -131,9 +127,7 @@
 		    qdf_mem_malloc(sizeof(reportdata_80_gen2));
 
 		if (!report->data) {
-			qdf_print
-			    ("Spectral simulation: Could not allocate memory "
-			     "for report data\n");
+			spectral_err("Spectral simulation: Could not allocate memory for report data");
 			goto bad;
 		}
 
@@ -155,9 +149,7 @@
 			    qdf_mem_malloc(sizeof(reportdata_80_80_gen2));
 
 			if (!report->data) {
-				qdf_print
-				    ("Spectral simulation: Could not allocate "
-				     "memory for report data\n");
+				spectral_err("Spectral simulation: Could not allocate memory for report data");
 				goto bad;
 			}
 
@@ -179,9 +171,7 @@
 			    qdf_mem_malloc(sizeof(reportdata_160_gen2));
 
 			if (!report->data) {
-				qdf_print
-				    ("Spectral simulation: Could not allocate "
-				     "memory for report data\n");
+				spectral_err("Spectral simulation: Could not allocate memory for report data");
 				goto bad;
 			}
 
@@ -198,7 +188,7 @@
 		}
 		break;
 	default:
-		qdf_print("Unhandled width. Please correct. Asserting\n");
+		spectral_err("Unhandled width. Please correct. Asserting");
 		qdf_assert_always(0);
 	}
 
@@ -233,8 +223,7 @@
 		    qdf_mem_malloc(sizeof(reportdata_20_gen3));
 
 		if (!report->data) {
-			qdf_print("Spectral simulation: Could not allocate "
-				  "memory for report data\n");
+			spectral_err("Spectral simulation: Could not allocate memory for report data");
 			goto bad;
 		}
 
@@ -255,8 +244,7 @@
 		    qdf_mem_malloc(sizeof(reportdata_40_gen3));
 
 		if (!report->data) {
-			qdf_print("Spectral simulation: Could not allocate "
-				  "memory for report data\n");
+			spectral_err("Spectral simulation: Could not allocate memory for report data");
 			goto bad;
 		}
 
@@ -277,9 +265,7 @@
 		    qdf_mem_malloc(sizeof(reportdata_80_gen3));
 
 		if (!report->data) {
-			qdf_print
-			    ("Spectral simulation: Could not allocate memory "
-			     "for report data\n");
+			spectral_err("Spectral simulation: Could not allocate memory for report data");
 			goto bad;
 		}
 
@@ -301,9 +287,7 @@
 			    qdf_mem_malloc(sizeof(reportdata_80_80_gen3));
 
 			if (!report->data) {
-				qdf_print
-				    ("Spectral simulation: Could not allocate "
-				     "memory for report data\n");
+				spectral_err("Spectral simulation: Could not allocate memory for report data");
 				goto bad;
 			}
 
@@ -325,9 +309,7 @@
 			    qdf_mem_malloc(sizeof(reportdata_160_gen3));
 
 			if (!report->data) {
-				qdf_print
-				    ("Spectral simulation: Could not allocate "
-				     "memory for report data\n");
+				spectral_err("Spectral simulation: Could not allocate memory for report data");
 				goto bad;
 			}
 
@@ -344,7 +326,7 @@
 		}
 		break;
 	default:
-		qdf_print("Unhandled width. Please correct. Asserting\n");
+		spectral_err("Unhandled width. Please correct. Asserting");
 		qdf_assert_always(0);
 	}
 
@@ -408,8 +390,7 @@
 	    qdf_mem_malloc(sizeof(struct spectralsim_report));
 
 	if (!report) {
-		qdf_print("Spectral simulation: Could not allocate memory "
-			  "for report.\n");
+		spectral_err("Spectral simulation: Could not allocate memory for report.");
 		goto bad;
 	}
 
@@ -478,7 +459,7 @@
 		}
 		break;
 	default:
-		qdf_print("Unhandled width. Please rectify.\n");
+		spectral_err("Unhandled width. Please rectify.");
 		qdf_assert_always(0);
 	};
 
@@ -679,8 +660,7 @@
 	    qdf_mem_malloc(sizeof(struct spectralsim_context));
 
 	if (!simctx) {
-		qdf_print("Spectral simulation: Could not allocate memory for "
-			  "context\n");
+		spectral_err("Spectral simulation: Could not allocate memory for context");
 		return -EPERM;
 	}
 
@@ -698,7 +678,7 @@
 	if (target_if_populate_simdata(simctx) != 0) {
 		qdf_mem_free(simctx);
 		spectral->simctx = NULL;
-		qdf_print("Spectral simulation attach failed\n");
+		spectral_err("Spectral simulation attach failed");
 		return -EPERM;
 	}
 
@@ -707,7 +687,7 @@
 		       target_if_spectral_sim_phyerrdelivery_handler,
 		       (void *)(spectral), QDF_TIMER_TYPE_WAKE_APPS);
 
-	qdf_print("Spectral simulation attached\n");
+	spectral_info("Spectral simulation attached");
 
 	return 0;
 }
@@ -728,7 +708,7 @@
 	qdf_mem_free(simctx);
 	spectral->simctx = NULL;
 
-	qdf_print("Spectral simulation detached\n");
+	spectral_info("Spectral simulation detached");
 }
 
 uint32_t
@@ -776,16 +756,12 @@
 	qdf_assert_always(simctx);
 
 	if (!simctx->curr_reportset) {
-		qdf_print("Spectral simulation: No current report set "
-			  "configured  - unable to start simulated Spectral "
-			  "scan\n");
+		spectral_err("Spectral simulation: No current report set configured  - unable to start simulated Spectral scan");
 		return 0;
 	}
 
 	if (!simctx->curr_reportset->curr_report) {
-		qdf_print("Spectral simulation: No report data instances "
-			  "populated - unable to start simulated Spectral "
-			  "scan\n");
+		spectral_err("Spectral simulation: No report data instances populated - unable to start simulated Spectral scan");
 		return 0;
 	}
 
@@ -846,60 +822,38 @@
 {
 	int i = 0;
 
-	qdf_print("\n");
+	spectral_debug("\n");
 
-	qdf_print("Spectral simulation: Param data dump:\n"
-		  "ss_fft_period=%hu\n"
-		  "ss_period=%hu\n"
-		  "ss_count=%hu\n"
-		  "ss_short_report=%hu\n"
-		  "radar_bin_thresh_sel=%hhu\n"
-		  "ss_spectral_pri=%hu\n"
-		  "ss_fft_size=%hu\n"
-		  "ss_gc_ena=%hu\n"
-		  "ss_restart_ena=%hu\n"
-		  "ss_noise_floor_ref=%hu\n"
-		  "ss_init_delay=%hu\n"
-		  "ss_nb_tone_thr=%hu\n"
-		  "ss_str_bin_thr=%hu\n"
-		  "ss_wb_rpt_mode=%hu\n"
-		  "ss_rssi_rpt_mode=%hu\n"
-		  "ss_rssi_thr=%hu\n"
-		  "ss_pwr_format=%hu\n"
-		  "ss_rpt_mode=%hu\n"
-		  "ss_bin_scale=%hu\n"
-		  "ss_dbm_adj=%hu\n"
-		  "ss_chn_mask=%hu\n"
-		  "ss_nf_temp_data=%d\n",
-		  params->ss_fft_period,
-		  params->ss_period,
-		  params->ss_count,
-		  params->ss_short_report,
-		  params->radar_bin_thresh_sel,
-		  params->ss_spectral_pri,
-		  params->ss_fft_size,
-		  params->ss_gc_ena,
-		  params->ss_restart_ena,
-		  params->ss_noise_floor_ref,
-		  params->ss_init_delay,
-		  params->ss_nb_tone_thr,
-		  params->ss_str_bin_thr,
-		  params->ss_wb_rpt_mode,
-		  params->ss_rssi_rpt_mode,
-		  params->ss_rssi_thr,
-		  params->ss_pwr_format,
-		  params->ss_rpt_mode,
-		  params->ss_bin_scale,
-		  params->ss_dbm_adj,
-		  params->ss_chn_mask, params->ss_nf_temp_data);
+	spectral_debug("Spectral simulation: Param data dump:\nss_fft_period=%hu\nss_period=%hu\nss_count=%hu\nss_short_report=%hu\nradar_bin_thresh_sel=%hhu\nss_spectral_pri=%hu\nss_fft_size=%hu\nss_gc_ena=%hu\nss_restart_ena=%hu\nss_noise_floor_ref=%hu\nss_init_delay=%hu\nss_nb_tone_thr=%hu\nss_str_bin_thr=%hu\nss_wb_rpt_mode=%hu\nss_rssi_rpt_mode=%hu\nss_rssi_thr=%hu\nss_pwr_format=%hu\nss_rpt_mode=%hu\nss_bin_scale=%hu\nss_dbm_adj=%hu\nss_chn_mask=%hu\nss_nf_temp_data=%d",
+		       params->ss_fft_period,
+		       params->ss_period,
+		       params->ss_count,
+		       params->ss_short_report,
+		       params->radar_bin_thresh_sel,
+		       params->ss_spectral_pri,
+		       params->ss_fft_size,
+		       params->ss_gc_ena,
+		       params->ss_restart_ena,
+		       params->ss_noise_floor_ref,
+		       params->ss_init_delay,
+		       params->ss_nb_tone_thr,
+		       params->ss_str_bin_thr,
+		       params->ss_wb_rpt_mode,
+		       params->ss_rssi_rpt_mode,
+		       params->ss_rssi_thr,
+		       params->ss_pwr_format,
+		       params->ss_rpt_mode,
+		       params->ss_bin_scale,
+		       params->ss_dbm_adj,
+		       params->ss_chn_mask, params->ss_nf_temp_data);
 
 	for (i = 0; i < AH_MAX_CHAINS * 2; i++)
-		qdf_print("ss_nf_cal[%d]=%hhd\n", i, params->ss_nf_cal[i]);
+		spectral_debug("ss_nf_cal[%d]=%hhd", i, params->ss_nf_cal[i]);
 
 	for (i = 0; i < AH_MAX_CHAINS * 2; i++)
-		qdf_print("ss_nf_pwr[%d]=%hhd\n", i, params->ss_nf_pwr[i]);
+		spectral_debug("ss_nf_pwr[%d]=%hhd", i, params->ss_nf_pwr[i]);
 
-	qdf_print("\n");
+	spectral_info("\n");
 }
 #else
 
@@ -933,8 +887,7 @@
 
 	vdev = target_if_spectral_get_vdev(spectral);
 	if (!vdev) {
-		qdf_print("Spectral simulation: No VAPs found - not proceeding"
-			  " with param config.\n");
+		spectral_warn("Spectral simulation: No VAPs found - not proceeding with param config.");
 		return 0;
 	}
 
@@ -957,20 +910,18 @@
 		} else if (phymode == WLAN_PHYMODE_11AC_VHT80_80) {
 			des_headreportset = simctx->bw80_80_headreportset;
 		} else {
-			qdf_print("Spectral simulation: Unexpected PHY mode %u"
-				  " found for width 160 MHz...asserting.\n",
-				  phymode);
+			spectral_err("Spectral simulation: Unexpected PHY mode %u found for width 160 MHz...asserting.",
+				     phymode);
 			qdf_assert_always(0);
 		}
 		break;
 
 	case IEEE80211_CWM_WIDTHINVALID:
-		qdf_print("Spectral simulation: Invalid width configured - not"
-			  " proceeding with param config.\n");
+		spectral_err("Spectral simulation: Invalid width configured - not proceeding with param config.");
 		is_invalid_width = true;
 	default:
-		qdf_print("Spectral simulation: Unknown width %u...asserting\n",
-			  bw);
+		spectral_err("Spectral simulation: Unknown width %u...asserting",
+			     bw);
 		qdf_assert_always(0);
 		break;
 	}
@@ -981,9 +932,7 @@
 		return 0;
 
 	if (!des_headreportset) {
-		qdf_print("Spectral simulation: No simulation data present for"
-			  " configured bandwidth/PHY mode - unable to proceed "
-			  " with param config.\n");
+		spectral_warn("Spectral simulation: No simulation data present for configured bandwidth/PHY mode - unable to proceed  with param config.");
 		return 0;
 	}
 
@@ -1002,16 +951,12 @@
 	}
 
 	if (!simctx->curr_reportset) {
-		qdf_print("Spectral simulation: No simulation data present for"
-			  " desired Spectral configuration - unable to proceed"
-			  " with param config.\n");
+		spectral_warn("Spectral simulation: No simulation data present for desired Spectral configuration - unable to proceed with param config.");
 		return 0;
 	}
 
 	if (!simctx->curr_reportset->curr_report) {
-		qdf_print("Spectral simulation: No report data instances "
-			  "populated for desired Spectral configuration - "
-			  "unable to proceed with param config\n");
+		spectral_warn("Spectral simulation: No report data instances populated for desired Spectral configuration - unable to proceed with param config");
 		return 0;
 	}
 
@@ -1035,8 +980,7 @@
 	qdf_assert_always(simctx);
 
 	if (!simctx->curr_reportset) {
-		qdf_print
-		    ("Spectral simulation: No configured reportset found.\n");
+		spectral_warn("Spectral simulation: No configured reportset found.");
 		return 0;
 	}
 
diff --git a/target_if/spectral/target_if_spectral_sim_int.h b/target_if/spectral/target_if_spectral_sim_int.h
index 49cadb2..0bc5840 100644
--- a/target_if/spectral/target_if_spectral_sim_int.h
+++ b/target_if/spectral/target_if_spectral_sim_int.h
@@ -126,8 +126,7 @@
 		qdf_mem_malloc(sizeof(struct spectralsim_reportset));        \
 									  \
 	if ((reportset) == NULL) {                                        \
-		qdf_print("Spectral simulation: Could not allocate memory " \
-			  "for report set\n"); \
+		spectral_err("Spectral simulation: Could not allocate memory for report set"); \
 		target_if_depopulate_simdata((simctx));                     \
 		return -EPERM;                                              \
 	}                                                                 \
diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h
index 5b749aa..3192738 100644
--- a/wmi/inc/wmi_unified_param.h
+++ b/wmi/inc/wmi_unified_param.h
@@ -4004,7 +4004,7 @@
  * @pwr_format: Power format
  * @rpt_mode: Report mdoe
  * @bin_scale: BIN scale
- * @dBm_adj: DBM adjust
+ * @dbm_adj: DBM adjust
  * @chn_mask: chain mask
  */
 struct vdev_spectral_configure_params {
@@ -4025,7 +4025,7 @@
 	uint16_t pwr_format;
 	uint16_t rpt_mode;
 	uint16_t bin_scale;
-	uint16_t dBm_adj;
+	uint16_t dbm_adj;
 	uint16_t chn_mask;
 };
 
diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c
index 2171b9f..6aaa8b3 100644
--- a/wmi/src/wmi_unified_non_tlv.c
+++ b/wmi/src/wmi_unified_non_tlv.c
@@ -2673,7 +2673,7 @@
 	cmd->spectral_scan_pwr_format = param->pwr_format;
 	cmd->spectral_scan_rpt_mode = param->rpt_mode;
 	cmd->spectral_scan_bin_scale = param->bin_scale;
-	cmd->spectral_scan_dBm_adj = param->dBm_adj;
+	cmd->spectral_scan_dBm_adj = param->dbm_adj;
 	cmd->spectral_scan_chn_mask = param->chn_mask;
 
 	ret = wmi_unified_cmd_send(wmi_handle,
@@ -2720,7 +2720,7 @@
 			 param->pwr_format,
 			 param->rpt_mode,
 			 param->bin_scale,
-			 param->dBm_adj,
+			 param->dbm_adj,
 			 param->chn_mask);
 	qdf_print("%s: Status: %d\n\n", __func__, ret);
 #endif  /* OL_SPECTRAL_DEBUG_CONFIG_INTERACTIONS */
diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c
index f6efcb8..4b17db9 100644
--- a/wmi/src/wmi_unified_tlv.c
+++ b/wmi/src/wmi_unified_tlv.c
@@ -12753,7 +12753,7 @@
 	cmd->spectral_scan_pwr_format = param->pwr_format;
 	cmd->spectral_scan_rpt_mode = param->rpt_mode;
 	cmd->spectral_scan_bin_scale = param->bin_scale;
-	cmd->spectral_scan_dBm_adj = param->dBm_adj;
+	cmd->spectral_scan_dBm_adj = param->dbm_adj;
 	cmd->spectral_scan_chn_mask = param->chn_mask;
 
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
@@ -12803,7 +12803,7 @@
 		 param->pwr_format,
 		 param->rpt_mode,
 		 param->bin_scale,
-		 param->dBm_adj,
+		 param->dbm_adj,
 		 param->chn_mask);
 	WMI_LOGI("%s: Status: %d\n\n", __func__, ret);