darwin: Fix invalid GetPipePropertiesV3 argument
authorIdo Yariv <ido@wizery.com>
Wed, 17 Jun 2020 03:22:31 +0000 (23:22 -0400)
committerNathan Hjelm <hjelmn@google.com>
Wed, 17 Jun 2020 04:58:46 +0000 (22:58 -0600)
GetPipePropertiesV3 seems to require that the bVersion field of the
properties argument be set before calling it:
"Version of the structure. Currently kUSBEndpointPropertiesVersion3.
Need to set this when using this structure"

Not doing so results in an invalid argument error.

Closes #744

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/os/darwin_usb.c
libusb/version_nano.h

index b1e45148f51d2404e580db8ab9becf9cad4ac2f6..a64d67d6cd8ca4491c7c9ff18a46a4d7e5cc774b 100644 (file)
@@ -1775,7 +1775,7 @@ static int submit_bulk_transfer(struct usbi_transfer *itransfer) {
 
   struct darwin_interface *cInterface;
 #if InterfaceVersion >= 550
-  IOUSBEndpointProperties pipeProperties;
+  IOUSBEndpointProperties pipeProperties = {.bVersion = kUSBEndpointPropertiesVersion3};
 #else
   /* None of the values below are used in libusb for bulk transfers */
   uint8_t                 direction, number, interval;
index b8305e30e0297e3979e40cdf76533087114aa5ce..f1ac20fa70dde35f792b2e9efe40992ce5c24c99 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11521
+#define LIBUSB_NANO 11522