From: Vlad Ivanov Date: Tue, 9 Feb 2016 08:11:31 +0000 (+0300) Subject: sigrok-cross-mingw: add libusb RAW_IO patch X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=38599f9c9116df8bd0f3012c003b5d92af705089;p=sigrok-util.git sigrok-cross-mingw: add libusb RAW_IO patch On Windows, RAW_IO WinUsb pipe policy should be enabled by default: https://sourceforge.net/p/libusb/mailman/message/34810484/ This fixes bug #573. Signed-off-by: Vlad Ivanov --- diff --git a/cross-compile/mingw/libusb_raw_io.patch b/cross-compile/mingw/libusb_raw_io.patch new file mode 100644 index 0000000..6cdeb0c --- /dev/null +++ b/cross-compile/mingw/libusb_raw_io.patch @@ -0,0 +1,31 @@ +From d4f7a49d77bd8f4ac871a999fc9ec898cb22b8c3 Mon Sep 17 00:00:00 2001 +From: Vlad Ivanov +Date: Tue, 9 Feb 2016 10:35:23 +0300 +Subject: [PATCH] windows_usb: enable RAW_IO policy by default + +libusb should set RAW_IO policy unconditionally because it +implements the buffer management itself. + +Signed-off-by: Vlad Ivanov +--- + libusb/os/windows_usb.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c +index 6640ad5..12fdab0 100644 +--- a/libusb/os/windows_usb.c ++++ b/libusb/os/windows_usb.c +@@ -2890,6 +2890,10 @@ static int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle + AUTO_CLEAR_STALL, sizeof(UCHAR), &policy)) { + usbi_dbg("failed to enable AUTO_CLEAR_STALL for endpoint %02X", endpoint_address); + } ++ if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address, ++ RAW_IO, sizeof(UCHAR), &policy)) { ++ usbi_dbg("failed to enable RAW_IO for endpoint %02X", endpoint_address); ++ } + } + + return LIBUSB_SUCCESS; +-- +2.5.0 + diff --git a/cross-compile/mingw/sigrok-cross-mingw b/cross-compile/mingw/sigrok-cross-mingw index 8b30158..b324429 100755 --- a/cross-compile/mingw/sigrok-cross-mingw +++ b/cross-compile/mingw/sigrok-cross-mingw @@ -117,6 +117,7 @@ $WGET http://zadig.akeo.ie/downloads/zadig_xp.exe -O $PREFIX/zadig_xp.exe # libusb $GIT_CLONE git://github.com/dickens/libusb -b event-abstraction-v4 cd libusb +patch -p1 < ../../libusb_raw_io.patch ./bootstrap.sh ./configure $C $L make -j1 $V