Merge "qca-wifi: Replace WMI_LOGE() with wmi_err()"
diff --git a/dp/wifi3.0/dp_full_mon.c b/dp/wifi3.0/dp_full_mon.c
index a4db3c8..f535d76 100644
--- a/dp/wifi3.0/dp_full_mon.c
+++ b/dp/wifi3.0/dp_full_mon.c
@@ -588,9 +588,17 @@
 						    l3_hdr_pad +
 						    frag_len);
 
-			dp_rx_mon_add_msdu_to_list(head_msdu, msdu, &last_msdu,
-						   rx_tlv_hdr, frag_len,
-						   l3_hdr_pad);
+			if (dp_rx_mon_add_msdu_to_list(head_msdu, msdu,
+						       &last_msdu,
+						       rx_tlv_hdr, frag_len,
+						       l3_hdr_pad)
+				!= QDF_STATUS_SUCCESS) {
+				dp_rx_mon_add_msdu_to_list_failure_handler(rx_tlv_hdr,
+					pdev, &last_msdu, head_msdu,
+					tail_msdu, __func__);
+				drop_mpdu = true;
+				goto next_msdu;
+			}
 
 next_msdu:
 			rx_buf_reaped++;
@@ -626,8 +634,8 @@
 	}
 	pdev->rx_mon_stats.dest_mpdu_done++;
 
-	dp_rx_mon_init_tail_msdu(msdu, last_msdu, tail_msdu);
-	dp_rx_mon_remove_raw_frame_fcs_len(head_msdu);
+	dp_rx_mon_init_tail_msdu(head_msdu, msdu, last_msdu, tail_msdu);
+	dp_rx_mon_remove_raw_frame_fcs_len(head_msdu, tail_msdu);
 
 	return rx_buf_reaped;
 }
diff --git a/dp/wifi3.0/dp_tx_capture.c b/dp/wifi3.0/dp_tx_capture.c
index f07b609..d6fa75f 100644
--- a/dp/wifi3.0/dp_tx_capture.c
+++ b/dp/wifi3.0/dp_tx_capture.c
@@ -3286,7 +3286,8 @@
  * return: qdf_nbuf_t
  */
 static qdf_nbuf_t
-dp_tx_mon_get_next_mpdu(struct cdp_tx_completion_ppdu_user *xretry_user,
+dp_tx_mon_get_next_mpdu(struct dp_pdev *pdev, struct dp_tx_tid *tx_tid,
+			struct cdp_tx_completion_ppdu_user *xretry_user,
 			qdf_nbuf_t mpdu_nbuf)
 {
 	qdf_nbuf_t next_nbuf = NULL;
@@ -3319,8 +3320,8 @@
 		} else {
 			QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
 				  QDF_TRACE_LEVEL_FATAL,
-				  "%s: This is buggy scenario, did not find nbuf in queue ",
-				  __func__);
+				  "%s: bug scenario, did not find nbuf in queue pdev %08x, peer id %d, tid %d, mpdu_nbuf %08x",
+				  __func__, pdev, tx_tid->peer_id, tx_tid->tid, mpdu_nbuf);
 			qdf_assert_always(0);
 		}
 	} else {
@@ -3415,7 +3416,8 @@
 					 * This API removes mpdu_nbuf from q
 					 * and returns next mpdu from the queue
 					 */
-					mpdu_nbuf = dp_tx_mon_get_next_mpdu(
+					mpdu_nbuf = dp_tx_mon_get_next_mpdu(pdev,
+							tx_tid,
 							xretry_user, mpdu_nbuf);
 				} else {
 					index = seq_no - start_seq;
diff --git a/wmi/src/wmi_unified_ap_tlv.c b/wmi/src/wmi_unified_ap_tlv.c
index d0b3387..ff30365 100644
--- a/wmi/src/wmi_unified_ap_tlv.c
+++ b/wmi/src/wmi_unified_ap_tlv.c
@@ -62,9 +62,9 @@
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
 	}
-	WMI_LOGD("%s: peer_macaddr %pM vdev_id %d, wds_macaddr %pM flag %d\n",
-		 __func__, param->peer_addr, param->vdev_id,
-		 param->dest_addr, param->flags);
+	wmi_debug("peer_macaddr %pM vdev_id %d, wds_macaddr %pM flag %d",
+		  param->peer_addr, param->vdev_id,
+		  param->dest_addr, param->flags);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -104,8 +104,8 @@
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
 	}
-	WMI_LOGD("%s: vdev_id %d wds_addr %pM\n",
-		 __func__, param->vdev_id, param->dest_addr);
+	wmi_debug("vdev_id %d wds_addr %pM",
+		  param->vdev_id, param->dest_addr);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -155,9 +155,9 @@
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	WMI_LOGD("%s: peer_addr %pM vdev_id %d wds_addr %pM flags %d\n",
-		 __func__, param->peer_macaddr, param->vdev_id,
-		 param->wds_macaddr, param->flags);
+	wmi_debug("peer_addr %pM vdev_id %d wds_addr %pM flags %d",
+		  param->peer_macaddr, param->vdev_id,
+		  param->wds_macaddr, param->flags);
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -196,7 +196,7 @@
 		return QDF_STATUS_E_FAILURE;
 
 	}
-	WMI_LOGD("%s:send success", __func__);
+	wmi_debug("send success");
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -481,10 +481,10 @@
 	cmd->preamble = param->preamble;
 	cmd->hw_rate = param->hw_rate;
 
-	WMI_LOGI("%s[%d] commandID %d, wmi_pdev_get_tpc_cmd=0x%x,"
-		"rate_flags: 0x%x, nss: %d, preamble: %d, hw_rate: %d",
-		__func__, __LINE__, WMI_PDEV_GET_TPC_CMDID, *((u_int32_t *)cmd),
-		cmd->rate_flags, cmd->nss, cmd->preamble, cmd->hw_rate);
+	wmi_info("commandID %d, wmi_pdev_get_tpc_cmd=0x%x,"
+		 "rate_flags: 0x%x, nss: %d, preamble: %d, hw_rate: %d",
+		 WMI_PDEV_GET_TPC_CMDID, *((u_int32_t *)cmd),
+		 cmd->rate_flags, cmd->nss, cmd->preamble, cmd->hw_rate);
 
 	wmi_mtrace(WMI_PDEV_GET_TPC_CMDID, NO_SESSION, 0);
 	if (wmi_unified_cmd_send(wmi_handle, wmibuf, len,
@@ -1082,7 +1082,7 @@
 	qdf_mem_copy(param->maxRegAllowedPowerAGTXBF,
 		event->maxRegAllowedPowerAGTXBF,
 		sizeof(param->maxRegAllowedPowerAGTXBF));
-	WMI_LOGD("%s:extract success", __func__);
+	wmi_debug("extract success");
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1171,11 +1171,11 @@
 	cmd->cac_duration_ms = param->cac_duration_ms;
 	cmd->num_vdevs = param->num_vdevs;
 
-	WMI_LOGI("%s:cmd->pdev_id: %d ,cmd->requestor_id: %d ,"
-		"cmd->disable_hw_ack: %d , cmd->cac_duration_ms:%d ,"
-		" cmd->num_vdevs: %d ",
-		__func__, cmd->pdev_id, cmd->requestor_id,
-		cmd->disable_hw_ack, cmd->cac_duration_ms, cmd->num_vdevs);
+	wmi_info("cmd->pdev_id: %d ,cmd->requestor_id: %d ,"
+		 "cmd->disable_hw_ack: %d , cmd->cac_duration_ms:%d ,"
+		 " cmd->num_vdevs: %d ",
+		 cmd->pdev_id, cmd->requestor_id,
+		 cmd->disable_hw_ack, cmd->cac_duration_ms, cmd->num_vdevs);
 	buf_ptr += sizeof(*cmd);
 
 	WMITLV_SET_HDR(buf_ptr,
@@ -1218,19 +1218,19 @@
 	WMI_SET_CHANNEL_REG_CLASSID(chan_info, tchan_info->reg_class_id);
 	WMI_SET_CHANNEL_MAX_TX_POWER(chan_info, tchan_info->maxregpower);
 
-	WMI_LOGI("%s:tchan_info->is_chan_passive: %d ,"
-		"tchan_info->dfs_set : %d ,tchan_info->allow_vht:%d ,"
-		"tchan_info->allow_ht: %d ,tchan_info->antennamax: %d ,"
-		"tchan_info->phy_mode: %d ,tchan_info->minpower: %d,"
-		"tchan_info->maxpower: %d ,tchan_info->maxregpower: %d ,"
-		"tchan_info->reg_class_id: %d ,"
-		"tchan_info->maxregpower : %d ", __func__,
-		tchan_info->is_chan_passive, tchan_info->dfs_set,
-		tchan_info->allow_vht, tchan_info->allow_ht,
-		tchan_info->antennamax, tchan_info->phy_mode,
-		tchan_info->minpower, tchan_info->maxpower,
-		tchan_info->maxregpower, tchan_info->reg_class_id,
-		tchan_info->maxregpower);
+	wmi_info("tchan_info->is_chan_passive: %d ,"
+		 "tchan_info->dfs_set : %d ,tchan_info->allow_vht:%d ,"
+		 "tchan_info->allow_ht: %d ,tchan_info->antennamax: %d ,"
+		 "tchan_info->phy_mode: %d ,tchan_info->minpower: %d,"
+		 "tchan_info->maxpower: %d ,tchan_info->maxregpower: %d ,"
+		 "tchan_info->reg_class_id: %d ,"
+		 "tchan_info->maxregpower : %d ",
+		 tchan_info->is_chan_passive, tchan_info->dfs_set,
+		 tchan_info->allow_vht, tchan_info->allow_ht,
+		 tchan_info->antennamax, tchan_info->phy_mode,
+		 tchan_info->minpower, tchan_info->maxpower,
+		 tchan_info->maxregpower, tchan_info->reg_class_id,
+		 tchan_info->maxregpower);
 
 	buf_ptr += sizeof(*chan_info);
 	WMITLV_SET_HDR(buf_ptr,
@@ -1438,9 +1438,9 @@
 	ch_nfdbm = param_buf->nfdbm;
 	ch_freqnum = param_buf->freqnum;
 
-	WMI_LOGD("pdev_id[%x], num_nfdbr[%d], num_nfdbm[%d] num_freqnum[%d]",
-		 event->pdev_id, param_buf->num_nfdbr,
-		 param_buf->num_nfdbm, param_buf->num_freqnum);
+	wmi_debug("pdev_id[%x], num_nfdbr[%d], num_nfdbm[%d] num_freqnum[%d]",
+		  event->pdev_id, param_buf->num_nfdbr,
+		  param_buf->num_nfdbm, param_buf->num_freqnum);
 
 	if (param_buf->num_nfdbr >
 	    WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS) {
@@ -1712,10 +1712,10 @@
 	cmd->dest_ring = param->dest_ring;
 	cmd->meta_data = param->meta_data;
 	cmd->dest_ring_handler = param->dest_ring_handler;
-	WMI_LOGI("Set RX PKT ROUTING TYPE TAG - opcode: %u", param->op_code);
-	WMI_LOGI("routing_bitmap: %u, dest_ring: %u",
+	wmi_info("Set RX PKT ROUTING TYPE TAG - opcode: %u", param->op_code);
+	wmi_info("routing_bitmap: %u, dest_ring: %u",
 		 param->routing_type_bitmap, param->dest_ring);
-	WMI_LOGI("dest_ring_handler: %u, meta_data: 0x%x",
+	wmi_info("dest_ring_handler: %u, meta_data: 0x%x",
 		 param->dest_ring_handler, param->meta_data);
 
 	wmi_mtrace(WMI_PDEV_UPDATE_PKT_ROUTING_CMDID, cmd->pdev_id, 0);
@@ -1847,7 +1847,7 @@
 	cmd->vdev_id = param->vdev_id;
 	cmd->fd_period = param->fd_period;
 	cmd->flags = param->send_prb_rsp_frame;
-	WMI_LOGI("Setting FD period to %d vdev id : %d",
+	wmi_info("Setting FD period to %d vdev id : %d",
 		 param->fd_period, param->vdev_id);
 
 	wmi_mtrace(WMI_ENABLE_FILS_CMDID, cmd->vdev_id, 0);
@@ -2366,7 +2366,7 @@
 		max_peers_per_command = max_peers_per_buf;
 	}
 
-	WMI_LOGD("Setting peer limit as %u", max_peers_per_command);
+	wmi_debug("Setting peer limit as %u", max_peers_per_command);
 
 	while (pending_peers > 0) {
 		len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
@@ -2414,8 +2414,8 @@
 			cmd_peer_list[ix].chan_width =
 					param_peer_list[ix].chan_width;
 
-			WMI_LOGD("Peer[%u]: chan_width = %u", ix,
-				 cmd_peer_list[ix].chan_width);
+			wmi_debug("Peer[%u]: chan_width = %u", ix,
+				  cmd_peer_list[ix].chan_width);
 		}
 
 		pending_peers -= cmd->num_peers;
@@ -2466,7 +2466,7 @@
 	qdf_mem_copy(param->vdev_id_bmap, param_buf->vdev_ids_bitmap,
 		     sizeof(param->vdev_id_bmap));
 
-	WMI_LOGD("vdev_id_bmap is as follows");
+	wmi_debug("vdev_id_bmap is as follows");
 	qdf_trace_hex_dump(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
 			   param->vdev_id_bmap, sizeof(param->vdev_id_bmap));
 
@@ -2495,13 +2495,13 @@
 			 sizeof(wmi_pdev_rnr_bss_tbtt_info));
 		break;
 	default:
-		WMI_LOGP("%s: cmd_type: %d invalid", __func__, param->cmd_type);
+		wmi_err("cmd_type: %d invalid", param->cmd_type);
 		return QDF_STATUS_E_FAILURE;
 	}
 	tmp_bss = param->rnr_bss_tbtt;
 	buf = wmi_buf_alloc(wmi, len);
 	if (!buf) {
-		WMI_LOGP("%s: wmi_buf_alloc failed", __func__);
+		wmi_err("wmi_buf_alloc failed");
 		return QDF_STATUS_E_NOMEM;
 	}
 	buf_ptr = wmi_buf_data(buf);
@@ -2550,7 +2550,7 @@
 		  "Cmd Type: %d, Pdev id: %d Vap count: %d", tbtt_sync_cmd->cmd_type,
 		  tbtt_sync_cmd->pdev_id, param->rnr_vap_count);
 	if (wmi_unified_cmd_send(wmi, buf, len, WMI_PDEV_TBTT_OFFSET_SYNC_CMDID)) {
-		WMI_LOGP("%s: Failed to send multisoc tbtt sync command", __func__);
+		wmi_err("Failed to send multisoc tbtt sync command");
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
 	}
diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c
index 513a770..1bdd12f 100644
--- a/wmi/src/wmi_unified_non_tlv.c
+++ b/wmi/src/wmi_unified_non_tlv.c
@@ -362,8 +362,8 @@
 	cmd->vdev_type = param->type;
 	cmd->vdev_subtype = param->subtype;
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->vdev_macaddr);
-	WMI_LOGD("%s: ID = %d Type = %d, Subtype = %d VAP Addr = %02x:%02x:%02x:%02x:%02x:%02x:",
-		  __func__, param->vdev_id, param->type, param->subtype,
+	wmi_debug("ID = %d Type = %d, Subtype = %d VAP Addr = %02x:%02x:%02x:%02x:%02x:%02x:",
+		  param->vdev_id, param->type, param->subtype,
 		  macaddr[0], macaddr[1], macaddr[2],
 		  macaddr[3], macaddr[4], macaddr[5]);
 	ret =  wmi_unified_cmd_send(wmi_handle, buf, len,
@@ -397,7 +397,7 @@
 	}
 	cmd = (wmi_vdev_delete_cmd *)wmi_buf_data(buf);
 	cmd->vdev_id = if_id;
-	WMI_LOGD("%s for vap %d (%pK)", __func__, if_id, wmi_handle);
+	wmi_debug("for vap %d (%pK)", if_id, wmi_handle);
 	ret =  wmi_unified_cmd_send(wmi_handle, buf, len,
 		WMI_VDEV_DELETE_CMDID);
 	if (QDF_IS_STATUS_ERROR(ret)) {
@@ -460,7 +460,7 @@
 	}
 	cmd = (wmi_vdev_down_cmd *)wmi_buf_data(buf);
 	cmd->vdev_id = vdev_id;
-	WMI_LOGD("%s for vap %d (%pK)", __func__, vdev_id, wmi_handle);
+	wmi_debug("for vap %d (%pK)", vdev_id, wmi_handle);
 	ret =  wmi_unified_cmd_send(wmi_handle, buf, len, WMI_VDEV_DOWN_CMDID);
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_VDEV_DOWN_CMDID");
@@ -528,11 +528,11 @@
 		WMI_SET_CHANNEL_FLAG(&cmd->chan, WMI_CHAN_FLAG_QUARTER);
 
 	if (param->is_restart) {
-		WMI_LOGD("VDEV RESTART");
+		wmi_debug("VDEV RESTART");
 		ret =  wmi_unified_cmd_send(wmi, buf, len,
 				WMI_VDEV_RESTART_REQUEST_CMDID);
 	} else {
-		WMI_LOGD("VDEV START");
+		wmi_debug("VDEV START");
 		ret =  wmi_unified_cmd_send(wmi, buf, len,
 				WMI_VDEV_START_REQUEST_CMDID);
 	}
@@ -684,7 +684,7 @@
 	cmd->type	= param->type;
 	cmd->mask_lower32 = param->lower32;
 	cmd->mask_higher32 = param->higher32;
-	WMI_LOGD("Setting vdev ratemask vdev id = 0x%X, type = 0x%X, mask_l32 = 0x%X mask_h32 = 0x%X",
+	wmi_debug("Setting vdev ratemask vdev id = 0x%X, type = 0x%X, mask_l32 = 0x%X mask_h32 = 0x%X",
 		  param->vdev_id, param->type, param->lower32, param->higher32);
 	ret =  wmi_unified_cmd_send(wmi_handle, buf, len,
 			WMI_VDEV_RATEMASK_CMDID);
@@ -769,17 +769,15 @@
 			    param->tx_iv[i];
 		}
 
-		WMI_LOGD("RSC:");
+		wmi_debug("RSC:");
 		for (i = 0; i < 16; i++)
-			WMI_LOGD("0x%x ",
+			wmi_debug("0x%x ",
 				 *(((uint8_t *)&cmd->wpi_key_rsc_counter)+i));
-		WMI_LOGD("\n");
 
-		WMI_LOGD("TSC:");
+		wmi_debug("TSC:");
 		for (i = 0; i < 16; i++)
-			WMI_LOGD("0x%x ",
+			wmi_debug("0x%x ",
 				*(((uint8_t *)&cmd->wpi_key_tsc_counter)+i));
-		WMI_LOGD("\n");
 	}
 #endif
 
@@ -1021,7 +1019,7 @@
 
 	param_id = convert_host_peer_param_id_to_target_id_non_tlv(param->param_id);
 	if (param_id == WMI_UNAVAILABLE_PARAM) {
-		WMI_LOGW("%s: Unavailable param %d", __func__, param->param_id);
+		wmi_err("Unavailable param %d", param->param_id);
 		return QDF_STATUS_E_NOSUPPORT;
 	}
 	buf = wmi_buf_alloc(wmi_handle, len);
@@ -1069,7 +1067,7 @@
 	cmd->vdev_id = param->vdev_id;
 	cmd->vdev_assoc_id = param->assoc_id;
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(bssid, &cmd->vdev_bssid);
-	WMI_LOGD("%s for vap %d (%pK)", __func__, param->vdev_id, wmi_handle);
+	wmi_debug("for vap %d (%pK)", param->vdev_id, wmi_handle);
 	ret =  wmi_unified_cmd_send(wmi_handle, buf, len, WMI_VDEV_UP_CMDID);
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_VDEV_UP_CMDID");
@@ -1133,7 +1131,7 @@
 			cmd_peer_list[ix].chan_width =
 					param_peer_list[ix].chan_width;
 
-			WMI_LOGD("Peer[%u]: chan_width = %u", ix,
+			wmi_debug("Peer[%u]: chan_width = %u", ix,
 				 cmd_peer_list[ix].chan_width);
 		}
 
@@ -1373,11 +1371,10 @@
 				   WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID);
 
 #ifdef OL_GREEN_AP_DEBUG_CONFIG_INTERACTIONS
-	WMI_LOGD("%s: Sent WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID.\n"
-				 "enable=%u status=%d",
-				 __func__,
-				 value,
-				 ret);
+	wmi_debug("Sent WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID.\n"
+		  "enable=%u status=%d",
+		  value,
+		  ret);
 #endif /* OL_GREEN_AP_DEBUG_CONFIG_INTERACTIONS */
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID");
@@ -1711,7 +1708,7 @@
 		return QDF_STATUS_E_NOMEM;
 	}
 	res = wmi_unified_cmd_send(wmi_handle, buf, 4, WMI_WOW_ENABLE_CMDID);
-	WMI_LOGD("send_wow_enable result: %d", res);
+	wmi_debug("send_wow_enable result: %d", res);
 	if (QDF_IS_STATUS_ERROR(res)) {
 		wmi_buf_free(buf);
 	}
@@ -1737,7 +1734,7 @@
 	}
 	res = wmi_unified_cmd_send(wmi_handle, buf, 4,
 			WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID);
-	WMI_LOGD("ol_wow_wakeup result: %d", res);
+	wmi_debug("ol_wow_wakeup result: %d", res);
 	if (QDF_IS_STATUS_ERROR(res)) {
 		wmi_buf_free(buf);
 	}
@@ -1952,7 +1949,7 @@
 		wmi_err("wmi_buf_alloc failed");
 		return QDF_STATUS_E_FAILURE;
 	}
-	WMI_LOGD("%s:set psmode=%d", __func__, param->psmode);
+	wmi_debug("set psmode=%d", param->psmode);
 	cmd = (wmi_sta_powersave_mode_cmd *)wmi_buf_data(buf);
 	cmd->vdev_id = param->vdev_id;
 	cmd->sta_ps_mode = param->psmode;
@@ -2025,7 +2022,7 @@
 
 	cmd = (WMI_DBGLOG_CFG_CMD *)(wmi_buf_data(osbuf));
 
-	WMI_LOGD("wmi_dbg_cfg_send: mod[0]%08x dbgcfg%08x cfgvalid[0] %08x cfgvalid[1] %08x \
+	wmi_debug("wmi_dbg_cfg_send: mod[0]%08x dbgcfg%08x cfgvalid[0] %08x cfgvalid[1] %08x \
 		  cfgvalid[2] %08x",
 		  dbglog_param->module_id_bitmap[0],
 		  dbglog_param->val, dbglog_param->cfgvalid[0],
@@ -2355,7 +2352,7 @@
 		qdf_mem_copy(cmd->bufp, wmi_buf_data(param->wbuf), bcn_len);
 #endif
 #ifdef DEBUG_BEACON
-		WMI_LOGD("%s frm length %d", __func__, bcn_len);
+		wmi_debug("frm length %d", bcn_len);
 #endif
 		ret = wmi_unified_cmd_send(wmi_handle, wmi_buf,
 			roundup(len, sizeof(u_int32_t)), WMI_BCN_TX_CMDID);
@@ -2853,7 +2850,7 @@
 		WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(ie_data->ie_data,
 				param->extraie.ptr, param->extraie.len);
 	}
-	WMI_LOGD("Sending SCAN START cmd");
+	wmi_debug("Sending SCAN START cmd");
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_START_SCAN_CMDID);
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_START_SCAN_CMDID");
@@ -3060,7 +3057,7 @@
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	WMI_LOGD("%s: about to send", __func__);
+	wmi_debug("about to send");
 	if (wmi_unified_cmd_send(wmi_handle, buf, 32,
 	  WMI_PDEV_DFS_ENABLE_CMDID) != QDF_STATUS_SUCCESS) {
 		wmi_err("send failed");
@@ -3090,7 +3087,7 @@
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	WMI_LOGD("%s: about to send", __func__);
+	wmi_debug("about to send");
 	if (wmi_unified_cmd_send(wmi_handle, buf, 32,
 	  WMI_PDEV_DFS_DISABLE_CMDID) != QDF_STATUS_SUCCESS) {
 		wmi_err("send failed");
@@ -3520,9 +3517,9 @@
 			   len,
 			   WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID);
 
-	WMI_LOGD("%s: Sent WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID", __func__);
+	wmi_debug("Sent WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID");
 
-	WMI_LOGD("vdev_id = %u\n"
+	wmi_debug("vdev_id = %u\n"
 		  "spectral_scan_count = %u\n"
 		  "spectral_scan_period = %u\n"
 		  "spectral_scan_priority = %u\n"
@@ -3560,7 +3557,7 @@
 		  param->bin_scale,
 		  param->dbm_adj,
 		  param->chn_mask);
-	WMI_LOGD("%s: Status: %d", __func__, ret);
+	wmi_debug("Status: %d", ret);
 
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID");
@@ -3633,7 +3630,7 @@
 	cmd = (wmi_enable_fils_cmd *)wmi_buf_data(buf);
 	cmd->vdev_id = param->vdev_id;
 	cmd->fd_period = param->fd_period;
-	WMI_LOGD("Setting FD period to %d vdev id : %d\n",
+	wmi_debug("Setting FD period to %d vdev id : %d",
 		 param->fd_period, param->vdev_id);
 
 	status = wmi_unified_cmd_send(wmi_handle, buf, len,
@@ -3707,12 +3704,12 @@
 		cmd->enable_cmd = 0; /* 0: Ignore */
 	}
 
-	WMI_LOGD("vdev_id = %u\n"
-				 "trigger_cmd = %u\n"
-				 "enable_cmd = %u",
-				 cmd->vdev_id,
-				 cmd->trigger_cmd,
-				 cmd->enable_cmd);
+	wmi_debug("vdev_id = %u\n"
+		  "trigger_cmd = %u\n"
+		  "enable_cmd = %u",
+		  cmd->vdev_id,
+		  cmd->trigger_cmd,
+		  cmd->enable_cmd);
 
 	ret = wmi_unified_cmd_send(wmi_handle,
 				   buf,
@@ -3723,8 +3720,8 @@
 		wmi_err("Failed to send WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID");
 		wmi_buf_free(buf);
 	} else {
-		WMI_LOGD("%s: Sent WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID\n", __func__);
-		WMI_LOGD("%s: Status: %d", __func__, ret);
+		wmi_debug("Sent WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID");
+		wmi_debug("Status: %d", ret);
 	}
 
 	return ret;
@@ -3834,7 +3831,7 @@
 	}
 	cmd = (wmi_add_bcn_filter_cmd_t *)wmi_buf_data(buf);
 	cmd->vdev_id = param->vdev_id;
-	WMI_LOGD("vdev_id: %d", cmd->vdev_id);
+	wmi_debug("vdev_id: %d", cmd->vdev_id);
 
 	for (i = 0; i < BCN_FLT_MAX_ELEMS_IE_LIST; i++)
 		cmd->ie_map[i] = 0;
@@ -4377,7 +4374,7 @@
 			     sizeof(wmi_mac_addr));
 		peer_info[i].atf_units = param->peer_info[i].percentage_peer;
 	}
-	WMI_LOGD("wmi_unified_pdev_set_atf peer_num=%d", cmd->num_peers);
+	wmi_debug("wmi_unified_pdev_set_atf peer_num=%d", cmd->num_peers);
 	retval = wmi_unified_cmd_send(wmi_handle, buf, len,
 				      WMI_PEER_ATF_REQUEST_CMDID);
 	if (QDF_IS_STATUS_ERROR(retval)) {
@@ -4834,7 +4831,7 @@
 	len = sizeof(wmi_pdev_ratepwr_table_cmd);
 	len += roundup(param->ratepwr_len, sizeof(uint32_t)) - sizeof(uint32_t);
 	/* already 4 bytes in cmd structure */
-	WMI_LOGD("wmi buf len = %d", len);
+	wmi_debug("wmi buf len = %d", len);
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf) {
 		wmi_err("wmi_buf_alloc failed");
@@ -4871,7 +4868,7 @@
 	wmi_pdev_ratepwr_table_cmd *cmd;
 
 	len = sizeof(wmi_pdev_ratepwr_table_cmd);
-	WMI_LOGD("wmi buf len = %d", len);
+	wmi_debug("wmi buf len = %d", len);
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf) {
 		wmi_err("wmi_buf_alloc failed");
@@ -4931,7 +4928,7 @@
 				 (WMI_HOST_NUM_BAND_EDGES_2G_40MHZ * 3) +
 				 (WMI_HOST_NUM_CTLS_2G_40MHZ *
 				  WMI_HOST_NUM_BAND_EDGES_2G_40MHZ) + 4)) {
-				WMI_LOGD("CTL array len not correct");
+				wmi_debug("CTL array len not correct");
 				return QDF_STATUS_E_FAILURE;
 			}
 		} else {
@@ -4957,7 +4954,7 @@
 				 (WMI_HOST_NUM_BAND_EDGES_5G_HT160 * 3) +
 				 (WMI_HOST_NUM_CTLS_5G_HT160 *
 				  WMI_HOST_NUM_BAND_EDGES_5G_HT160))) {
-				WMI_LOGD("CTL array len not correct");
+				wmi_debug("CTL array len not correct");
 				return QDF_STATUS_E_FAILURE;
 			}
 		}
@@ -4965,14 +4962,14 @@
 		if (param->ctl_cmd_len !=
 			WMI_HOST_NUM_CTLS_2G * WMI_HOST_NUM_BAND_EDGES_2G * 2 +
 			WMI_HOST_NUM_CTLS_5G * WMI_HOST_NUM_BAND_EDGES_5G * 2) {
-			WMI_LOGD("CTL array len not correct");
+			wmi_debug("CTL array len not correct");
 			return QDF_STATUS_E_FAILURE;
 		}
 	}
 
 	len = sizeof(wmi_pdev_set_ctl_table_cmd);
 	len += roundup(param->ctl_cmd_len, sizeof(uint32_t)) - sizeof(uint32_t);
-	WMI_LOGD("wmi buf len = %d", len);
+	wmi_debug("wmi buf len = %d", len);
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf) {
 		wmi_err("wmi_buf_alloc failed");
@@ -5152,7 +5149,6 @@
 	int len = sizeof(wmi_pdev_scan_cmd);
 
 	buf = wmi_buf_alloc(wmi_handle, len);
-	WMI_LOGD("%s:", __func__);
 	if (!buf) {
 		wmi_err("wmi_buf_alloc failed");
 		return QDF_STATUS_E_NOMEM;
@@ -5184,7 +5180,6 @@
 	int len = sizeof(wmi_pdev_scan_cmd);
 
 	buf = wmi_buf_alloc(wmi_handle, len);
-	WMI_LOGD("%s:", __func__);
 	if (!buf) {
 		wmi_err("wmi_buf_alloc failed");
 		return QDF_STATUS_E_NOMEM;
@@ -5263,7 +5258,7 @@
 
 	cmd_vdev->vdev_id = param->vdev_id;
 
-	WMI_LOGD("Setting dscp for vap id: %d", cmd_vdev->vdev_id);
+	wmi_debug("Setting dscp for vap id: %d", cmd_vdev->vdev_id);
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len_vdev,
 		WMI_VDEV_SET_DSCP_TID_MAP_CMDID);
 	if (QDF_IS_STATUS_ERROR(ret)) {
@@ -5300,7 +5295,7 @@
 	cmd->key_id = 0;
 	cmd->mcast = 0;
 
-	WMI_LOGD("%s macaddr=%s key_id=%d mcast=%d", __func__,
+	wmi_debug("macaddr=%s key_id=%d mcast=%d",
 		  ether_sprintf(param->macaddr), cmd->key_id, cmd->mcast);
 
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
@@ -5452,7 +5447,7 @@
 		} else {
 			cmd->mode = FIPS_ENGINE_AES_CTR;
 		}
-		WMI_LOGD("Key len = %d, Data len = %d",
+		wmi_debug("Key len = %d, Data len = %d",
 			  cmd->key_len, cmd->data_len);
 
 		print_hex_dump(KERN_DEBUG, "Key: ", DUMP_PREFIX_NONE, 16, 1,
@@ -5465,7 +5460,7 @@
 		if (QDF_IS_STATUS_ERROR(retval)) {
 			wmi_buf_free(buf);
 		}
-		WMI_LOGD("%s return value %d", __func__, retval);
+		wmi_debug("return value %d", retval);
 	} else {
 		wmi_err("Key or Data is NULL");
 		retval = -EFAULT;
@@ -5864,7 +5859,7 @@
 	wmi_rtt_measreq_body *body;
 	wmi_channel *w_chan;
 
-	WMI_LOGD("%s: The request ID is: %d", __func__, param->req_id);
+	wmi_debug("The request ID is: %d", param->req_id);
 
 	len = sizeof(wmi_rtt_measreq_head) + param->req_num_req *
 	    sizeof(wmi_rtt_measreq_body);
@@ -5901,7 +5896,7 @@
 	/*
 	qdf_mem_copy(peer, param->mac_addr, 6);
 
-	WMI_LOGD("The mac_addr is"
+	wmi_debug("The mac_addr is"
 		 " %.2x:%.2x:%.2x:%.2x:%.2x:%.2x extra=%d",
 		 peer[0], peer[1], peer[2],
 		 peer[3], peer[4], peer[5], param->extra);
@@ -5958,7 +5953,7 @@
 	}
 
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_RTT_MEASREQ_CMDID);
-	WMI_LOGD("send rtt cmd to FW with length %d and return %d",
+	wmi_debug("send rtt cmd to FW with length %d and return %d",
 		  len, ret);
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_RTT_MEASREQ_CMDID");
@@ -6101,7 +6096,7 @@
 
 
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_RTT_MEASREQ_CMDID);
-	WMI_LOGD("send rtt cmd to FW with length %d and return %d",
+	wmi_debug("send rtt cmd to FW with length %d and return %d",
 		  len, ret);
 	if (QDF_IS_STATUS_ERROR(ret)) {
 		wmi_err("Failed to send WMI_RTT_MEASREQ_CMDID");
@@ -6152,7 +6147,7 @@
 
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
 		WMI_RTT_KEEPALIVE_CMDID);
-	WMI_LOGD("send rtt keepalive cmd to FW with length %d and return %d\n"
+	wmi_debug("send rtt keepalive cmd to FW with length %d and return %d"
 		, len, ret);
 	param->req_id++;
 	if (QDF_IS_STATUS_ERROR(ret)) {
@@ -6187,8 +6182,8 @@
 	/* colocated_bss[1] contains num of vaps */
 	/* Provide colocated bssid subIE only when there are 2 vaps or more */
 	if (param->colocated_bss[1] > 1) {
-		WMI_LOGD("%s: Adding %d co-located BSSIDs to LCI data",
-			  __func__, param->colocated_bss[1]);
+		wmi_debug("Adding %d co-located BSSIDs to LCI data",
+			  param->colocated_bss[1]);
 		/* Convert num_vaps to octets:
 		   6*Num_of_vap + 1 (Max BSSID Indicator field) */
 		param->colocated_bss[1] =
@@ -6198,10 +6193,10 @@
 				param->colocated_bss,
 				colocated_bss_len);
 		rtt_req->co_located_bssid_len = colocated_bss_len;
-		WMI_LOGD("%s: co_located_bssid_len: %d", __func__,
+		wmi_debug("co_located_bssid_len: %d",
 			  param->colocated_bss[1] + 2);
 	} else {
-		WMI_LOGD("No co-located BSSID was added to LCI data");
+		wmi_debug("No co-located BSSID was added to LCI data");
 	}
 
 	buf = wmi_buf_alloc(wmi_handle, len);
@@ -6735,7 +6730,7 @@
 		host_mem_chunks[idx].ptr = param->mem_chunks[idx].paddr;
 		host_mem_chunks[idx].size = param->mem_chunks[idx].len;
 		host_mem_chunks[idx].req_id = param->mem_chunks[idx].req_id;
-		WMI_LOGD("chunk %d len %d requested , ptr  0x%x",
+		wmi_debug("chunk %d len %d requested , ptr  0x%x",
 			  idx, cmd->host_mem_chunks[idx].size,
 			  cmd->host_mem_chunks[idx].ptr);
 	}
@@ -6775,7 +6770,7 @@
 
 	cmd_cfg = (wmi_ext_resource_config *)wmi_buf_data(buf);
 	qdf_mem_copy(cmd_cfg, ext_cfg, sizeof(wmi_ext_resource_config));
-	WMI_LOGD("\nSending Ext resource cfg: HOST PLATFORM as %d\n"
+	wmi_debug("Sending Ext resource cfg: HOST PLATFORM as %d"
 			"fw_feature_bitmap as %x to TGT",
 			cmd_cfg->host_platform_config,
 			cmd_cfg->fw_feature_bitmap);
@@ -7134,13 +7129,13 @@
 			}
 		}
 
-		WMI_LOGI("idx %d req %d  num_units %d num_unit_info %d"
-				"unit size %d actual units %d",
-				idx, mem_reqs->req_id,
-				mem_reqs->num_units,
-				mem_reqs->num_unit_info,
-				mem_reqs->unit_size,
-				mem_reqs->tgt_num_units);
+		wmi_info("idx %d req %d  num_units %d num_unit_info %d"
+			 "unit size %d actual units %d",
+			 idx, mem_reqs->req_id,
+			 mem_reqs->num_units,
+			 mem_reqs->num_unit_info,
+			 mem_reqs->unit_size,
+			 mem_reqs->tgt_num_units);
 
 	}
 
@@ -7190,7 +7185,7 @@
 						   void *evt_buf)
 {
 	 wmi_ready_event *ev = (wmi_ready_event *) evt_buf;
-	 WMI_LOGD("Version = %d %d  status = %d", ev->sw_version,
+	 wmi_debug("Version = %d %d  status = %d", ev->sw_version,
 		   ev->abi_version, ev->status);
 	 return ev->status;
 }
@@ -8320,7 +8315,7 @@
 		MEM_ALIGN(TONE_VHT_80M)
 	};
 	if (hdump == NULL) {
-		WMI_LOGD("Destination buffer is NULL");
+		wmi_debug("Destination buffer is NULL");
 		return p;
 	}
 	temp1 = temp2 = hdump;
@@ -8490,6 +8485,9 @@
 {
 	wmi_comb_phyerr_rx_event *pe;
 #if ATH_PHYERR_DEBUG
+#define BUFFER_SIZE 32
+	char *buff[BUFFER_SIZE];
+	uint8_t offset = 0;
 	int i;
 #endif /* ATH_PHYERR_DEBUG */
 	uint8_t *data;
@@ -8497,15 +8495,28 @@
 	data = (uint8_t *) evt_buf;
 
 #if ATH_PHYERR_DEBUG
-	WMI_LOGD("%s: data=%pK, datalen=%d", __func__, data, datalen);
+	wmi_debug("data=%pK, datalen=%d", data, datalen);
 	/* XXX for now */
 
-	for (i = 0; i < datalen; i++) {
-		WMI_LOGD("%02X ", data[i]);
-		if (i % 32 == 31)
-				WMI_LOGD("\n");
+	buff = qdf_mem_malloc(BUFFER_SIZE);
+	if (!buff) {
+		wmi_err("Failed memory alloc");
+		return QDF_STATUS_E_NOMEM;
 	}
-	WMI_LOGD("\n");
+	qdf_mem_zero(buff, BUFFER_SIZE);
+	for (i = 0; i < datalen; i++) {
+		ret = snprintf(buff + offset, BUFFER_SIZE - offset, "%02X ",
+			       data[i]);
+		if (ret < 0)
+			break;
+
+		offset += ret;
+		if (i % 32 == 31) {
+			wmi_debug("%s", buff);
+			offset = 0;
+		}
+	}
+	qdf_mem_zero(buff);
 #endif /* ATH_PHYERR_DEBUG */
 
 	/* Ensure it's at least the size of the header */
@@ -8516,9 +8527,8 @@
 
 	pe = (wmi_comb_phyerr_rx_event *) data;
 #if ATH_PHYERR_DEBUG
-	WMI_LOGD("%s: pe->hdr.num_phyerr_events=%d",
-		  __func__,
-	   pe->hdr.num_phyerr_events);
+	wmi_debug("pe->hdr.num_phyerr_events=%d",
+		  pe->hdr.num_phyerr_events);
 #endif /* ATH_PHYERR_DEBUG */
 
 	/*
@@ -8572,9 +8582,8 @@
 	if (n < datalen) {
 		/* ensure there's at least space for the header */
 		if ((datalen - n) < sizeof(ev->hdr)) {
-			WMI_LOGD(
-			"%s: not enough space? (datalen=%d, n=%d, hdr=%zd bytes",
-				  __func__,
+			wmi_debug(
+			"not enough space? (datalen=%d, n=%d, hdr=%zd bytes",
 				  datalen,
 				  n,
 				  sizeof(ev->hdr));
@@ -8599,14 +8608,12 @@
 		 * If "int" is 64 bits then this becomes a moot point.
 		 */
 		 if (ev->hdr.buf_len > PHYERROR_MAX_BUFFER_LENGTH) {
-			WMI_LOGD("%s: buf_len is garbage? (0x%x\n)",
-				  __func__,
+			wmi_debug("buf_len is garbage? (0x%x\n)",
 				  ev->hdr.buf_len);
 			return QDF_STATUS_SUCCESS;
 		 }
 		 if (n + ev->hdr.buf_len > datalen) {
-			WMI_LOGD("%s: buf_len exceeds available space (n=%d, buf_len=%d, datalen=%d",
-				  __func__,
+			wmi_debug("buf_len exceeds available space (n=%d, buf_len=%d, datalen=%d",
 				  n,
 				  ev->hdr.buf_len,
 				  datalen);
@@ -8616,8 +8623,7 @@
 		 phyerr->phy_err_code = WMI_UNIFIED_PHYERRCODE_GET(&ev->hdr);
 
 #if ATH_PHYERR_DEBUG
-		WMI_LOGD("%s: len=%d, tsf=0x%08x, rssi = 0x%x/0x%x/0x%x/0x%x, comb rssi = 0x%x, phycode=%d",
-			  __func__,
+		wmi_debug("len=%d, tsf=0x%08x, rssi = 0x%x/0x%x/0x%x/0x%x, comb rssi = 0x%x, phycode=%d",
 			  ev->hdr.buf_len,
 			  ev->hdr.tsf_timestamp,
 			  ev->hdr.rssi_chain0,
@@ -8632,36 +8638,32 @@
 		 * a variable but glued together into a macro field definition.
 		 * Grr. :-)
 		 */
-		WMI_LOGD(
-		"%s: chain 0: raw=0x%08x; pri20=%d sec20=%d sec40=%d sec80=%d",
-				__func__,
+		wmi_debug(
+		"chain 0: raw=0x%08x; pri20=%d sec20=%d sec40=%d sec80=%d",
 				ev->hdr.rssi_chain0,
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 0, PRI20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 0, SEC20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 0, SEC40),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 0, SEC80));
 
-		WMI_LOGD(
-		"%s: chain 1: raw=0x%08x: pri20=%d sec20=%d sec40=%d sec80=%d",
-				__func__,
+		wmi_debug(
+		"chain 1: raw=0x%08x: pri20=%d sec20=%d sec40=%d sec80=%d",
 				ev->hdr.rssi_chain1,
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 1, PRI20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 1, SEC20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 1, SEC40),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 1, SEC80));
 
-		WMI_LOGD(
-		"%s: chain 2: raw=0x%08x: pri20=%d sec20=%d sec40=%d sec80=%d",
-				__func__,
+		wmi_debug(
+		"chain 2: raw=0x%08x: pri20=%d sec20=%d sec40=%d sec80=%d",
 				ev->hdr.rssi_chain2,
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 2, PRI20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 2, SEC20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 2, SEC40),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 2, SEC80));
 
-		WMI_LOGD(
-		"%s: chain 3: raw=0x%08x: pri20=%d sec20=%d sec40=%d sec80=%d",
-				__func__,
+		wmi_debug(
+		"chain 3: raw=0x%08x: pri20=%d sec20=%d sec40=%d sec80=%d",
 				ev->hdr.rssi_chain3,
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 3, PRI20),
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 3, SEC20),
@@ -8669,18 +8671,17 @@
 				WMI_UNIFIED_RSSI_CHAN_GET(&ev->hdr, 3, SEC80));
 
 
-		WMI_LOGD(
-			"%s: freq_info_1=0x%08x, freq_info_2=0x%08x",
-			   __func__, ev->hdr.freq_info_1, ev->hdr.freq_info_2);
+		wmi_debug(
+			"freq_info_1=0x%08x, freq_info_2=0x%08x",
+			   ev->hdr.freq_info_1, ev->hdr.freq_info_2);
 
 	   /*
 		* The NF chain values are signed and are negative - hence
 		* the cast evilness.
 		*/
-		WMI_LOGD(
-			"%s: nfval[1]=0x%08x, nfval[2]=0x%08x, nf=%d/%d/%d/%d, "
+		wmi_debug(
+			"nfval[1]=0x%08x, nfval[2]=0x%08x, nf=%d/%d/%d/%d, "
 				"freq1=%d, freq2=%d, cw=%d",
-				__func__,
 				ev->hdr.nf_list_1,
 				ev->hdr.nf_list_2,
 				(int) WMI_UNIFIED_NF_CHAIN_GET(&ev->hdr, 0),
@@ -9905,7 +9906,7 @@
 	cmd->disable_hw_ack = param->disable_hw_ack;
 	cmd->num_vdevs = param->num_vdevs;
 
-	WMI_LOGI("req_id:%d dis_hw_ack:%d num_vdevs:%d",
+	wmi_info("req_id:%d dis_hw_ack:%d num_vdevs:%d",
 		 cmd->requestor_id, cmd->disable_hw_ack, cmd->num_vdevs);
 
 	for (i = 0; i < param->num_vdevs; i++)
@@ -9939,13 +9940,13 @@
 	WMI_SET_CHANNEL_REG_CLASSID(chan_info, tchan_info->reg_class_id);
 	WMI_SET_CHANNEL_MAX_TX_POWER(chan_info, tchan_info->maxregpower);
 
-	WMI_LOGI("is_chan_passive:%d dfs_set:%d allow_vht:%d allow_ht:%d",
+	wmi_info("is_chan_passive:%d dfs_set:%d allow_vht:%d allow_ht:%d",
 		 tchan_info->is_chan_passive, tchan_info->dfs_set,
 		 tchan_info->allow_vht, tchan_info->allow_ht);
-	WMI_LOGI("antennamax:%d phy_mode:%d minpower:%d maxpower:%d",
+	wmi_info("antennamax:%d phy_mode:%d minpower:%d maxpower:%d",
 		 tchan_info->antennamax, tchan_info->phy_mode,
 		 tchan_info->minpower, tchan_info->maxpower);
-	WMI_LOGI("maxregpower:%d reg_class_id:%d",
+	wmi_info("maxregpower:%d reg_class_id:%d",
 		 tchan_info->maxregpower, tchan_info->reg_class_id);
 
 	ret = wmi_unified_cmd_send(
@@ -10005,7 +10006,7 @@
 	cmd->requestor_id = param->requestor_id;
 	cmd->disable_hw_ack = param->disable_hw_ack;
 
-	WMI_LOGI("req_id:%d dis_hw_ack:%d",
+	wmi_info("req_id:%d dis_hw_ack:%d",
 		 cmd->requestor_id, cmd->disable_hw_ack);
 
 	chan_info = &cmd->chan;
@@ -10036,13 +10037,13 @@
 	WMI_SET_CHANNEL_REG_CLASSID(chan_info, tchan_info->reg_class_id);
 	WMI_SET_CHANNEL_MAX_TX_POWER(chan_info, tchan_info->maxregpower);
 
-	WMI_LOGI("is_chan_passive:%d dfs_set:%d allow_vht:%d allow_ht:%d",
+	wmi_info("is_chan_passive:%d dfs_set:%d allow_vht:%d allow_ht:%d",
 		 tchan_info->is_chan_passive, tchan_info->dfs_set,
 		 tchan_info->allow_vht, tchan_info->allow_ht);
-	WMI_LOGI("antennamax:%d phy_mode:%d minpower:%d maxpower:%d",
+	wmi_info("antennamax:%d phy_mode:%d minpower:%d maxpower:%d",
 		 tchan_info->antennamax, tchan_info->phy_mode,
 		 tchan_info->minpower, tchan_info->maxpower);
-	WMI_LOGI("maxregpower:%d reg_class_id:%d",
+	wmi_info("maxregpower:%d reg_class_id:%d",
 		 tchan_info->maxregpower, tchan_info->reg_class_id);
 
 	/* To fill the Tag,Value pairs, move the buf accordingly */
@@ -10128,7 +10129,7 @@
 	qdf_mem_copy(param->vdev_id_bmap, &ev->requestor_id,
 		     sizeof(uint32_t));
 
-	WMI_LOGD("vdev_id_bmap is as follows");
+	wmi_debug("vdev_id_bmap is as follows");
 	qdf_trace_hex_dump(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
 			param->vdev_id_bmap, sizeof(param->vdev_id_bmap));
 
@@ -10143,7 +10144,7 @@
 void wmi_non_tlv_pdev_id_conversion_enable(wmi_unified_t wmi_handle,
 					   uint32_t *pdev_id_map, uint8_t size)
 {
-	WMI_LOGD("PDEV conversion Not Available");
+	wmi_debug("PDEV conversion Not Available");
 }
 
 /**
@@ -10840,7 +10841,7 @@
 	/*(uint8 *)(*wmi_id_to_name)(uint32_t cmd_id);*/
 #endif
 #else
-	WMI_LOGD("%s: Not supported", __func__);
+	wmi_debug("Not supported");
 #endif
 }
 qdf_export_symbol(wmi_non_tlv_attach);
diff --git a/wmi/src/wmi_unified_smart_ant_tlv.c b/wmi/src/wmi_unified_smart_ant_tlv.c
index ab82db9..1bc630a 100644
--- a/wmi/src/wmi_unified_smart_ant_tlv.c
+++ b/wmi/src/wmi_unified_smart_ant_tlv.c
@@ -146,7 +146,6 @@
 
 	len = sizeof(*cmd);
 	buf = wmi_buf_alloc(wmi_handle, len);
-	WMI_LOGD("%s:\n", __func__);
 	if (!buf) {
 		wmi_err("wmi_buf_alloc failed");
 		return QDF_STATUS_E_NOMEM;
@@ -387,8 +386,8 @@
 		itr += 2;
 		train_param->train_antenna_series = param->antenna_array[loop];
 		train_param->rc_flags = 0;
-		WMI_LOGI(FL("Series number:%d\n"), loop);
-		WMI_LOGI(FL("Rate [0x%02x] Tx_Antenna [0x%08x]\n"),
+		wmi_info("Series number:%d", loop);
+		wmi_info("Rate [0x%02x] Tx_Antenna [0x%08x]",
 			 train_param->train_rate_series,
 			 train_param->train_antenna_series);
 		train_param++;
@@ -466,7 +465,7 @@
 
 	for (i = 0; i < param->args_count; i++) {
 		node_config_args[i] = param->args_arr[i];
-		WMI_LOGI("%d", param->args_arr[i]);
+		wmi_info("%d", param->args_arr[i]);
 	}
 
 	wmi_mtrace(WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,