From cd87b6b1f1a94e85fcd7beb165d182e3fd740a57 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 23 May 2012 00:10:19 +0100 Subject: [PATCH] Windows: Reduce severity of initial conf desc readout failures * Failure to read the config descriptor through regular API calls can occur for some hubs (eg. 05E3:0608) and is of no major consequence. * Later failures still reported with error severity as they may hide something more dramatic * Issue reported by Jerry from NovaDSP --- libusb/os/windows_usb.c | 7 ++++--- libusb/version_nano.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index f29f84c2..46f07308 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -901,15 +901,16 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle cd_buf_short.req.SetupPacket.wIndex = i; cd_buf_short.req.SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST)); - // Dummy call to get the required data size + // Dummy call to get the required data size. Initial failures are reported as info rather + // than error as they can occur for non-penalizing situations, such as with some hubs. if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, &cd_buf_short, size, &cd_buf_short, size, &ret_size, NULL)) { - usbi_err(ctx, "could not access configuration descriptor (dummy) for '%s': %s", device_id, windows_error_str(0)); + usbi_info(ctx, "could not access configuration descriptor (dummy) for '%s': %s", device_id, windows_error_str(0)); LOOP_BREAK(LIBUSB_ERROR_IO); } if ((ret_size != size) || (cd_buf_short.data.wTotalLength < sizeof(USB_CONFIGURATION_DESCRIPTOR))) { - usbi_err(ctx, "unexpected configuration descriptor size (dummy) for '%s'.", device_id); + usbi_info(ctx, "unexpected configuration descriptor size (dummy) for '%s'.", device_id); LOOP_BREAK(LIBUSB_ERROR_IO); } diff --git a/libusb/version_nano.h b/libusb/version_nano.h index cd14787c..5594f407 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10505 +#define LIBUSB_NANO 10506