[PATCH 3/4 v3] EHCI: split ehci_qh - ehci-dbg.c changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From fe3ff8355716bcc3bbdbf9d54a32ba4f691f1369 Mon Sep 17 00:00:00 2001
From: Alek Du <alek.du@xxxxxxxxx>
Date: Wed, 24 Jun 2009 19:11:39 +0800
Subject: [PATCH] EHCI: Split ehci_qh - ehci-dbg.c changes

Most changes for debug outputs...

Signed-off-by: Alek Du <alek.du@xxxxxxxxx>
---
 drivers/usb/host/ehci-dbg.c |   60 +++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 7f4ace7..a6c70b2 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -135,9 +135,9 @@ static void __maybe_unused
 dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
 {
 	ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
-		qh, qh->hw_next, qh->hw_info1, qh->hw_info2,
-		qh->hw_current);
-	dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next);
+		qh, HW(qh)->hw_next, HW(qh)->hw_info1, HW(qh)->hw_info2,
+		HW(qh)->hw_current);
+	dbg_qtd("overlay", ehci, (struct ehci_qtd *) &HW(qh)->hw_qtd_next);
 }
 
 static void __maybe_unused
@@ -401,30 +401,30 @@ static void qh_lines (
 	char			mark;
 	__le32			list_end = EHCI_LIST_END(ehci);
 
-	if (qh->hw_qtd_next == list_end)	/* NEC does this */
+	if (HW(qh)->hw_qtd_next == list_end)	/* NEC does this */
 		mark = '@';
 	else
-		mark = token_mark(ehci, qh->hw_token);
+		mark = token_mark(ehci, HW(qh)->hw_token);
 	if (mark == '/') {	/* qh_alt_next controls qh advance? */
-		if ((qh->hw_alt_next & QTD_MASK(ehci))
-				== ehci->async->hw_alt_next)
+		if ((HW(qh)->hw_alt_next & QTD_MASK(ehci))
+				== HW(ehci->async)->hw_alt_next)
 			mark = '#';	/* blocked */
-		else if (qh->hw_alt_next == list_end)
+		else if (HW(qh)->hw_alt_next == list_end)
 			mark = '.';	/* use hw_qtd_next */
 		/* else alt_next points to some other qtd */
 	}
-	scratch = hc32_to_cpup(ehci, &qh->hw_info1);
-	hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &qh->hw_current) : 0;
+	scratch = hc32_to_cpup(ehci, &HW(qh)->hw_info1);
+	hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &HW(qh)->hw_current) : 0;
 	temp = scnprintf (next, size,
 			"qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)",
 			qh, scratch & 0x007f,
 			speed_char (scratch),
 			(scratch >> 8) & 0x000f,
-			scratch, hc32_to_cpup(ehci, &qh->hw_info2),
-			hc32_to_cpup(ehci, &qh->hw_token), mark,
-			(cpu_to_hc32(ehci, QTD_TOGGLE) & qh->hw_token)
+			scratch, hc32_to_cpup(ehci, &HW(qh)->hw_info2),
+			hc32_to_cpup(ehci, &HW(qh)->hw_token), mark,
+			(cpu_to_hc32(ehci, QTD_TOGGLE) & HW(qh)->hw_token)
 				? "data1" : "data0",
-			(hc32_to_cpup(ehci, &qh->hw_alt_next) >> 1) & 0x0f);
+			(hc32_to_cpup(ehci, &HW(qh)->hw_alt_next) >> 1) & 0x0f);
 	size -= temp;
 	next += temp;
 
@@ -435,10 +435,10 @@ static void qh_lines (
 		mark = ' ';
 		if (hw_curr == td->qtd_dma)
 			mark = '*';
-		else if (qh->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma))
+		else if (HW(qh)->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma))
 			mark = '+';
 		else if (QTD_LENGTH (scratch)) {
-			if (td->hw_alt_next == ehci->async->hw_alt_next)
+			if (td->hw_alt_next == HW(ehci->async)->hw_alt_next)
 				mark = '#';
 			else if (td->hw_alt_next != list_end)
 				mark = '/';
@@ -495,7 +495,8 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)
 	 * one QH per line, and TDs we know about
 	 */
 	spin_lock_irqsave (&ehci->lock, flags);
-	for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh)
+	for (qh = SH_QH(&ehci->async->qh_next); size > 0 && qh;
+						qh = SH_QH(&qh->qh_next))
 		qh_lines (ehci, qh, &next, &size);
 	if (ehci->reclaim && size > 0) {
 		temp = scnprintf (next, size, "\nreclaim =\n");
@@ -553,19 +554,19 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
 			switch (hc32_to_cpu(ehci, tag)) {
 			case Q_TYPE_QH:
 				temp = scnprintf (next, size, " qh%d-%04x/%p",
-						p.qh->period,
+						SH_QH(&p)->period,
 						hc32_to_cpup(ehci,
-								&p.qh->hw_info2)
+							&SH_HW(&p)->hw_info2)
 							/* uframe masks */
 							& (QH_CMASK | QH_SMASK),
-						p.qh);
+						SH_QH(&p));
 				size -= temp;
 				next += temp;
 				/* don't repeat what follows this qh */
 				for (temp = 0; temp < seen_count; temp++) {
 					if (seen [temp].ptr != p.ptr)
 						continue;
-					if (p.qh->qh_next.ptr) {
+					if (SH_QH(&p)->qh_next.ptr) {
 						temp = scnprintf (next, size,
 							" ...");
 						size -= temp;
@@ -576,14 +577,14 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
 				/* show more info the first time around */
 				if (temp == seen_count) {
 					u32	scratch = hc32_to_cpup(ehci,
-							&p.qh->hw_info1);
+							&SH_HW(&p)->hw_info1);
 					struct ehci_qtd	*qtd;
 					char		*type = "";
 
 					/* count tds, get ep direction */
 					temp = 0;
 					list_for_each_entry (qtd,
-							&p.qh->qtd_list,
+							&SH_QH(&p)->qtd_list,
 							qtd_list) {
 						temp++;
 						switch (0x03 & (hc32_to_cpu(
@@ -600,17 +601,20 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
 						speed_char (scratch),
 						scratch & 0x007f,
 						(scratch >> 8) & 0x000f, type,
-						p.qh->usecs, p.qh->c_usecs,
+						SH_QH(&p)->usecs,
+						SH_QH(&p)->c_usecs,
 						temp,
 						0x7ff & (scratch >> 16));
 
 					if (seen_count < DBG_SCHED_LIMIT)
-						seen [seen_count++].qh = p.qh;
+						SH_HW(&seen[seen_count++]) =
+								SH_HW(&p);
 				} else
 					temp = 0;
-				if (p.qh) {
-					tag = Q_NEXT_TYPE(ehci, p.qh->hw_next);
-					p = p.qh->qh_next;
+				if (SH_HW(&p)) {
+					tag = Q_NEXT_TYPE(ehci,
+							SH_HW(&p)->hw_next);
+					p = SH_QH(&p)->qh_next;
 				}
 				break;
 			case Q_TYPE_FSTN:
-- 
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux