Blame 0325-usb-redir-Set-ep-max_packet_size-if-available.patch

c8dfc6
From 7c936f9e6b07f4468f49886b4e785e4120a08e11 Mon Sep 17 00:00:00 2001
c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Date: Mon, 3 Sep 2012 11:49:07 +0200
c8dfc6
Subject: [PATCH 325/366] usb-redir: Set ep max_packet_size if available
c8dfc6
c8dfc6
This is needed for usb-redir to work properly with the xhci emulation.
c8dfc6
c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
c8dfc6
---
c8dfc6
 hw/usb/redirect.c | 5 +++++
c8dfc6
 1 file changed, 5 insertions(+)
c8dfc6
c8dfc6
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
c8dfc6
index 789ef51..ac8bfd2 100644
c8dfc6
--- a/hw/usb/redirect.c
c8dfc6
+++ b/hw/usb/redirect.c
c8dfc6
@@ -815,6 +815,7 @@ static void usbredir_chardev_open(USBRedirDevice *dev)
c8dfc6
 
c8dfc6
     usbredirparser_caps_set_cap(caps, usb_redir_cap_connect_device_version);
c8dfc6
     usbredirparser_caps_set_cap(caps, usb_redir_cap_filter);
c8dfc6
+    usbredirparser_caps_set_cap(caps, usb_redir_cap_ep_info_max_packet_size);
c8dfc6
     usbredirparser_caps_set_cap(caps, usb_redir_cap_64bits_ids);
c8dfc6
     usbredirparser_init(dev->parser, version, caps, USB_REDIR_CAPS_SIZE, 0);
c8dfc6
     usbredirparser_do_write(dev->parser);
c8dfc6
@@ -1207,6 +1208,10 @@ static void usbredir_ep_info(void *priv,
c8dfc6
                             i & 0x0f);
c8dfc6
         usb_ep->type = dev->endpoint[i].type;
c8dfc6
         usb_ep->ifnum = dev->endpoint[i].interface;
c8dfc6
+        if (usbredirparser_peer_has_cap(dev->parser,
c8dfc6
+                                     usb_redir_cap_ep_info_max_packet_size)) {
c8dfc6
+            usb_ep->max_packet_size = ep_info->max_packet_size[i];
c8dfc6
+        }
c8dfc6
     }
c8dfc6
 }
c8dfc6
 
c8dfc6
-- 
c8dfc6
1.7.12
c8dfc6