Skip to contentSkip to conversation

fix usb hid and mass-storage protocol revision

PATCH New Juergen Keil 1 participant 1 message Mar 12, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

hw/usb-hid.c renamed from tmp/qemu-cvs/hw/usb-hid.c +1 -1
diff -ru /tmp/qemu-cvs/hw/usb-hid.c qemu-cvs/hw/usb-hid.c
@@ -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; */
hw/usb-msd.c renamed from tmp/qemu-cvs/hw/usb-msd.c +1 -1
diff -ru /tmp/qemu-cvs/hw/usb-msd.c qemu-cvs/hw/usb-msd.c
@@ -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; */