windows: Fix WinUSB isochronous transfer regression
authorKeith Ahluwalia <kahluwalia999@gmail.com>
Mon, 21 Mar 2022 10:51:55 +0000 (10:51 +0000)
committerTormod Volden <debian.tormod@gmail.com>
Mon, 21 Mar 2022 22:00:08 +0000 (23:00 +0100)
Put back missing CHECK_WINUSBX_AVAILABLE macro.

The subapi is generally set in the backend functions themselves, using
the macro CHECK_WINUSBX_AVAILABLE. However, this macro was (likely
inadvertently) removed from winusbx_copy_transfer_data() in commit
9c28ad2 causing the subapi in this function to always be SUB_API_NOTSET.
This results in the error:

  libusb: debug [winusbx_copy_transfer_data] unsupported API call for 'copy_transfer_data' (unrecognized device driver)

https://github.com/libusb/libusb/issues/747#issuecomment-649619615
References #749
Closes #1095

libusb/os/windows_winusb.c
libusb/version_nano.h

index 1303707..fed7d0d 100644 (file)
@@ -3229,6 +3229,9 @@ static enum libusb_transfer_status winusbx_copy_transfer_data(int sub_api, struc
        int i;
 
        if (transfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS) {
+               struct winusb_device_priv *priv = usbi_get_device_priv(transfer->dev_handle->dev);
+               CHECK_WINUSBX_AVAILABLE(sub_api);
+
                // for isochronous, need to copy the individual iso packet actual_lengths and statuses
                if ((sub_api == SUB_API_LIBUSBK) || (sub_api == SUB_API_LIBUSB0)) {
                        // iso only supported on libusbk-based backends for now
index 26ed7e7..78fef60 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11712
+#define LIBUSB_NANO 11713