patch-2.3.11 linux/drivers/usb/usb-debug.c

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

diff -u --recursive --new-file v2.3.10/linux/drivers/usb/usb-debug.c linux/drivers/usb/usb-debug.c
@@ -53,12 +53,21 @@
  */
 void usb_show_device_descriptor(struct usb_device_descriptor *desc)
 {
-	printk("  USB version %x.%02x\n", desc->bcdUSB >> 8, desc->bcdUSB & 0xff);
-	printk("  Vendor:  %04x\n", desc->idVendor);
-	printk("  Product: %04x\n", desc->idProduct);
-	printk("  Configurations: %d\n", desc->bNumConfigurations);
+	printk("  Length              = %2d%s\n", desc->bLength,
+		desc->bLength == USB_DT_DEVICE_SIZE ? "" : " (!!!)");
+	printk("  DescriptorType      = %02x\n", desc->bDescriptorType);
+
+	printk("  USB version         = %x.%02x\n",
+		desc->bcdUSB >> 8, desc->bcdUSB & 0xff);
+	printk("  Vendor:Product      = %04x:%04x\n",
+		desc->idVendor, desc->idProduct);
+	printk("  MaxPacketSize0      = %d\n", desc->bMaxPacketSize0);
+	printk("  NumConfigurations   = %d\n", desc->bNumConfigurations);
+	printk("  Device version      = %x.%02x\n",
+		desc->bcdDevice >> 8, desc->bcdDevice & 0xff);
 
-	printk("  Device Class: %d\n", desc->bDeviceClass);
+	printk("  Device Class:SubClass:Protocol = %02x:%02x:%02x\n",
+		desc->bDeviceClass, desc->bDeviceSubClass, desc->bDeviceProtocol);
 	switch (desc->bDeviceClass) {
 	case 0:
 		printk("    Per-interface classes\n");
@@ -78,7 +87,7 @@
 {
 	printk("Configuration:\n");
 	printk("  bLength             = %4d%s\n", desc->bLength,
-		desc->bLength == 9 ? "" : " (!!!)");
+		desc->bLength == USB_DT_CONFIG_SIZE ? "" : " (!!!)");
 	printk("  bDescriptorType     =   %02x\n", desc->bDescriptorType);
 	printk("  wTotalLength        = %04x\n", desc->wTotalLength);
 	printk("  bNumInterfaces      =   %02x\n", desc->bNumInterfaces);
@@ -92,14 +101,13 @@
 {
 	printk("  Interface:\n");
 	printk("    bLength             = %4d%s\n", desc->bLength,
-		desc->bLength == 9 ? "" : " (!!!)");
+		desc->bLength == USB_DT_INTERFACE_SIZE ? "" : " (!!!)");
 	printk("    bDescriptorType     =   %02x\n", desc->bDescriptorType);
 	printk("    bInterfaceNumber    =   %02x\n", desc->bInterfaceNumber);
 	printk("    bAlternateSetting   =   %02x\n", desc->bAlternateSetting);
 	printk("    bNumEndpoints       =   %02x\n", desc->bNumEndpoints);
-	printk("    bInterfaceClass     =   %02x\n", desc->bInterfaceClass);
-	printk("    bInterfaceSubClass  =   %02x\n", desc->bInterfaceSubClass);
-	printk("    bInterfaceProtocol  =   %02x\n", desc->bInterfaceProtocol);
+	printk("    bInterface Class:SubClass:Protocol =   %02x:%02x:%02x\n",
+		desc->bInterfaceClass, desc->bInterfaceSubClass, desc->bInterfaceProtocol);
 	printk("    iInterface          =   %02x\n", desc->iInterface);
 }
 
@@ -108,7 +116,7 @@
 	char *EndpointType[4] = { "Control", "Isochronous", "Bulk", "Interrupt" };
 	printk("    Endpoint:\n");
 	printk("      bLength             = %4d%s\n", desc->bLength,
-		desc->bLength == 7 ? "" : " (!!!)");
+		desc->bLength == USB_DT_ENDPOINT_SIZE ? "" : " (!!!)");
 	printk("      bDescriptorType     =   %02x\n", desc->bDescriptorType);
 	printk("      bEndpointAddress    =   %02x (%s)\n", desc->bEndpointAddress,
 		(desc->bEndpointAddress & 0x80) ? "in" : "out");
@@ -133,6 +141,8 @@
 
 void usb_show_string(struct usb_device* dev, char *id, int index)
 {
-	if (index <= dev->maxstring && dev->stringindex && dev->stringindex[index])
-		printk("%s: %s\n", id, dev->stringindex[index]);
+	char *p = usb_string(dev, index);
+
+	if (p != 0)
+		printk(KERN_INFO "%s: %s\n", id, p);
 }

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