aboutsummaryrefslogtreecommitdiff
path: root/usb-redir.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-02-26 16:14:43 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-27 13:37:36 +0100
commit52234bc00d5cf13cf96b3d632a4e0aa34cec08be (patch)
tree9a3f908f70496953ae9da32fb4b58f2f4d41f45f /usb-redir.c
parent01cd4e98dc6eed96519f44f03de893364e0601ab (diff)
downloadqemu-52234bc00d5cf13cf96b3d632a4e0aa34cec08be.zip
qemu-52234bc00d5cf13cf96b3d632a4e0aa34cec08be.tar.gz
qemu-52234bc00d5cf13cf96b3d632a4e0aa34cec08be.tar.bz2
usb-redir: Fix printing of device version
The device version is in bcd format, which requires some special handling to print. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'usb-redir.c')
-rw-r--r--usb-redir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usb-redir.c b/usb-redir.c
index a59b347..18204be 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -1049,8 +1049,10 @@ static void usbredir_device_connect(void *priv,
usb_redir_cap_connect_device_version)) {
INFO("attaching %s device %04x:%04x version %d.%d class %02x\n",
speed, device_connect->vendor_id, device_connect->product_id,
- device_connect->device_version_bcd >> 8,
- device_connect->device_version_bcd & 0xff,
+ ((device_connect->device_version_bcd & 0xf000) >> 12) * 10 +
+ ((device_connect->device_version_bcd & 0x0f00) >> 8),
+ ((device_connect->device_version_bcd & 0x00f0) >> 4) * 10 +
+ ((device_connect->device_version_bcd & 0x000f) >> 0),
device_connect->device_class);
} else {
INFO("attaching %s device %04x:%04x class %02x\n", speed,