diff options
author | Daniel Drake <dsd@gentoo.org> | 2009-06-28 19:49:10 +0100 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2009-06-28 19:49:10 +0100 |
commit | 0334ee642b47dfe1ca9db64b22e7702ea14b3f09 (patch) | |
tree | f7f8f8450575efcd05537e5e0ef47720178b6acd /libusb/io.c | |
parent | 615f18e64e96ae4ecc8e43d0de00933059a5209a (diff) | |
download | libusb-0334ee642b47dfe1ca9db64b22e7702ea14b3f09.tar.gz |
Add libusb_get_max_iso_packet_size()
As pointed out by Dennis Muhlestein, libusb_get_max_packet_size()
doesn't really do what the documentation might suggest because it
does not consider the number of transaction opportunities per
microframe.
Add a new function to do what is useful for isochronous I/O.
Diffstat (limited to 'libusb/io.c')
-rw-r--r-- | libusb/io.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libusb/io.c b/libusb/io.c index f0e3c33..b63c000 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -410,11 +410,16 @@ if (r == 0 && actual_length == sizeof(data)) { * Next, populate the length field for the first num_iso_packets entries in * the \ref libusb_transfer::iso_packet_desc "iso_packet_desc" array. Section * 5.6.3 of the USB2 specifications describe how the maximum isochronous - * packet length is determined by wMaxPacketSize field in the endpoint - * descriptor. Two functions can help you here: - * - * - libusb_get_max_packet_size() is an easy way to determine the max - * packet size for an endpoint. + * packet length is determined by the wMaxPacketSize field in the endpoint + * descriptor. + * Two functions can help you here: + * + * - libusb_get_max_iso_packet_size() is an easy way to determine the max + * packet size for an isochronous endpoint. Note that the maximum packet + * size is actually the maximum number of bytes that can be transmitted in + * a single microframe, therefore this function multiplies the maximum number + * of bytes per transaction by the number of transaction opportunities per + * microframe. * - libusb_set_iso_packet_lengths() assigns the same length to all packets * within a transfer, which is usually what you want. * |