Browse Source

qcacmn: Support ROME SDIO

To support ROME SDIO card, change in HIF SDIO layer. Without CNSS or
CNSS2 module, it can bring up adapter successfully.

Output few logs in SDIO read and write thread, and optimize HIF
SDIO layer logging.

Change-Id: I96ba731a7fa572131aaaec8ab25d9cffc41ec0b2
CRs-Fixed: 2542051
Yu Ouyang 5 năm trước cách đây
mục cha
commit
82e3fbda26

+ 1 - 0
hif/src/sdio/hif_bmi_reg_access.c

@@ -25,6 +25,7 @@
 #include "htc_api.h"
 #include "htc_api.h"
 #include "if_sdio.h"
 #include "if_sdio.h"
 #include "regtable_sdio.h"
 #include "regtable_sdio.h"
+#include "hif_sdio_dev.h"
 
 
 #define BMI_COMMUNICATION_TIMEOUT       100000
 #define BMI_COMMUNICATION_TIMEOUT       100000
 
 

+ 132 - 138
hif/src/sdio/transfer/mailbox.c

@@ -313,8 +313,8 @@ QDF_STATUS hif_dev_map_service_to_pipe(struct hif_sdio_dev *pdev, uint16_t svc,
 		break;
 		break;
 
 
 	default:
 	default:
-		HIF_ERROR("%s: Err : Invalid service (%d)",
-			  __func__, svc);
+		hif_err("%s: Err : Invalid service (%d)",
+			__func__, svc);
 		status = QDF_STATUS_E_INVAL;
 		status = QDF_STATUS_E_INVAL;
 		break;
 		break;
 	}
 	}
@@ -337,13 +337,13 @@ int hif_dev_setup_device(struct hif_sdio_device *pdev)
 				      sizeof(pdev->MailBoxInfo));
 				      sizeof(pdev->MailBoxInfo));
 
 
 	if (status != QDF_STATUS_SUCCESS)
 	if (status != QDF_STATUS_SUCCESS)
-		HIF_ERROR("%s: HIF_DEVICE_GET_MBOX_ADDR failed", __func__);
+		hif_err("%s: HIF_DEVICE_GET_MBOX_ADDR failed", __func__);
 
 
 	status = hif_configure_device(NULL, pdev->HIFDevice,
 	status = hif_configure_device(NULL, pdev->HIFDevice,
 				      HIF_DEVICE_GET_BLOCK_SIZE,
 				      HIF_DEVICE_GET_BLOCK_SIZE,
 				      blocksizes, sizeof(blocksizes));
 				      blocksizes, sizeof(blocksizes));
 	if (status != QDF_STATUS_SUCCESS)
 	if (status != QDF_STATUS_SUCCESS)
-		HIF_ERROR("%s: HIF_DEVICE_GET_MBOX_BLOCK_SIZE fail", __func__);
+		hif_err("%s: HIF_DEVICE_GET_MBOX_BLOCK_SIZE fail", __func__);
 
 
 	pdev->BlockSize = blocksizes[MAILBOX_FOR_BLOCK_SIZE];
 	pdev->BlockSize = blocksizes[MAILBOX_FOR_BLOCK_SIZE];
 
 
@@ -376,7 +376,7 @@ void hif_dev_mask_interrupts(struct hif_sdio_device *pdev)
 				HIF_WR_SYNC_BYTE_INC, NULL);
 				HIF_WR_SYNC_BYTE_INC, NULL);
 
 
 	if (status != QDF_STATUS_SUCCESS)
 	if (status != QDF_STATUS_SUCCESS)
-		HIF_ERROR("%s: Err updating intr reg: %d", __func__, status);
+		hif_err("%s: Err updating intr reg: %d", __func__, status);
 }
 }
 
 
 /** hif_dev_unmask_interrupts() - Enable the interrupts in the device
 /** hif_dev_unmask_interrupts() - Enable the interrupts in the device
@@ -432,7 +432,7 @@ void hif_dev_unmask_interrupts(struct hif_sdio_device *pdev)
 				NULL);
 				NULL);
 
 
 	if (status != QDF_STATUS_SUCCESS)
 	if (status != QDF_STATUS_SUCCESS)
-		HIF_ERROR("%s: Err updating intr reg: %d", __func__, status);
+		hif_err("%s: Err updating intr reg: %d", __func__, status);
 }
 }
 
 
 void hif_dev_dump_registers(struct hif_sdio_device *pdev,
 void hif_dev_dump_registers(struct hif_sdio_device *pdev,
@@ -442,37 +442,38 @@ void hif_dev_dump_registers(struct hif_sdio_device *pdev,
 {
 {
 	int i = 0;
 	int i = 0;
 
 
-	HIF_DBG("%s: Mailbox registers:", __func__);
+	hif_debug("%s: Mailbox registers:", __func__);
 
 
 	if (irq_proc) {
 	if (irq_proc) {
-		HIF_DBG("HostIntStatus: 0x%x ", irq_proc->host_int_status);
-		HIF_DBG("CPUIntStatus: 0x%x ", irq_proc->cpu_int_status);
-		HIF_DBG("ErrorIntStatus: 0x%x ", irq_proc->error_int_status);
-		HIF_DBG("CounterIntStat: 0x%x ", irq_proc->counter_int_status);
-		HIF_DBG("MboxFrame: 0x%x ", irq_proc->mbox_frame);
-		HIF_DBG("RxLKAValid: 0x%x ", irq_proc->rx_lookahead_valid);
-		HIF_DBG("RxLKA0: 0x%x", irq_proc->rx_lookahead[0]);
-		HIF_DBG("RxLKA1: 0x%x ", irq_proc->rx_lookahead[1]);
-		HIF_DBG("RxLKA2: 0x%x ", irq_proc->rx_lookahead[2]);
-		HIF_DBG("RxLKA3: 0x%x", irq_proc->rx_lookahead[3]);
+		hif_debug("HostIntStatus: 0x%x ", irq_proc->host_int_status);
+		hif_debug("CPUIntStatus: 0x%x ", irq_proc->cpu_int_status);
+		hif_debug("ErrorIntStatus: 0x%x ", irq_proc->error_int_status);
+		hif_debug("CounterIntStat: 0x%x ",
+			  irq_proc->counter_int_status);
+		hif_debug("MboxFrame: 0x%x ", irq_proc->mbox_frame);
+		hif_debug("RxLKAValid: 0x%x ", irq_proc->rx_lookahead_valid);
+		hif_debug("RxLKA0: 0x%x", irq_proc->rx_lookahead[0]);
+		hif_debug("RxLKA1: 0x%x ", irq_proc->rx_lookahead[1]);
+		hif_debug("RxLKA2: 0x%x ", irq_proc->rx_lookahead[2]);
+		hif_debug("RxLKA3: 0x%x", irq_proc->rx_lookahead[3]);
 
 
 		if (pdev->MailBoxInfo.gmbox_address != 0) {
 		if (pdev->MailBoxInfo.gmbox_address != 0) {
-			HIF_DBG("GMBOX-HostIntStatus2:  0x%x ",
-				irq_proc->host_int_status2);
-			HIF_DBG("GMBOX-RX-Avail: 0x%x ",
-				irq_proc->gmbox_rx_avail);
+			hif_debug("GMBOX-HostIntStatus2:  0x%x ",
+				  irq_proc->host_int_status2);
+			hif_debug("GMBOX-RX-Avail: 0x%x ",
+				  irq_proc->gmbox_rx_avail);
 		}
 		}
 	}
 	}
 
 
 	if (irq_en) {
 	if (irq_en) {
-		HIF_DBG("IntStatusEnable: 0x%x\n",
-			irq_en->int_status_enable);
-		HIF_DBG("CounterIntStatus: 0x%x\n",
-			irq_en->counter_int_status_enable);
+		hif_debug("IntStatusEnable: 0x%x\n",
+			  irq_en->int_status_enable);
+		hif_debug("CounterIntStatus: 0x%x\n",
+			  irq_en->counter_int_status_enable);
 	}
 	}
 
 
 	for (i = 0; mbox_regs && i < 4; i++)
 	for (i = 0; mbox_regs && i < 4; i++)
-		HIF_DBG("Counter[%d]: 0x%x\n", i, mbox_regs->counter[i]);
+		hif_debug("Counter[%d]: 0x%x\n", i, mbox_regs->counter[i]);
 }
 }
 
 
 /* under HL SDIO, with Interface Memory support, we have
 /* under HL SDIO, with Interface Memory support, we have
@@ -503,7 +504,7 @@ static uint8_t hif_dev_map_pipe_to_mail_box(struct hif_sdio_device *pdev,
 	else if (0 == pipeid || 1 == pipeid)
 	else if (0 == pipeid || 1 == pipeid)
 		return 0;
 		return 0;
 
 
-	HIF_ERROR("%s: pipeid=%d invalid", __func__, pipeid);
+	hif_err("%s: pipeid=%d invalid", __func__, pipeid);
 
 
 	qdf_assert(0);
 	qdf_assert(0);
 
 
@@ -526,8 +527,8 @@ static uint8_t hif_dev_map_mail_box_to_pipe(struct hif_sdio_device *pdev,
 	else if (mbox_index == 1)
 	else if (mbox_index == 1)
 		return upload ? 3 : 2;
 		return upload ? 3 : 2;
 
 
-	HIF_ERROR("%s: mbox_index=%d, upload=%d invalid",
-		  __func__, mbox_index, upload);
+	hif_err("%s: mbox_index=%d, upload=%d invalid",
+		__func__, mbox_index, upload);
 
 
 	qdf_assert(0);
 	qdf_assert(0);
 
 
@@ -589,14 +590,14 @@ void hif_fixup_write_param(struct hif_sdio_dev *pdev, uint32_t req,
 	} else if (taddr == mboxinfo.mbox_prop[1].extended_address) {
 	} else if (taddr == mboxinfo.mbox_prop[1].extended_address) {
 		mboxlen = mboxinfo.mbox_prop[1].extended_size;
 		mboxlen = mboxinfo.mbox_prop[1].extended_size;
 	} else {
 	} else {
-		HIF_ERROR("%s: Invalid write addr: 0x%08x\n", __func__, taddr);
+		hif_err("%s: Invalid write addr: 0x%08x\n", __func__, taddr);
 		return;
 		return;
 	}
 	}
 
 
 	if (mboxlen != 0) {
 	if (mboxlen != 0) {
 		if (*length > mboxlen) {
 		if (*length > mboxlen) {
-			HIF_ERROR("%s: Error (%u > %u)",
-				  __func__, *length, mboxlen);
+			hif_err("%s: Error (%u > %u)",
+				__func__, *length, mboxlen);
 			return;
 			return;
 		}
 		}
 
 
@@ -629,9 +630,9 @@ static QDF_STATUS hif_dev_recv_packet(struct hif_sdio_device *pdev,
 	padded_length = DEV_CALC_RECV_PADDED_LEN(pdev, recv_length);
 	padded_length = DEV_CALC_RECV_PADDED_LEN(pdev, recv_length);
 
 
 	if (padded_length > packet->BufferLength) {
 	if (padded_length > packet->BufferLength) {
-		HIF_ERROR("%s: No space for padlen:%d recvlen:%d bufferlen:%d",
-			  __func__, padded_length,
-			  recv_length, packet->BufferLength);
+		hif_err("%s: No space for padlen:%d recvlen:%d bufferlen:%d",
+			__func__, padded_length,
+			recv_length, packet->BufferLength);
 		if (packet->Completion) {
 		if (packet->Completion) {
 			COMPLETE_HTC_PACKET(packet, QDF_STATUS_E_INVAL);
 			COMPLETE_HTC_PACKET(packet, QDF_STATUS_E_INVAL);
 			return QDF_STATUS_SUCCESS;
 			return QDF_STATUS_SUCCESS;
@@ -640,9 +641,9 @@ static QDF_STATUS hif_dev_recv_packet(struct hif_sdio_device *pdev,
 	}
 	}
 
 
 	/* mailbox index is saved in Endpoint member */
 	/* mailbox index is saved in Endpoint member */
-	HIF_INFO_HI("%s : hdr:0x%x, len:%d, padded length: %d Mbox:0x%x",
-		    __func__, packet->PktInfo.AsRx.ExpectedHdr, recv_length,
-		    padded_length, mbox_index);
+	hif_debug("%s : hdr:0x%x, len:%d, padded length: %d Mbox:0x%x",
+		  __func__, packet->PktInfo.AsRx.ExpectedHdr, recv_length,
+		  padded_length, mbox_index);
 
 
 	status = hif_read_write(pdev->HIFDevice,
 	status = hif_read_write(pdev->HIFDevice,
 				pdev->MailBoxInfo.mbox_addresses[mbox_index],
 				pdev->MailBoxInfo.mbox_addresses[mbox_index],
@@ -651,18 +652,18 @@ static QDF_STATUS hif_dev_recv_packet(struct hif_sdio_device *pdev,
 				req, sync ? NULL : packet);
 				req, sync ? NULL : packet);
 
 
 	if (status != QDF_STATUS_SUCCESS && status != QDF_STATUS_E_PENDING)
 	if (status != QDF_STATUS_SUCCESS && status != QDF_STATUS_E_PENDING)
-		HIF_ERROR("%s : Failed %d", __func__, status);
+		hif_err("%s : Failed %d", __func__, status);
 
 
 	if (sync) {
 	if (sync) {
 		packet->Status = status;
 		packet->Status = status;
 		if (status == QDF_STATUS_SUCCESS) {
 		if (status == QDF_STATUS_SUCCESS) {
 			HTC_FRAME_HDR *hdr = (HTC_FRAME_HDR *) packet->pBuffer;
 			HTC_FRAME_HDR *hdr = (HTC_FRAME_HDR *) packet->pBuffer;
 
 
-			HIF_INFO_HI("%s:EP:%d,Len:%d,Flg:%d,CB:0x%02X,0x%02X\n",
-				    __func__,
-				    hdr->EndpointID, hdr->PayloadLen,
-				    hdr->Flags, hdr->ControlBytes0,
-				    hdr->ControlBytes1);
+			hif_debug("%s:EP:%d,Len:%d,Flg:%d,CB:0x%02X,0x%02X\n",
+				  __func__,
+				  hdr->EndpointID, hdr->PayloadLen,
+				  hdr->Flags, hdr->ControlBytes0,
+				  hdr->ControlBytes1);
 		}
 		}
 	}
 	}
 
 
@@ -692,7 +693,7 @@ static QDF_STATUS hif_dev_issue_recv_packet_bundle
 	if ((HTC_PACKET_QUEUE_DEPTH(recv_pkt_queue) -
 	if ((HTC_PACKET_QUEUE_DEPTH(recv_pkt_queue) -
 	     HTC_MAX_MSG_PER_BUNDLE_RX) > 0) {
 	     HTC_MAX_MSG_PER_BUNDLE_RX) > 0) {
 		partial_bundle = true;
 		partial_bundle = true;
-		HIF_WARN("%s, partial bundle detected num: %d, %d\n",
+		hif_warn("%s, partial bundle detected num: %d, %d\n",
 			 __func__,
 			 __func__,
 			 HTC_PACKET_QUEUE_DEPTH(recv_pkt_queue),
 			 HTC_PACKET_QUEUE_DEPTH(recv_pkt_queue),
 			 HTC_MAX_MSG_PER_BUNDLE_RX);
 			 HTC_MAX_MSG_PER_BUNDLE_RX);
@@ -702,7 +703,7 @@ static QDF_STATUS hif_dev_issue_recv_packet_bundle
 		HTC_MAX_MSG_PER_BUNDLE_RX * target->TargetCreditSize;
 		HTC_MAX_MSG_PER_BUNDLE_RX * target->TargetCreditSize;
 	packet_rx_bundle = allocate_htc_bundle_packet(target);
 	packet_rx_bundle = allocate_htc_bundle_packet(target);
 	if (!packet_rx_bundle) {
 	if (!packet_rx_bundle) {
-		HIF_ERROR("%s: packet_rx_bundle is NULL\n", __func__);
+		hif_err("%s: packet_rx_bundle is NULL\n", __func__);
 		qdf_sleep(NBUF_ALLOC_FAIL_WAIT_TIME);  /* 100 msec sleep */
 		qdf_sleep(NBUF_ALLOC_FAIL_WAIT_TIME);  /* 100 msec sleep */
 		return QDF_STATUS_E_NOMEM;
 		return QDF_STATUS_E_NOMEM;
 	}
 	}
@@ -753,8 +754,8 @@ static QDF_STATUS hif_dev_issue_recv_packet_bundle
 				HIF_RD_SYNC_BLOCK_FIX, NULL);
 				HIF_RD_SYNC_BLOCK_FIX, NULL);
 
 
 	if (status != QDF_STATUS_SUCCESS) {
 	if (status != QDF_STATUS_SUCCESS) {
-		HIF_ERROR("%s, hif_send Failed status:%d\n",
-			  __func__, status);
+		hif_err("%s, hif_send Failed status:%d\n",
+			__func__, status);
 	} else {
 	} else {
 		unsigned char *buffer = bundle_buffer;
 		unsigned char *buffer = bundle_buffer;
 		*num_packets_fetched = i;
 		*num_packets_fetched = i;
@@ -799,7 +800,7 @@ QDF_STATUS hif_dev_recv_message_pending_handler(struct hif_sdio_device *pdev,
 	HTC_PACKET_QUEUE recv_q, sync_comp_q;
 	HTC_PACKET_QUEUE recv_q, sync_comp_q;
 	QDF_STATUS (*rxCompletion)(void *, qdf_nbuf_t,	uint8_t);
 	QDF_STATUS (*rxCompletion)(void *, qdf_nbuf_t,	uint8_t);
 
 
-	HIF_INFO_HI("%s: NumLookAheads: %d\n", __func__, num_look_aheads);
+	hif_debug("%s: NumLookAheads: %d\n", __func__, num_look_aheads);
 
 
 	if (num_pkts_fetched)
 	if (num_pkts_fetched)
 		*num_pkts_fetched = 0;
 		*num_pkts_fetched = 0;
@@ -841,8 +842,8 @@ QDF_STATUS hif_dev_recv_message_pending_handler(struct hif_sdio_device *pdev,
 		id = ((HTC_FRAME_HDR *)&look_aheads[0])->EndpointID;
 		id = ((HTC_FRAME_HDR *)&look_aheads[0])->EndpointID;
 
 
 		if (id >= ENDPOINT_MAX) {
 		if (id >= ENDPOINT_MAX) {
-			HIF_ERROR("%s: Invalid Endpoint in lookahead: %d\n",
-				  __func__, id);
+			hif_err("%s: Invalid Endpoint in lookahead: %d\n",
+				__func__, id);
 			status = QDF_STATUS_E_PROTO;
 			status = QDF_STATUS_E_PROTO;
 			break;
 			break;
 		}
 		}
@@ -1028,7 +1029,7 @@ static QDF_STATUS hif_dev_service_cpu_interrupt(struct hif_sdio_device *pdev)
 	cpu_int_status = mboxProcRegs(pdev).cpu_int_status &
 	cpu_int_status = mboxProcRegs(pdev).cpu_int_status &
 			 mboxEnaRegs(pdev).cpu_int_status_enable;
 			 mboxEnaRegs(pdev).cpu_int_status_enable;
 
 
-	HIF_ERROR("%s: 0x%x", __func__, (uint32_t)cpu_int_status);
+	hif_err("%s: 0x%x", __func__, (uint32_t)cpu_int_status);
 
 
 	/* Clear the interrupt */
 	/* Clear the interrupt */
 	mboxProcRegs(pdev).cpu_int_status &= ~cpu_int_status;
 	mboxProcRegs(pdev).cpu_int_status &= ~cpu_int_status;
@@ -1064,7 +1065,7 @@ static QDF_STATUS hif_dev_service_cpu_interrupt(struct hif_sdio_device *pdev)
 				pdev->hif_callbacks.Context,
 				pdev->hif_callbacks.Context,
 				QDF_STATUS_E_FAILURE);
 				QDF_STATUS_E_FAILURE);
 	} else {
 	} else {
-		HIF_ERROR("%s: Unrecognized CPU event", __func__);
+		hif_err("%s: Unrecognized CPU event", __func__);
 	}
 	}
 
 
 	return status;
 	return status;
@@ -1085,16 +1086,16 @@ static QDF_STATUS hif_dev_service_error_interrupt(struct hif_sdio_device *pdev)
 	uint8_t error_int_status = 0;
 	uint8_t error_int_status = 0;
 
 
 	error_int_status = mboxProcRegs(pdev).error_int_status & 0x0F;
 	error_int_status = mboxProcRegs(pdev).error_int_status & 0x0F;
-	HIF_ERROR("%s: 0x%x", __func__, error_int_status);
+	hif_err("%s: 0x%x", __func__, error_int_status);
 
 
 	if (ERROR_INT_STATUS_WAKEUP_GET(error_int_status))
 	if (ERROR_INT_STATUS_WAKEUP_GET(error_int_status))
-		HIF_ERROR("%s: Error : Wakeup", __func__);
+		hif_err("%s: Error : Wakeup", __func__);
 
 
 	if (ERROR_INT_STATUS_RX_UNDERFLOW_GET(error_int_status))
 	if (ERROR_INT_STATUS_RX_UNDERFLOW_GET(error_int_status))
-		HIF_ERROR("%s: Error : Rx Underflow", __func__);
+		hif_err("%s: Error : Rx Underflow", __func__);
 
 
 	if (ERROR_INT_STATUS_TX_OVERFLOW_GET(error_int_status))
 	if (ERROR_INT_STATUS_TX_OVERFLOW_GET(error_int_status))
-		HIF_ERROR("%s: Error : Tx Overflow", __func__);
+		hif_err("%s: Error : Tx Overflow", __func__);
 
 
 	/* Clear the interrupt */
 	/* Clear the interrupt */
 	mboxProcRegs(pdev).error_int_status &= ~error_int_status;
 	mboxProcRegs(pdev).error_int_status &= ~error_int_status;
@@ -1134,7 +1135,7 @@ static QDF_STATUS hif_dev_service_debug_interrupt(struct hif_sdio_device *pdev)
 	QDF_STATUS status;
 	QDF_STATUS status;
 
 
 	/* Send a target failure event to the application */
 	/* Send a target failure event to the application */
-	HIF_ERROR("%s: Target debug interrupt", __func__);
+	hif_err("%s: Target debug interrupt", __func__);
 
 
 	/* clear the interrupt , the debug error interrupt is counter 0
 	/* clear the interrupt , the debug error interrupt is counter 0
 	 * read counter to clear interrupt
 	 * read counter to clear interrupt
@@ -1447,7 +1448,7 @@ QDF_STATUS hif_dev_dsr_handler(void *context)
 			 * could be more pending messages. The HIF layer
 			 * could be more pending messages. The HIF layer
 			 * must ACK the interrupt on behalf of HTC
 			 * must ACK the interrupt on behalf of HTC
 			 */
 			 */
-			HIF_INFO("%s:  Yield (RX count: %d)",
+			hif_info("%s:  Yield (RX count: %d)",
 				 __func__, pdev->CurrentDSRRecvCount);
 				 __func__, pdev->CurrentDSRRecvCount);
 		} else {
 		} else {
 			hif_ack_interrupt(pdev->HIFDevice);
 			hif_ack_interrupt(pdev->HIFDevice);
@@ -1479,9 +1480,9 @@ hif_read_write(struct hif_sdio_dev *device,
 
 
 	AR_DEBUG_ASSERT(device);
 	AR_DEBUG_ASSERT(device);
 	AR_DEBUG_ASSERT(device->func);
 	AR_DEBUG_ASSERT(device->func);
-	HIF_TRACE("%s: device 0x%pK addr 0x%lX buffer 0x%pK",
+	hif_debug("%s: device 0x%pK addr 0x%lX buffer 0x%pK",
 		  __func__, device, address, buffer);
 		  __func__, device, address, buffer);
-	HIF_TRACE("%s: len %d req 0x%X context 0x%pK",
+	hif_debug("%s: len %d req 0x%X context 0x%pK",
 		  __func__, length, request, context);
 		  __func__, length, request, context);
 
 
 	/*sdio r/w action is not needed when suspend, so just return */
 	/*sdio r/w action is not needed when suspend, so just return */
@@ -1500,10 +1501,10 @@ hif_read_write(struct hif_sdio_dev *device,
 					 : "Synch"));
 					 : "Synch"));
 			busrequest = hif_allocate_bus_request(device);
 			busrequest = hif_allocate_bus_request(device);
 			if (!busrequest) {
 			if (!busrequest) {
-				HIF_ERROR("%s:bus requests unavail", __func__);
-				HIF_ERROR("%s, addr:0x%lX, len:%d",
-					  request & HIF_SDIO_READ ? "READ" :
-					  "WRITE", address, length);
+				hif_err("%s:bus requests unavail", __func__);
+				hif_err("%s, addr:0x%lX, len:%d",
+					request & HIF_SDIO_READ ? "READ" :
+					"WRITE", address, length);
 				return QDF_STATUS_E_FAILURE;
 				return QDF_STATUS_E_FAILURE;
 			}
 			}
 			busrequest->address = address;
 			busrequest->address = address;
@@ -1526,11 +1527,11 @@ hif_read_write(struct hif_sdio_dev *device,
 				    0) {
 				    0) {
 					QDF_STATUS status = busrequest->status;
 					QDF_STATUS status = busrequest->status;
 
 
-					HIF_TRACE("%s: sync freeing 0x%lX:0x%X",
+					hif_debug("%s: sync freeing 0x%lX:0x%X",
 						  __func__,
 						  __func__,
 						  (unsigned long)busrequest,
 						  (unsigned long)busrequest,
 						  busrequest->status);
 						  busrequest->status);
-					HIF_TRACE("%s: freeing req: 0x%X",
+					hif_debug("%s: freeing req: 0x%X",
 						  __func__,
 						  __func__,
 						  (unsigned int)request);
 						  (unsigned int)request);
 					hif_free_bus_request(device,
 					hif_free_bus_request(device,
@@ -1541,14 +1542,14 @@ hif_read_write(struct hif_sdio_dev *device,
 					return QDF_STATUS_E_FAILURE;
 					return QDF_STATUS_E_FAILURE;
 				}
 				}
 			} else {
 			} else {
-				HIF_TRACE("%s: queued async req: 0x%lX",
+				hif_debug("%s: queued async req: 0x%lX",
 					  __func__, (unsigned long)busrequest);
 					  __func__, (unsigned long)busrequest);
 				up(&device->sem_async);
 				up(&device->sem_async);
 				return QDF_STATUS_E_PENDING;
 				return QDF_STATUS_E_PENDING;
 			}
 			}
 		} else {
 		} else {
-			HIF_ERROR("%s: Invalid execution mode: 0x%08x",
-				  __func__, (unsigned int)request);
+			hif_err("%s: Invalid execution mode: 0x%08x",
+				__func__, (unsigned int)request);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			break;
 			break;
 		}
 		}
@@ -1576,8 +1577,8 @@ static int hif_sdio_func_enable(struct hif_softc *ol_sc,
 
 
 		ret = hif_sdio_quirk_async_intr(ol_sc, func);
 		ret = hif_sdio_quirk_async_intr(ol_sc, func);
 		if (ret) {
 		if (ret) {
-			HIF_ERROR("%s: Error setting async intr:%d",
-				  __func__, ret);
+			hif_err("%s: Error setting async intr:%d",
+				__func__, ret);
 			sdio_release_host(func);
 			sdio_release_host(func);
 			return QDF_STATUS_E_FAILURE;
 			return QDF_STATUS_E_FAILURE;
 		}
 		}
@@ -1585,24 +1586,24 @@ static int hif_sdio_func_enable(struct hif_softc *ol_sc,
 		func->enable_timeout = 100;
 		func->enable_timeout = 100;
 		ret = sdio_enable_func(func);
 		ret = sdio_enable_func(func);
 		if (ret) {
 		if (ret) {
-			HIF_ERROR("%s: Unable to enable function: %d",
-				  __func__, ret);
+			hif_err("%s: Unable to enable function: %d",
+				__func__, ret);
 			sdio_release_host(func);
 			sdio_release_host(func);
 			return QDF_STATUS_E_FAILURE;
 			return QDF_STATUS_E_FAILURE;
 		}
 		}
 
 
 		ret = sdio_set_block_size(func, HIF_BLOCK_SIZE);
 		ret = sdio_set_block_size(func, HIF_BLOCK_SIZE);
 		if (ret) {
 		if (ret) {
-			HIF_ERROR("%s: Unable to set block size 0x%X : %d\n",
-				  __func__, HIF_BLOCK_SIZE, ret);
+			hif_err("%s: Unable to set block size 0x%X : %d\n",
+				__func__, HIF_BLOCK_SIZE, ret);
 			sdio_release_host(func);
 			sdio_release_host(func);
 			return QDF_STATUS_E_FAILURE;
 			return QDF_STATUS_E_FAILURE;
 		}
 		}
 
 
 		ret = hif_sdio_quirk_mod_strength(ol_sc, func);
 		ret = hif_sdio_quirk_mod_strength(ol_sc, func);
 		if (ret) {
 		if (ret) {
-			HIF_ERROR("%s: Error setting mod strength : %d\n",
-				  __func__, ret);
+			hif_err("%s: Error setting mod strength : %d\n",
+				__func__, ret);
 			sdio_release_host(func);
 			sdio_release_host(func);
 			return QDF_STATUS_E_FAILURE;
 			return QDF_STATUS_E_FAILURE;
 		}
 		}
@@ -1636,26 +1637,26 @@ __hif_read_write(struct hif_sdio_dev *device,
 	bool bounced = false;
 	bool bounced = false;
 
 
 	if (!device) {
 	if (!device) {
-		HIF_ERROR("%s: device null!", __func__);
+		hif_err("%s: device null!", __func__);
 		return QDF_STATUS_E_INVAL;
 		return QDF_STATUS_E_INVAL;
 	}
 	}
 
 
 	if (!device->func) {
 	if (!device->func) {
-		HIF_ERROR("%s: func null!", __func__);
+		hif_err("%s: func null!", __func__);
 		return QDF_STATUS_E_INVAL;
 		return QDF_STATUS_E_INVAL;
 	}
 	}
 
 
-	HIF_INFO_HI("%s: addr:0X%06X, len:%08d, %s, %s", __func__,
-		    address, length,
-		    request & HIF_SDIO_READ ? "Read " : "Write",
-		    request & HIF_ASYNCHRONOUS ? "Async" : "Sync ");
+	hif_debug("%s: addr:0X%06X, len:%08d, %s, %s", __func__,
+		  address, length,
+		  request & HIF_SDIO_READ ? "Read " : "Write",
+		  request & HIF_ASYNCHRONOUS ? "Async" : "Sync ");
 
 
 	do {
 	do {
 		if (request & HIF_EXTENDED_IO) {
 		if (request & HIF_EXTENDED_IO) {
-			HIF_INFO_HI("%s: Command type: CMD53\n", __func__);
+			//HIF_INFO_HI("%s: Command type: CMD53\n", __func__);
 		} else {
 		} else {
-			HIF_ERROR("%s: Invalid command type: 0x%08x\n",
-				  __func__, request);
+			hif_err("%s: Invalid command type: 0x%08x\n",
+				__func__, request);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			break;
 			break;
 		}
 		}
@@ -1665,14 +1666,14 @@ __hif_read_write(struct hif_sdio_dev *device,
 			length =
 			length =
 				(length / HIF_BLOCK_SIZE) *
 				(length / HIF_BLOCK_SIZE) *
 				HIF_BLOCK_SIZE;
 				HIF_BLOCK_SIZE;
-			HIF_INFO_HI("%s: Block mode (BlockLen: %d)\n",
-				    __func__, length);
+			hif_debug("%s: Block mode (BlockLen: %d)\n",
+				  __func__, length);
 		} else if (request & HIF_BYTE_BASIS) {
 		} else if (request & HIF_BYTE_BASIS) {
-			HIF_INFO_HI("%s: Byte mode (BlockLen: %d)\n",
-				    __func__, length);
+			hif_debug("%s: Byte mode (BlockLen: %d)\n",
+				  __func__, length);
 		} else {
 		} else {
-			HIF_ERROR("%s: Invalid data mode: 0x%08x\n",
-				  __func__, request);
+			hif_err("%s: Invalid data mode: 0x%08x\n",
+				__func__, request);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			break;
 			break;
 		}
 		}
@@ -1680,22 +1681,22 @@ __hif_read_write(struct hif_sdio_dev *device,
 			hif_fixup_write_param(device, request,
 			hif_fixup_write_param(device, request,
 					      &length, &address);
 					      &length, &address);
 
 
-			HIF_INFO_HI("addr:%08X, len:0x%08X, dummy:0x%04X\n",
-				    address, length,
-				    (request & HIF_DUMMY_SPACE_MASK) >> 16);
+			hif_debug("addr:%08X, len:0x%08X, dummy:0x%04X\n",
+				  address, length,
+				  (request & HIF_DUMMY_SPACE_MASK) >> 16);
 		}
 		}
 
 
 		if (request & HIF_FIXED_ADDRESS) {
 		if (request & HIF_FIXED_ADDRESS) {
 			opcode = CMD53_FIXED_ADDRESS;
 			opcode = CMD53_FIXED_ADDRESS;
-			HIF_INFO_HI("%s: Addr mode: fixed 0x%X\n",
-				    __func__, address);
+			hif_debug("%s: Addr mode: fixed 0x%X\n",
+				  __func__, address);
 		} else if (request & HIF_INCREMENTAL_ADDRESS) {
 		} else if (request & HIF_INCREMENTAL_ADDRESS) {
 			opcode = CMD53_INCR_ADDRESS;
 			opcode = CMD53_INCR_ADDRESS;
-			HIF_INFO_HI("%s: Address mode: Incremental 0x%X\n",
-				    __func__, address);
+			hif_debug("%s: Address mode: Incremental 0x%X\n",
+				  __func__, address);
 		} else {
 		} else {
-			HIF_ERROR("%s: Invalid address mode: 0x%08x\n",
-				  __func__, request);
+			hif_err("%s: Invalid address mode: 0x%08x\n",
+				__func__, request);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			break;
 			break;
 		}
 		}
@@ -1708,8 +1709,8 @@ __hif_read_write(struct hif_sdio_dev *device,
 				/* copy the write data to the dma buffer */
 				/* copy the write data to the dma buffer */
 				AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE);
 				AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE);
 				if (length > HIF_DMA_BUFFER_SIZE) {
 				if (length > HIF_DMA_BUFFER_SIZE) {
-					HIF_ERROR("%s: Invalid write len: %d\n",
-						  __func__, length);
+					hif_err("%s: Invalid write len: %d\n",
+						__func__, length);
 					status = QDF_STATUS_E_INVAL;
 					status = QDF_STATUS_E_INVAL;
 					break;
 					break;
 				}
 				}
@@ -1724,15 +1725,15 @@ __hif_read_write(struct hif_sdio_dev *device,
 			if (opcode == CMD53_FIXED_ADDRESS  && tbuffer) {
 			if (opcode == CMD53_FIXED_ADDRESS  && tbuffer) {
 				ret = sdio_writesb(device->func, address,
 				ret = sdio_writesb(device->func, address,
 						   tbuffer, length);
 						   tbuffer, length);
-				HIF_INFO_HI("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
-					    __func__, ret, address, length,
-					    *(int *)tbuffer);
+				hif_debug("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
+					  __func__, ret, address, length,
+					  *(int *)tbuffer);
 			} else if (tbuffer) {
 			} else if (tbuffer) {
 				ret = sdio_memcpy_toio(device->func, address,
 				ret = sdio_memcpy_toio(device->func, address,
 						       tbuffer, length);
 						       tbuffer, length);
-				HIF_INFO_HI("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
-					    __func__, ret, address, length,
-					    *(int *)tbuffer);
+				hif_debug("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
+					  __func__, ret, address, length,
+					  *(int *)tbuffer);
 			}
 			}
 		} else if (request & HIF_SDIO_READ) {
 		} else if (request & HIF_SDIO_READ) {
 #if HIF_USE_DMA_BOUNCE_BUFFER
 #if HIF_USE_DMA_BOUNCE_BUFFER
@@ -1740,8 +1741,8 @@ __hif_read_write(struct hif_sdio_dev *device,
 				AR_DEBUG_ASSERT(device->dma_buffer);
 				AR_DEBUG_ASSERT(device->dma_buffer);
 				AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE);
 				AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE);
 				if (length > HIF_DMA_BUFFER_SIZE) {
 				if (length > HIF_DMA_BUFFER_SIZE) {
-					HIF_ERROR("%s: Invalid read len: %d\n",
-						  __func__, length);
+					hif_err("%s: Invalid read len: %d\n",
+						__func__, length);
 					status = QDF_STATUS_E_INVAL;
 					status = QDF_STATUS_E_INVAL;
 					break;
 					break;
 				}
 				}
@@ -1756,35 +1757,35 @@ __hif_read_write(struct hif_sdio_dev *device,
 			if (opcode == CMD53_FIXED_ADDRESS && tbuffer) {
 			if (opcode == CMD53_FIXED_ADDRESS && tbuffer) {
 				ret = sdio_readsb(device->func, tbuffer,
 				ret = sdio_readsb(device->func, tbuffer,
 						  address, length);
 						  address, length);
-				HIF_INFO_HI("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
-					    __func__, ret, address, length,
-					    *(int *)tbuffer);
+				hif_debug("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
+					  __func__, ret, address, length,
+					  *(int *)tbuffer);
 			} else if (tbuffer) {
 			} else if (tbuffer) {
 				ret = sdio_memcpy_fromio(device->func,
 				ret = sdio_memcpy_fromio(device->func,
 							 tbuffer, address,
 							 tbuffer, address,
 							 length);
 							 length);
-				HIF_INFO_HI("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
-					    __func__, ret, address, length,
-					    *(int *)tbuffer);
+				hif_debug("%s:r=%d addr:0x%X, len:%d, 0x%X\n",
+					  __func__, ret, address, length,
+					  *(int *)tbuffer);
 			}
 			}
 #if HIF_USE_DMA_BOUNCE_BUFFER
 #if HIF_USE_DMA_BOUNCE_BUFFER
 			if (bounced && tbuffer)
 			if (bounced && tbuffer)
 				memcpy(buffer, tbuffer, length);
 				memcpy(buffer, tbuffer, length);
 #endif
 #endif
 		} else {
 		} else {
-			HIF_ERROR("%s: Invalid dir: 0x%08x", __func__, request);
+			hif_err("%s: Invalid dir: 0x%08x", __func__, request);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			return status;
 			return status;
 		}
 		}
 
 
 		if (ret) {
 		if (ret) {
-			HIF_ERROR("%s: SDIO bus operation failed!", __func__);
-			HIF_ERROR("%s: MMC stack returned : %d", __func__, ret);
-			HIF_ERROR("%s: addr:0X%06X, len:%08d, %s, %s",
-				  __func__, address, length,
-				  request & HIF_SDIO_READ ? "Read " : "Write",
-				  request & HIF_ASYNCHRONOUS ?
-				  "Async" : "Sync");
+			hif_err("%s: SDIO bus operation failed!", __func__);
+			hif_err("%s: MMC stack returned : %d", __func__, ret);
+			hif_err("%s: addr:0X%06X, len:%08d, %s, %s",
+				__func__, address, length,
+				request & HIF_SDIO_READ ? "Read " : "Write",
+				request & HIF_ASYNCHRONOUS ?
+				"Async" : "Sync");
 			status = QDF_STATUS_E_FAILURE;
 			status = QDF_STATUS_E_FAILURE;
 		}
 		}
 	} while (false);
 	} while (false);
@@ -1836,7 +1837,7 @@ static int async_task(void *param)
 			else
 			else
 				device->asyncreq = NULL;
 				device->asyncreq = NULL;
 			qdf_spin_unlock_irqrestore(&device->asynclock);
 			qdf_spin_unlock_irqrestore(&device->asynclock);
-			HIF_TRACE("%s: processing req: 0x%lX",
+			hif_debug("%s: processing req: 0x%lX",
 				  __func__, (unsigned long)request);
 				  __func__, (unsigned long)request);
 
 
 			if (!claimed) {
 			if (!claimed) {
@@ -1866,18 +1867,11 @@ static int async_task(void *param)
 				if (request->request & HIF_ASYNCHRONOUS) {
 				if (request->request & HIF_ASYNCHRONOUS) {
 					void *context = request->context;
 					void *context = request->context;
 
 
-					HIF_TRACE("%s: freeing req: 0x%lX",
-						  __func__,
-						  (unsigned long)request);
 					hif_free_bus_request(device, request);
 					hif_free_bus_request(device, request);
-
-					HIF_TRACE("%s: completion req 0x%lX",
-						  __func__,
-						  (unsigned long)request);
 					device->htc_callbacks.
 					device->htc_callbacks.
 					rw_compl_handler(context, status);
 					rw_compl_handler(context, status);
 				} else {
 				} else {
-					HIF_TRACE("%s: upping req: 0x%lX",
+					hif_debug("%s: upping req: 0x%lX",
 						  __func__,
 						  __func__,
 						  (unsigned long)request);
 						  (unsigned long)request);
 					request->status = status;
 					request->status = status;
@@ -1952,7 +1946,7 @@ QDF_STATUS hif_enable_func(struct hif_softc *ol_sc, struct hif_sdio_dev *device,
 	HIF_ENTER();
 	HIF_ENTER();
 
 
 	if (!device) {
 	if (!device) {
-		HIF_ERROR("%s: HIF device is NULL", __func__);
+		hif_err("%s: HIF device is NULL", __func__);
 		return QDF_STATUS_E_INVAL;
 		return QDF_STATUS_E_INVAL;
 	}
 	}
 
 
@@ -1966,8 +1960,8 @@ QDF_STATUS hif_enable_func(struct hif_softc *ol_sc, struct hif_sdio_dev *device,
 						    (void *)device,
 						    (void *)device,
 						    "AR6K Async");
 						    "AR6K Async");
 		if (IS_ERR(device->async_task)) {
 		if (IS_ERR(device->async_task)) {
-			HIF_ERROR("%s: Error creating async task",
-				  __func__);
+			hif_err("%s: Error creating async task",
+				__func__);
 			return QDF_STATUS_E_FAILURE;
 			return QDF_STATUS_E_FAILURE;
 		}
 		}
 		device->is_disabled = false;
 		device->is_disabled = false;

+ 54 - 54
hif/src/sdio/transfer/transfer.c

@@ -96,8 +96,8 @@ QDF_STATUS hif_dev_send_buffer(struct hif_sdio_device *pdev, uint32_t xfer_id,
 	int frag_count = 0, i, count, head_len;
 	int frag_count = 0, i, count, head_len;
 
 
 	if (hif_get_send_address(pdev, pipe, &addr)) {
 	if (hif_get_send_address(pdev, pipe, &addr)) {
-		HIF_ERROR("%s: Invalid address map for pipe 0x%x",
-			  __func__, pipe);
+		hif_err("%s: Invalid address map for pipe 0x%x",
+			__func__, pipe);
 
 
 		return QDF_STATUS_E_INVAL;
 		return QDF_STATUS_E_INVAL;
 	}
 	}
@@ -217,17 +217,17 @@ QDF_STATUS hif_dev_alloc_and_prepare_rx_packets(struct hif_sdio_device *pdev,
 	for (i = 0; i < messages; i++) {
 	for (i = 0; i < messages; i++) {
 		hdr = (HTC_FRAME_HDR *)&look_aheads[i];
 		hdr = (HTC_FRAME_HDR *)&look_aheads[i];
 		if (hdr->EndpointID >= ENDPOINT_MAX) {
 		if (hdr->EndpointID >= ENDPOINT_MAX) {
-			HIF_ERROR("%s: Invalid Endpoint:%d\n",
-				  __func__, hdr->EndpointID);
+			hif_err("%s: Invalid Endpoint:%d\n",
+				__func__, hdr->EndpointID);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			break;
 			break;
 		}
 		}
 
 
 		if (hdr->PayloadLen > HTC_MAX_PAYLOAD_LENGTH) {
 		if (hdr->PayloadLen > HTC_MAX_PAYLOAD_LENGTH) {
-			HIF_ERROR("%s: Payload length %d exceeds max HTC : %u",
-				  __func__,
-				  hdr->PayloadLen,
-				 (uint32_t)HTC_MAX_PAYLOAD_LENGTH);
+			hif_err("%s: Payload length %d exceeds max HTC : %u",
+				__func__,
+				hdr->PayloadLen,
+				(uint32_t)HTC_MAX_PAYLOAD_LENGTH);
 			status = QDF_STATUS_E_INVAL;
 			status = QDF_STATUS_E_INVAL;
 			break;
 			break;
 		}
 		}
@@ -246,7 +246,7 @@ QDF_STATUS hif_dev_alloc_and_prepare_rx_packets(struct hif_sdio_device *pdev,
 			 */
 			 */
 			num_messages++;
 			num_messages++;
 
 
-			HIF_INFO("%s: HTC header : %u messages in bundle",
+			hif_info("%s: HTC header : %u messages in bundle",
 				 __func__, num_messages);
 				 __func__, num_messages);
 		}
 		}
 
 
@@ -300,12 +300,12 @@ QDF_STATUS hif_dev_alloc_and_prepare_rx_packets(struct hif_sdio_device *pdev,
 
 
 			/* make sure  message can fit in the endpoint buffer */
 			/* make sure  message can fit in the endpoint buffer */
 			if (full_length > packet->BufferLength) {
 			if (full_length > packet->BufferLength) {
-				HIF_ERROR("%s: Payload Length Error", __func__);
-				HIF_ERROR("%s: header reports payload: %u(%u)",
-					  __func__, hdr->PayloadLen,
-					  full_length);
-				HIF_ERROR("%s: endpoint buffer size: %d\n",
-					  __func__, packet->BufferLength);
+				hif_err("%s: Payload Length Error", __func__);
+				hif_err("%s: header reports payload: %u(%u)",
+					__func__, hdr->PayloadLen,
+					full_length);
+				hif_err("%s: endpoint buffer size: %d\n",
+					__func__, packet->BufferLength);
 				status = QDF_STATUS_E_INVAL;
 				status = QDF_STATUS_E_INVAL;
 				break;
 				break;
 			}
 			}
@@ -382,7 +382,7 @@ QDF_STATUS hif_dev_process_trailer(struct hif_sdio_device *pdev,
 	HTC_RECORD_HDR *record;
 	HTC_RECORD_HDR *record;
 	HTC_LOOKAHEAD_REPORT *look_ahead;
 	HTC_LOOKAHEAD_REPORT *look_ahead;
 
 
-	HIF_INFO_HI("%s: length:%d", __func__, length);
+	hif_debug("%s: length:%d", __func__, length);
 
 
 	orig_buffer = buffer;
 	orig_buffer = buffer;
 	orig_length = length;
 	orig_length = length;
@@ -400,11 +400,11 @@ QDF_STATUS hif_dev_process_trailer(struct hif_sdio_device *pdev,
 
 
 		if (record->Length > length) {
 		if (record->Length > length) {
 			/* no room left in buffer for record */
 			/* no room left in buffer for record */
-			HIF_ERROR("%s: invalid record len: (%u, %u)",
-				  __func__, record->Length,
-				  record->RecordID);
-			HIF_ERROR("%s: buffer has %d bytes left",
-				  __func__, length);
+			hif_err("%s: invalid record len: (%u, %u)",
+				__func__, record->Length,
+				record->RecordID);
+			hif_err("%s: buffer has %d bytes left",
+				__func__, length);
 			status = QDF_STATUS_E_PROTO;
 			status = QDF_STATUS_E_PROTO;
 			break;
 			break;
 		}
 		}
@@ -421,13 +421,13 @@ QDF_STATUS hif_dev_process_trailer(struct hif_sdio_device *pdev,
 			if ((look_ahead->PreValid ==
 			if ((look_ahead->PreValid ==
 			     ((~look_ahead->PostValid) & 0xFF)) &&
 			     ((~look_ahead->PostValid) & 0xFF)) &&
 			    next_look_aheads) {
 			    next_look_aheads) {
-				HIF_INFO_HI("%s: look_ahead Report", __func__);
-				HIF_INFO_HI("%s:prevalid:0x%x, postvalid:0x%x",
-					    __func__, look_ahead->PreValid,
-					    look_ahead->PostValid);
-				HIF_INFO_HI("%s:from endpoint %d : %u",
-					    __func__, from_endpoint,
-					    look_ahead->LookAhead0);
+				hif_debug("%s: look_ahead Report", __func__);
+				hif_debug("%s:prevalid:0x%x, postvalid:0x%x",
+					  __func__, look_ahead->PreValid,
+					  look_ahead->PostValid);
+				hif_debug("%s:from endpoint %d : %u",
+					  __func__, from_endpoint,
+					  look_ahead->LookAhead0);
 				/* look ahead bytes are valid, copy them over */
 				/* look ahead bytes are valid, copy them over */
 				((uint8_t *)(&next_look_aheads[0]))[0] =
 				((uint8_t *)(&next_look_aheads[0]))[0] =
 					look_ahead->LookAhead0;
 					look_ahead->LookAhead0;
@@ -499,8 +499,8 @@ QDF_STATUS hif_dev_process_trailer(struct hif_sdio_device *pdev,
 			}
 			}
 			break;
 			break;
 		default:
 		default:
-			HIF_ERROR("%s: HIF unhandled record: id:%u length:%u",
-				  __func__, record->RecordID, record->Length);
+			hif_err("%s: HIF unhandled record: id:%u length:%u",
+				__func__, record->RecordID, record->Length);
 			break;
 			break;
 		}
 		}
 
 
@@ -516,7 +516,7 @@ QDF_STATUS hif_dev_process_trailer(struct hif_sdio_device *pdev,
 		debug_dump_bytes(orig_buffer, orig_length,
 		debug_dump_bytes(orig_buffer, orig_length,
 				 "BAD Recv Trailer");
 				 "BAD Recv Trailer");
 
 
-	HIF_INFO_HI("%s: status = %d", __func__, status);
+	hif_debug("%s: status = %d", __func__, status);
 
 
 	return status;
 	return status;
 }
 }
@@ -573,10 +573,10 @@ QDF_STATUS hif_dev_process_recv_header(struct hif_sdio_device *pdev,
 
 
 			/* validate the actual header that was refreshed  */
 			/* validate the actual header that was refreshed  */
 			if (packet->ActualLength > packet->BufferLength) {
 			if (packet->ActualLength > packet->BufferLength) {
-				HIF_ERROR("%s: Bundled RECV Look ahead: 0x%X",
-					  __func__, look_ahead);
-				HIF_ERROR("%s: Invalid HDR payload length(%d)",
-					  __func__,  payloadLen);
+				hif_err("%s: Bundled RECV Look ahead: 0x%X",
+					__func__, look_ahead);
+				hif_err("%s: Invalid HDR payload length(%d)",
+					__func__,  payloadLen);
 				/* limit this to max buffer just to print out
 				/* limit this to max buffer just to print out
 				 * some of the buffer
 				 * some of the buffer
 				 */
 				 */
@@ -589,12 +589,12 @@ QDF_STATUS hif_dev_process_recv_header(struct hif_sdio_device *pdev,
 
 
 			if (packet->Endpoint
 			if (packet->Endpoint
 			    != HTC_GET_FIELD(buf, HTC_FRAME_HDR, ENDPOINTID)) {
 			    != HTC_GET_FIELD(buf, HTC_FRAME_HDR, ENDPOINTID)) {
-				HIF_ERROR("%s: Refreshed HDR EP (%d)",
-					  __func__,
-					  HTC_GET_FIELD(buf, HTC_FRAME_HDR,
-							ENDPOINTID));
-				HIF_ERROR("%s: doesn't match expected EP (%d)",
-					  __func__, packet->Endpoint);
+				hif_err("%s: Refreshed HDR EP (%d)",
+					__func__,
+					HTC_GET_FIELD(buf, HTC_FRAME_HDR,
+						      ENDPOINTID));
+				hif_err("%s: doesn't match expected EP (%d)",
+					__func__, packet->Endpoint);
 				status = QDF_STATUS_E_PROTO;
 				status = QDF_STATUS_E_PROTO;
 				break;
 				break;
 			}
 			}
@@ -605,13 +605,13 @@ QDF_STATUS hif_dev_process_recv_header(struct hif_sdio_device *pdev,
 			 * length did not reflect the actual header
 			 * length did not reflect the actual header
 			 * in the pending message
 			 * in the pending message
 			 */
 			 */
-			HIF_ERROR("%s: lookahead mismatch!", __func__);
-			HIF_ERROR("%s: pPkt:0x%lX flags:0x%X",
-				  __func__, (unsigned long)packet,
-				  packet->PktInfo.AsRx.HTCRxFlags);
-			HIF_ERROR("%s: look_ahead 0x%08X != 0x%08X",
-				  __func__, look_ahead,
-				  packet->PktInfo.AsRx.ExpectedHdr);
+			hif_err("%s: lookahead mismatch!", __func__);
+			hif_err("%s: pPkt:0x%lX flags:0x%X",
+				__func__, (unsigned long)packet,
+				packet->PktInfo.AsRx.HTCRxFlags);
+			hif_err("%s: look_ahead 0x%08X != 0x%08X",
+				__func__, look_ahead,
+				packet->PktInfo.AsRx.ExpectedHdr);
 #ifdef ATH_DEBUG_MODULE
 #ifdef ATH_DEBUG_MODULE
 			debug_dump_bytes((uint8_t *)&packet->PktInfo.AsRx.
 			debug_dump_bytes((uint8_t *)&packet->PktInfo.AsRx.
 					 ExpectedHdr, 4,
 					 ExpectedHdr, 4,
@@ -643,12 +643,12 @@ QDF_STATUS hif_dev_process_recv_header(struct hif_sdio_device *pdev,
 
 
 			if ((temp < sizeof(HTC_RECORD_HDR)) ||
 			if ((temp < sizeof(HTC_RECORD_HDR)) ||
 			    (temp > payloadLen)) {
 			    (temp > payloadLen)) {
-				HIF_ERROR("%s: invalid header",
-					  __func__);
-				HIF_ERROR("%s: payloadlength should be :%d",
-					  __func__, payloadLen);
-				HIF_ERROR("%s: But control bytes is :%d)",
-					  __func__, temp);
+				hif_err("%s: invalid header",
+					__func__);
+				hif_err("%s: payloadlength should be :%d",
+					__func__, payloadLen);
+				hif_err("%s: But control bytes is :%d)",
+					__func__, temp);
 				status = QDF_STATUS_E_PROTO;
 				status = QDF_STATUS_E_PROTO;
 				break;
 				break;
 			}
 			}