Patchwork [23/32] usbredir: Verify we have 32 bits bulk length cap when redirecting to xhci

login
register
mail settings
Submitter Gerd Hoffmann
Date Jan. 8, 2013, 1:14 p.m.
Message ID <1357650894-16982-24-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/210394/
State New
Headers show

Comments

Gerd Hoffmann - Jan. 8, 2013, 1:14 p.m.
From: Hans de Goede <hdegoede@redhat.com>

The xhci-hcd may submit bulk transfers > 65535 bytes even when not using
bulk-in pipeling, so usbredir can only be used in combination with an xhci
hcd if the client has the 32 bits bulk length capability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/redirect.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 855c765..566737d 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -980,6 +980,8 @@  static void usbredir_do_attach(void *opaque)
         usbredirparser_peer_has_cap(dev->parser,
                                     usb_redir_cap_ep_info_max_packet_size) &&
         usbredirparser_peer_has_cap(dev->parser,
+                                    usb_redir_cap_32bits_bulk_length) &&
+        usbredirparser_peer_has_cap(dev->parser,
                                     usb_redir_cap_64bits_ids))) {
         ERROR("usb-redir-host lacks capabilities needed for use with XHCI\n");
         usbredir_reject_device(dev);