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
This commit is contained in:
Pete Batard 2012-05-23 00:10:19 +01:00
parent 1cc9c6087d
commit cd87b6b1f1
2 changed files with 5 additions and 4 deletions

View file

@ -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.wIndex = i;
cd_buf_short.req.SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST)); 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, if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, &cd_buf_short, size,
&cd_buf_short, size, &ret_size, NULL)) { &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); LOOP_BREAK(LIBUSB_ERROR_IO);
} }
if ((ret_size != size) || (cd_buf_short.data.wTotalLength < sizeof(USB_CONFIGURATION_DESCRIPTOR))) { 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); LOOP_BREAK(LIBUSB_ERROR_IO);
} }

View file

@ -1 +1 @@
#define LIBUSB_NANO 10505 #define LIBUSB_NANO 10506