Skip to content

Commit

Permalink
usb-redir: Ensure our peer has the necessary caps when redirecting to…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
jwrdegoede authored and kraxel committed Sep 11, 2012
1 parent 910c1e6 commit a508cc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hw/usb/redirect.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit a508cc4

Please sign in to comment.