patch-2.3.4 linux/drivers/usb/uhci-debug.c

Next file: linux/drivers/usb/uhci.c
Previous file: linux/drivers/usb/printer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/drivers/usb/uhci-debug.c linux/drivers/usb/uhci-debug.c
@@ -12,6 +12,8 @@
 
 void show_td(struct uhci_td * td)
 {
+	char *spid;
+
 	printk("%08x ", td->link);
 	printk("%se%d %s%s%s%s%s%s%s%s%s%sLength=%x ",
 		((td->status >> 29) & 1) ? "SPD " : "",
@@ -27,12 +29,27 @@
 		((td->status >> 18) & 1) ? "CRC/Timeo " : "",
 		((td->status >> 17) & 1) ? "BitStuff " : "",
 		td->status & 0x7ff);
-	printk("MaxLen=%x %sEndPt=%x Dev=%x, PID=%x ",
+	switch (td->info & 0xff) {
+	case 0x2d:
+		spid = "SETUP";
+		break;
+	case 0xe1:
+		spid = "OUT";
+		break;
+	case 0x69:
+		spid = "IN";
+		break;
+	default:
+		spid = "?";
+		break;
+	}
+	printk("MaxLen=%x %sEndPt=%x Dev=%x, PID=%x(%s) ",
 		td->info >> 21,
 		 ((td->info >> 19) & 1) ? "DT " : "",
 		 (td->info >> 15) & 15,
 		 (td->info >> 8) & 127,
-		 td->info & 0xff);
+		 (td->info & 0xff),
+		 spid);
 	printk("(buf=%08x)\n", td->buffer);
 }
 
@@ -130,9 +147,9 @@
 int is_skeleton_qh(struct uhci *uhci, struct uhci_qh *qh)
 {
 	int j;
-
+	struct uhci_device * root_hub=usb_to_uhci(uhci->bus->root_hub);
 	for (j = 0; j < UHCI_MAXQH; j++)
-		if (qh == uhci->root_hub->qh + j)
+		if (qh == root_hub->qh + j)
 			return 1;
 
 	return 0;
@@ -148,15 +165,16 @@
 {
 	int i;
 	struct uhci_qh *qh;
+	struct uhci_device * root_hub=usb_to_uhci(uhci->bus->root_hub);
 
 	for (i = 0; i < UHCI_MAXQH; ++i) {
 		printk("  %s:\n", qh_names[i]);
 #if 0
-		printk("  qh #%d, %p\n", i, virt_to_bus(uhci->root_hub->qh + i));
+		printk("  qh #%d, %p\n", i, virt_to_bus(root_hub->qh + i));
 		show_queue(uhci->root_hub->qh + i);
 #endif
 
-		qh = uhci_link_to_qh(uhci->root_hub->qh[i].link);
+		qh = uhci_link_to_qh(root_hub->qh[i].link);
 		for (; qh; qh = uhci_link_to_qh(qh->link)) {
 			if (is_skeleton_qh(uhci, qh))
 				break;
@@ -165,4 +183,3 @@
 		}
 	}
 }
-

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)