case kIOReturnExclusiveAccess:
return "another process has device opened for exclusive access";
case kIOUSBPipeStalled:
+#if defined(kUSBHostReturnPipeStalled)
+ case kUSBHostReturnPipeStalled:
+#endif
return "pipe is stalled";
case kIOReturnError:
return "could not establish a connection to the Darwin kernel";
case kIOReturnExclusiveAccess:
return LIBUSB_ERROR_ACCESS;
case kIOUSBPipeStalled:
+#if defined(kUSBHostReturnPipeStalled)
+ case kUSBHostReturnPipeStalled:
+#endif
return LIBUSB_ERROR_PIPE;
case kIOReturnBadArgument:
return LIBUSB_ERROR_INVALID_PARAM;
else
usbi_warn (HANDLE_CTX (dev_handle), "SetAlternateInterface: %s", darwin_error_str(kresult));
- if (kresult != kIOUSBPipeStalled)
+ ret = darwin_to_libusb(kresult);
+ if (ret != LIBUSB_ERROR_PIPE) {
return darwin_to_libusb (kresult);
+ }
/* If a device only supports a default setting for the specified interface, then a STALL
(kIOUSBPipeStalled) may be returned. Ref: USB 2.0 specs 9.4.10.