Juergen Keil
2007-Mar-12  11:26 UTC
[qemu-discuss] [PATCH] fix usb hid and mass-storage protocol revision
Minor nit:
When booting a Solaris x86 kernel with verbose kernel messages enabled
inside qemu, with an usb hid or usb mass-storage device, then the Solaris 
kernel reports these usb devices as implementing "USB 0.10" protocol.
The comment in the code tells me these device implement v1.0 protocol.
The 16-bit bcdUSB word word in the device descriptor has the protocol
revision swapped and uses a slightly wrong value.  Probably a typo after
copying the descriptor data from the hw/usb-hub.c file, which uses
v1.1 USB protocol.
The attached patch fixes the usb hid and mass-storage protocol revision
to report "USB 1.0" protocol.
-------------- next part --------------
diff -ru /tmp/qemu-cvs/hw/usb-hid.c qemu-cvs/hw/usb-hid.c
--- /tmp/qemu-cvs/hw/usb-hid.c	2006-08-29 20:11:47.000000000 +0200
+++ qemu-cvs/hw/usb-hid.c	2007-01-28 12:58:21.779608666 +0100
@@ -45,7 +45,7 @@
 static const uint8_t qemu_mouse_dev_descriptor[] = {
 	0x12,       /*  u8 bLength; */
 	0x01,       /*  u8 bDescriptorType; Device */
-	0x10, 0x00, /*  u16 bcdUSB; v1.0 */
+	0x00, 0x01, /*  u16 bcdUSB; v1.0 */
 
 	0x00,	    /*  u8  bDeviceClass; */
 	0x00,	    /*  u8  bDeviceSubClass; */
diff -ru /tmp/qemu-cvs/hw/usb-msd.c qemu-cvs/hw/usb-msd.c
--- /tmp/qemu-cvs/hw/usb-msd.c	2006-08-29 20:11:47.000000000 +0200
+++ qemu-cvs/hw/usb-msd.c	2007-01-28 12:58:06.636790927 +0100
@@ -66,7 +66,7 @@
 static const uint8_t qemu_msd_dev_descriptor[] = {
 	0x12,       /*  u8 bLength; */
 	0x01,       /*  u8 bDescriptorType; Device */
-	0x10, 0x00, /*  u16 bcdUSB; v1.0 */
+	0x00, 0x01, /*  u16 bcdUSB; v1.0 */
 
 	0x00,	    /*  u8  bDeviceClass; */
 	0x00,	    /*  u8  bDeviceSubClass; */
