diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-09-03 12:04:49 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-09-11 07:43:00 +0200 |
commit | a508cc42e22a2ac3878b964290780f1d81ec65c1 (patch) | |
tree | 68d17ac6c0669ccdb039e032805586bd2d95bd73 /hw/usb | |
parent | 910c1e6b14e4abb188ff7ef584a629187479f82d (diff) | |
download | qemu-a508cc42e22a2ac3878b964290780f1d81ec65c1.zip qemu-a508cc42e22a2ac3878b964290780f1d81ec65c1.tar.gz qemu-a508cc42e22a2ac3878b964290780f1d81ec65c1.tar.bz2 |
usb-redir: Ensure our peer has the necessary caps when redirecting to XHCI
In order for redirection to work properly when redirecting to an emulated
XHCI controller, the usb-redir-host must support both
usb_redir_cap_ep_info_max_packet_size and usb_redir_cap_64bits_ids,
reject any devices redirected to an XHCI controller when these are not
supported.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r-- | hw/usb/redirect.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index c518201..7fb0fb3 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -824,6 +824,17 @@ static void usbredir_do_attach(void *opaque) { USBRedirDevice *dev = opaque; + /* In order to work properly with XHCI controllers we need these caps */ + if ((dev->dev.port->speedmask & USB_SPEED_MASK_SUPER) && !( + usbredirparser_peer_has_cap(dev->parser, + usb_redir_cap_ep_info_max_packet_size) && + 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); + return; + } + if (usb_device_attach(&dev->dev) != 0) { usbredir_reject_device(dev); } |