diff options
author | Uri Lublin <uril@redhat.com> | 2012-04-30 11:54:51 +0300 |
---|---|---|
committer | Uri Lublin <uril@redhat.com> | 2012-05-23 18:39:21 +0300 |
commit | 4ff1a981739e0711684dcf8b4f7221d55bbf23b7 (patch) | |
tree | 7cd3bba59312ed34eaac59b13e2dbfb8956081e6 /usbredirhost | |
parent | 99e9b47e2d0ed7c84c83c1a711f6a9b3ce96593e (diff) |
usbredirhost: claim/release: ignore NOT_SUPPORTED on attach|detach kernel driver
On Windows libusb_(attach|detach)_kernel_driver are not supported.
A libusb driver is already installed (device was successfully opened).
In that case just continue as if operation was successful.
Diffstat (limited to 'usbredirhost')
-rw-r--r-- | usbredirhost/usbredirhost.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c index 110e790..8b0c1ba 100644 --- a/usbredirhost/usbredirhost.c +++ b/usbredirhost/usbredirhost.c @@ -485,7 +485,8 @@ static int usbredirhost_claim(struct usbredirhost *host, int initial_claim) n = host->config->interface[i].altsetting[0].bInterfaceNumber; r = libusb_detach_kernel_driver(host->handle, n); - if (r < 0 && r != LIBUSB_ERROR_NOT_FOUND) { + if (r < 0 && r != LIBUSB_ERROR_NOT_FOUND + && r != LIBUSB_ERROR_NOT_SUPPORTED) { ERROR("could not detach driver from interface %d (configuration %d): %d", n, host->config->bConfigurationValue, r); return libusb_status_or_error_to_redir_status(host, r); @@ -543,6 +544,7 @@ static void usbredirhost_release(struct usbredirhost *host, int attach_drivers) r = libusb_attach_kernel_driver(host->handle, n); if (r < 0 && r != LIBUSB_ERROR_NOT_FOUND /* No driver */ && r != LIBUSB_ERROR_NO_DEVICE /* Device unplugged */ + && r != LIBUSB_ERROR_NOT_SUPPORTED /* Not supported */ && r != LIBUSB_ERROR_BUSY /* driver rebound already */) { ERROR("could not re-attach driver to interface %d (configuration %d): %d", n, host->config->bConfigurationValue, r); |