qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/6] usb-redir: Fix printing of device version
@ 2012-02-26 15:14 Hans de Goede
  2012-02-26 15:14 ` [Qemu-devel] [PATCH 2/6] usb-redir: Always clear device state on filter reject Hans de Goede
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Hans de Goede @ 2012-02-26 15:14 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel

The device version is in bcd format, which requires some special handling to
print.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 usb-redir.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/usb-redir.c b/usb-redir.c
index 85f40d6..9b804e9 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -1076,8 +1076,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,
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-27 12:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-26 15:14 [Qemu-devel] [PATCH 1/6] usb-redir: Fix printing of device version Hans de Goede
2012-02-26 15:14 ` [Qemu-devel] [PATCH 2/6] usb-redir: Always clear device state on filter reject Hans de Goede
2012-02-26 15:14 ` [Qemu-devel] [PATCH 3/6] usb-redir: Let the usb-host know about our device filtering Hans de Goede
2012-02-26 15:14 ` [Qemu-devel] [PATCH 4/6] usb-redir: Limit return values returned by iso packets Hans de Goede
2012-02-26 15:14 ` [Qemu-devel] [PATCH 5/6] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint Hans de Goede
2012-02-27 11:45   ` Gerd Hoffmann
2012-02-27 12:15     ` Gerd Hoffmann
2012-02-26 15:14 ` [Qemu-devel] [PATCH 6/6] usb-ehci: Handle ISO packets failing with an error other then NAK Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).