summaryrefslogtreecommitdiff
path: root/libusb/io.c
diff options
context:
space:
mode:
authorNathan Hjelm <hjelmn@google.com>2022-04-06 10:24:14 -0600
committerTormod Volden <debian.tormod@gmail.com>2023-01-06 23:33:29 +0100
commit65e4a70e0db5dc85cdbce01be276329580e0d986 (patch)
treeb984a50854ac0b2a14a9fe21f40af648a120d20a /libusb/io.c
parent1c6e76a483238ba9f0511c77b02ea7607c30d897 (diff)
downloadlibusb-65e4a70e0db5dc85cdbce01be276329580e0d986.tar.gz
darwin: Do not clear device data toggle on macOS 10.5 or newer
Historically Mac OS X always cleared the data toggle on the host side. For consistency, libusb has been calling ClearPipeStallBothEnds to also clear the device side toggle. Newer versions of the IOUSBLib do not clear the host side toggle so there is no need to make this call. Additionally, some buggy devices may fail to correctly implement clearing the data toggle. Signed-off-by: Nathan Hjelm <hjelmn@google.com> [Tormod: Return result from AbortPipe] Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Diffstat (limited to 'libusb/io.c')
-rw-r--r--libusb/io.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libusb/io.c b/libusb/io.c
index 203fd47..2f38d67 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -3,8 +3,8 @@
* I/O functions for libusb
* Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
* Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- * Copyright © 2019 Nathan Hjelm <hjelmn@cs.umm.edu>
- * Copyright © 2019 Google LLC. All rights reserved.
+ * Copyright © 2019-2022 Nathan Hjelm <hjelmn@cs.unm.edu>
+ * Copyright © 2019-2022 Google LLC. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -311,7 +311,11 @@ if (r == 0 && actual_length == sizeof(data)) {
* libusb_cancel_transfer() is asynchronous/non-blocking in itself. When the
* cancellation actually completes, the transfer's callback function will
* be invoked, and the callback function should check the transfer status to
- * determine that it was cancelled.
+ * determine that it was cancelled. On macOS and iOS it is not possible to
+ * cancel a single transfer. In this case cancelling one tranfer on an endpoint
+ * will cause all transfers on that endpoint to be cancelled. In some cases
+ * the call may cause the endpoint to stall. A call to \ref libusb_clear_halt
+ * may be needed.
*
* Freeing the transfer after it has been cancelled but before cancellation
* has completed will result in undefined behaviour.