summaryrefslogtreecommitdiff
path: root/libusb/libusbi.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-06-13 21:21:14 +0200
committerHans de Goede <hdegoede@redhat.com>2013-06-19 11:04:14 +0200
commitfc51f19341af70508b94c06ff763842b396ea72e (patch)
tree0cb2d75131893603a3e4c0c456f4cefe060599ca /libusb/libusbi.h
parent6b3931526db981e3a298a226e5d0b4e20c04913d (diff)
downloadlibusb-fc51f19341af70508b94c06ff763842b396ea72e.tar.gz
libusb: Add auto-detach-kernel-driver functionality
Add auto-detach-kernel-driver functionality, and a libusb_set_auto_detach_kernel_driver() function. Note that I went with a libusb_set_auto_detach_kernel_driver() function, rather then with a libusb_enable_auto_detach_kernel_driver(), so that apps can also disable it again. This is necessary to handle 2 corner cases: 1) When an app wants to do a libusb_set_configuration after claiming 1 or more interfaces, it needs to first release the interface(s), and in this case libusb_release_interface() should *not* (re-)attach the kernel driver 2) Some usb classes use multiple interfaces for one function, ie usb-audio devices do this. In this case attaching the driver will fail until all interfaces are released, so the app should first release all interfaces, and only then (re-)attach the kernel driver. auto-detach-kernel-driver functionality is still useful for these apps, since doing libusb_detach_kernel_driver() followed by libusb_claim_interface() in 2 separate calls is inherently racy, but they need to be able to disable the auto-detach functionality before releasing interfaces to be able to properly handle the 2 described corner cases. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'libusb/libusbi.h')
-rw-r--r--libusb/libusbi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index d5e5c59..c9b402d 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -317,6 +317,7 @@ struct libusb_device_handle {
struct list_head list;
struct libusb_device *dev;
+ int auto_detach_kernel_driver;
unsigned char os_priv
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
[] /* valid C99 code */