libusb 1.0.20-rc3
[platform/upstream/libusb.git] / libusb / core.c
index e72afcb..5884dcf 100644 (file)
@@ -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
@@ -2022,8 +2023,8 @@ int API_EXPORTED libusb_init(libusb_context **context)
                usbi_dbg("created default context");
        }
 
-       usbi_dbg("libusb v%d.%d.%d.%d", libusb_version_internal.major, libusb_version_internal.minor,
-               libusb_version_internal.micro, libusb_version_internal.nano);
+       usbi_dbg("libusb v%u.%u.%u.%u%s", libusb_version_internal.major, libusb_version_internal.minor,
+               libusb_version_internal.micro, libusb_version_internal.nano, libusb_version_internal.rc);
 
        usbi_mutex_init(&ctx->usb_devs_lock, NULL);
        usbi_mutex_init(&ctx->open_devs_lock, NULL);
@@ -2308,8 +2309,8 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,
        usbi_gettimeofday(&now, NULL);
        if ((global_debug) && (!has_debug_header_been_displayed)) {
                has_debug_header_been_displayed = 1;
-               usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "[timestamp] [threadID] facility level [function call] <message>\n");
-               usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "--------------------------------------------------------------------------------\n");
+               usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "[timestamp] [threadID] facility level [function call] <message>" USBI_LOG_LINE_END);
+               usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "--------------------------------------------------------------------------------" USBI_LOG_LINE_END);
        }
        if (now.tv_usec < timestamp_origin.tv_usec) {
                now.tv_sec--;