* Makes libusb_cancel_transfer not log an error when the cancel fails
with LIBUSB_ERROR_NO_DEVICE, so that apps can properly clean things
up on device disconnect without flooding the console with these errors.
* Also, some devices (Cypress FX) may switch VID:PID on the fly during
firmware upload => reduce severity of the Windows message when that happens.
usbi_mutex_lock(&itransfer->lock);
r = usbi_backend->cancel_transfer(itransfer);
if (r < 0) {
- if (r != LIBUSB_ERROR_NOT_FOUND)
+ if (r != LIBUSB_ERROR_NOT_FOUND &&
+ r != LIBUSB_ERROR_NO_DEVICE)
usbi_err(TRANSFER_CTX(transfer),
"cancel transfer failed error %d", r);
else
} else {
if (!WinUSBX[sub_api].ControlTransfer(wfd.handle, *setup, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, size, NULL, wfd.overlapped)) {
if(GetLastError() != ERROR_IO_PENDING) {
- usbi_err(ctx, "ControlTransfer failed: %s", windows_error_str(0));
+ usbi_warn(ctx, "ControlTransfer failed: %s", windows_error_str(0));
usbi_free_fd(wfd.fd);
return LIBUSB_ERROR_IO;
}
-#define LIBUSB_NANO 10560
+#define LIBUSB_NANO 10561