qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb-redir: Allow to attach USB 2.0 devices to 1.1 host controller
@ 2012-09-15 16:27 Jan Kiszka
  2012-09-17  9:08 ` Hans de Goede
  0 siblings, 1 reply; 17+ messages in thread
From: Jan Kiszka @ 2012-09-15 16:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann

From: Jan Kiszka <jan.kiszka@siemens.com>

This follows the logic of host-linux: If a 2.0 device has no ISO
endpoint and no interrupt endpoint with a packet size > 64, we can
attach it also to an 1.1 host controller. In case the redir server does
not report endpoint sizes, play safe and remove the 1.1 compatibility as
well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/usb/redirect.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 5301a69..bc36e53 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -1098,6 +1098,9 @@ static void usbredir_device_connect(void *priv,
     }
 
     dev->dev.speedmask = (1 << dev->dev.speed);
+    if (dev->dev.speed == USB_SPEED_HIGH) {
+        dev->dev.speedmask |= USB_SPEED_MASK_FULL;
+    }
     dev->device_info = *device_connect;
 
     if (usbredir_check_filter(dev)) {
@@ -1172,7 +1175,14 @@ static void usbredir_ep_info(void *priv,
         case usb_redir_type_invalid:
             break;
         case usb_redir_type_iso:
+            dev->dev.speedmask &= ~USB_SPEED_MASK_FULL;
+            /* Fall through */
         case usb_redir_type_interrupt:
+            if (!usbredirparser_peer_has_cap(dev->parser,
+                                     usb_redir_cap_ep_info_max_packet_size) ||
+                ep_info->max_packet_size[i] > 64) {
+                dev->dev.speedmask &= ~USB_SPEED_MASK_FULL;
+            }
             if (dev->endpoint[i].interval == 0) {
                 ERROR("Received 0 interval for isoc or irq endpoint\n");
                 usbredir_device_disconnect(dev);
-- 
1.7.3.4

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

end of thread, other threads:[~2012-10-09 10:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15 16:27 [Qemu-devel] [PATCH] usb-redir: Allow to attach USB 2.0 devices to 1.1 host controller Jan Kiszka
2012-09-17  9:08 ` Hans de Goede
2012-09-17  9:18   ` Jan Kiszka
2012-09-17 14:24     ` Hans de Goede
2012-09-17 16:22       ` Jan Kiszka
2012-09-18  9:41         ` Hans de Goede
2012-09-21 11:49           ` Jan Kiszka
2012-09-21 12:21             ` Hans de Goede
2012-09-21 12:25               ` Jan Kiszka
2012-09-18 21:18       ` Anthony Liguori
2012-09-19  9:20         ` Hans de Goede
2012-09-22  9:29   ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2012-10-08 17:36     ` Jan Kiszka
2012-10-08 23:05     ` [Qemu-devel] [v2] " Hans de Goede
2012-10-09  8:38       ` Hans de Goede
2012-10-09  8:40         ` Gerd Hoffmann
2012-10-09 10:05         ` 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).