Windows: Switch to ALLOW_PARTIAL_READS pipe policy enabled by default
authorPete Batard <pete@akeo.ie>
Thu, 13 Sep 2012 23:10:57 +0000 (00:10 +0100)
committerPete Batard <pete@akeo.ie>
Thu, 13 Sep 2012 23:10:57 +0000 (00:10 +0100)
* This avoids an issue when libusbK is used for bulk transfers, which
  is most likely due to a libusbK bug
* See https://sourceforge.net/mailarchive/message.php?msg_id=29736015

libusb/os/windows_usb.c
libusb/version_nano.h

index 946c71f..fce4d43 100644 (file)
@@ -2639,11 +2639,13 @@ static int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle
                        IGNORE_SHORT_PACKETS, sizeof(UCHAR), &policy)) {
                        usbi_dbg("failed to disable IGNORE_SHORT_PACKETS for endpoint %02X", endpoint_address);
                }
+               policy = true;
+               /* ALLOW_PARTIAL_READS must be enabled due to likely libusbK bug. See:
+                  https://sourceforge.net/mailarchive/message.php?msg_id=29736015 */
                if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
                        ALLOW_PARTIAL_READS, sizeof(UCHAR), &policy)) {
-                       usbi_dbg("failed to disable ALLOW_PARTIAL_READS for endpoint %02X", endpoint_address);
+                       usbi_dbg("failed to enable ALLOW_PARTIAL_READS for endpoint %02X", endpoint_address);
                }
-               policy = true;
                if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
                        AUTO_CLEAR_STALL, sizeof(UCHAR), &policy)) {
                        usbi_dbg("failed to enable AUTO_CLEAR_STALL for endpoint %02X", endpoint_address);
index 56536af..d4b1772 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10562
+#define LIBUSB_NANO 10563