Blame 0143-usb-redir-Notify-our-peer-when-we-reject-a-device-du.patch
|
Hans de Goede |
0fa3e5 |
From 89c9752afa77c6936ab9839d8fb1ce42147086b2 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
0fa3e5 |
From: Hans de Goede <hdegoede@redhat.com>
|
|
Hans de Goede |
0fa3e5 |
Date: Thu, 29 Mar 2012 16:41:23 +0200
|
|
Hans de Goede |
0fa3e5 |
Subject: [PATCH 143/146] usb-redir: Notify our peer when we reject a device
|
|
Hans de Goede |
0fa3e5 |
due to a speed mismatch
|
|
Hans de Goede |
0fa3e5 |
|
|
Hans de Goede |
0fa3e5 |
Also cleanup (reset) our device state when we reject a device due to a
|
|
Hans de Goede |
0fa3e5 |
speed mismatch.
|
|
Hans de Goede |
0fa3e5 |
|
|
Hans de Goede |
0fa3e5 |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Hans de Goede |
0fa3e5 |
---
|
|
Hans de Goede |
0fa3e5 |
usb-redir.c | 8 +++++++-
|
|
Hans de Goede |
0fa3e5 |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
Hans de Goede |
0fa3e5 |
|
|
Hans de Goede |
0fa3e5 |
diff --git a/usb-redir.c b/usb-redir.c
|
|
Hans de Goede |
0fa3e5 |
index f64443e..8ee3f07 100644
|
|
Hans de Goede |
0fa3e5 |
--- a/usb-redir.c
|
|
Hans de Goede |
0fa3e5 |
+++ b/usb-redir.c
|
|
Hans de Goede |
0fa3e5 |
@@ -845,7 +845,13 @@ static void usbredir_do_attach(void *opaque)
|
|
Hans de Goede |
0fa3e5 |
{
|
|
Hans de Goede |
0fa3e5 |
USBRedirDevice *dev = opaque;
|
|
Hans de Goede |
0fa3e5 |
|
|
Hans de Goede |
0fa3e5 |
- usb_device_attach(&dev->dev);
|
|
Hans de Goede |
0fa3e5 |
+ if (usb_device_attach(&dev->dev) != 0) {
|
|
Hans de Goede |
0fa3e5 |
+ usbredir_device_disconnect(dev);
|
|
Hans de Goede |
0fa3e5 |
+ if (usbredirparser_peer_has_cap(dev->parser, usb_redir_cap_filter)) {
|
|
Hans de Goede |
0fa3e5 |
+ usbredirparser_send_filter_reject(dev->parser);
|
|
Hans de Goede |
0fa3e5 |
+ usbredirparser_do_write(dev->parser);
|
|
Hans de Goede |
0fa3e5 |
+ }
|
|
Hans de Goede |
0fa3e5 |
+ }
|
|
Hans de Goede |
0fa3e5 |
}
|
|
Hans de Goede |
0fa3e5 |
|
|
Hans de Goede |
0fa3e5 |
/*
|
|
Hans de Goede |
0fa3e5 |
--
|
|
Hans de Goede |
0fa3e5 |
1.7.9.3
|
|
Hans de Goede |
0fa3e5 |
|