diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-02-28 17:23:15 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-02-28 17:23:15 +0000 |
commit | f6b78c32dc9eddf17473d899afedfce320703608 (patch) | |
tree | 47ed63016899826a83fbbc10b56bb53c1b6d65cd /lib/libusb/libusb20.c | |
parent | 45caeec249c564cc0b81c13ced7f6a677a9216e9 (diff) | |
download | FreeBSD-src-f6b78c32dc9eddf17473d899afedfce320703608.zip FreeBSD-src-f6b78c32dc9eddf17473d899afedfce320703608.tar.gz |
- Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after: 14 days
Approved by: thompsa (mentor)
Diffstat (limited to 'lib/libusb/libusb20.c')
-rw-r--r-- | lib/libusb/libusb20.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index f8edfc3..bcaa1e4 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -156,14 +156,20 @@ libusb20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize, uint32_t MaxFrameCount, uint8_t ep_no) { uint32_t size; + uint8_t pre_scale; int error; - if (xfer->is_opened) { + if (xfer->is_opened) return (LIBUSB20_ERROR_BUSY); + if (MaxFrameCount & LIBUSB20_MAX_FRAME_PRE_SCALE) { + MaxFrameCount &= ~LIBUSB20_MAX_FRAME_PRE_SCALE; + pre_scale = 1; + } else { + pre_scale = 0; } - if (MaxFrameCount == 0) { + if (MaxFrameCount == 0) return (LIBUSB20_ERROR_INVALID_PARAM); - } + xfer->maxFrames = MaxFrameCount; size = MaxFrameCount * sizeof(xfer->pLength[0]); @@ -182,7 +188,7 @@ libusb20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize, memset(xfer->ppBuffer, 0, size); error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, - MaxFrameCount, ep_no); + MaxFrameCount, ep_no, pre_scale); if (error) { free(xfer->ppBuffer); |