usb-redir: Notify our peer when we reject a device due to a speed mismatch

Also cleanup (reset) our device state when we reject a device due to a
speed mismatch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2012-03-30 09:53:54 +02:00 committed by Gerd Hoffmann
parent 8e24283b26
commit 714f9db06c
1 changed files with 7 additions and 1 deletions

View File

@ -836,7 +836,13 @@ static void usbredir_do_attach(void *opaque)
{
USBRedirDevice *dev = opaque;
usb_device_attach(&dev->dev);
if (usb_device_attach(&dev->dev) != 0) {
usbredir_device_disconnect(dev);
if (usbredirparser_peer_has_cap(dev->parser, usb_redir_cap_filter)) {
usbredirparser_send_filter_reject(dev->parser);
usbredirparser_do_write(dev->parser);
}
}
}
/*