summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2015-04-22 12:48:51 +0200
committerChris Dickens <christopher.a.dickens@gmail.com>2015-04-27 01:47:01 -0700
commit138d240858634fc14d379ac11f57020f9403185b (patch)
tree2f166957360b53693bdc06181f40109ed7b17ee5
parent76b3d340d0d1fc0cdfa423492961f305a7be7866 (diff)
downloadlibusb-138d240858634fc14d379ac11f57020f9403185b.tar.gz
core: generalize comment about setting configurations with claimed interfaces
The comment about libusb_set_configuration() failing when other programs or drivers have claimed interfaces is valid whether or not the desired configuration is _different_ from the current one, so generalize the statement. While at it also make it more explicit that in case of kernel drivers, those must be detached from _all_ interfaces before a configuration can be set. Finally, move the item as last as the new details also suggest a solution for when a lightweight reset is desired but kernel drivers have claimed other interfaces, like in the fingerprint reader example mentioned in the same section. Signed-off-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/core.c7
-rw-r--r--libusb/version_nano.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/libusb/core.c b/libusb/core.c
index e72afcb..be658b0 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -223,9 +223,6 @@ struct list_head active_contexts_list;
* -# If the device is already in the desired configuration, calling
* libusb_set_configuration() using the same configuration value will cause
* a lightweight device reset. This may not be desirable behaviour.
- * -# libusb will be unable to change configuration if the device is in
- * another configuration and other programs or drivers have claimed
- * interfaces under that configuration.
* -# In the case where the desired configuration is already active, libusb
* may not even be able to perform a lightweight device reset. For example,
* take my USB keyboard with fingerprint reader: I'm interested in driving
@@ -234,6 +231,10 @@ struct list_head active_contexts_list;
* Because the kernel has claimed an interface, it is not even possible to
* perform the lightweight device reset, so libusb_set_configuration() will
* fail. (Luckily the device in question only has a single configuration.)
+ * -# libusb will be unable to set a configuration if other programs or
+ * drivers have claimed interfaces. In particular, this means that kernel
+ * drivers must be detached from all the interfaces before
+ * libusb_set_configuration() may succeed.
*
* One solution to some of the above problems is to consider the currently
* active configuration. If the configuration we want is already active, then
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 17c3fd4..1de23d4 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10971
+#define LIBUSB_NANO 10972