summaryrefslogtreecommitdiff
path: root/libusb/core.c
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2012-02-22 14:21:54 +0100
committerPeter Stuge <peter@stuge.se>2012-02-22 14:21:54 +0100
commite3d0a4cb9e2f9872c9fdbb22d7ded169e111fc8f (patch)
tree9e35f48029780e2d8b84bf12ba3e69a785d56286 /libusb/core.c
parent7e0c747cc5ed0a31f38dff5eb5f03d4043b05ada (diff)
downloadlibusbx-e3d0a4cb9e2f9872c9fdbb22d7ded169e111fc8f.tar.gz
Add LIBUSB_TRANSFER_ADD_ZERO_PACKET flag to indicate need for ZLP
Some protocols which use USB require an extra zero length data packet to signal end-of-transfer on bulk endpoints, if the last data packet is exactly wMaxPacketSize bytes long. This flag allows applications to inform libusb about this requirement, so that libusb can handle the issue transparently. At the moment the new flag is only supported on Linux, and submitting a transfer with the flag set returns an error at submit time on other systems. Hopefully implementations will soon follow for other systems. References #6.
Diffstat (limited to 'libusb/core.c')
-rw-r--r--libusb/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 8b3927a..142c6d4 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -285,6 +285,14 @@ if (cfg != desired)
* kernel where boundaries occur between logical libusb-level transfers. When
* a short transfer (or other error) occurs, the kernel will cancel all the
* subtransfers until the boundary without allowing those transfers to start.
+ *
+ * \section zlp Zero length packets
+ *
+ * - libusb is able to send a packet of zero length to an endpoint simply by
+ * submitting a transfer of zero length. On Linux, this did not work with
+ * libusb versions prior to 1.0.3 and kernel versions prior to 2.6.31.
+ * - The \ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET
+ * "LIBUSB_TRANSFER_ADD_ZERO_PACKET" flag is currently only supported on Linux.
*/
/**