aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/libusb20.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2011-02-28 17:23:15 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2011-02-28 17:23:15 +0000
commit1c49736857cfe0b562e2f1e100ab2307e882a9e6 (patch)
tree47ed63016899826a83fbbc10b56bb53c1b6d65cd /lib/libusb/libusb20.c
parent898899d9ddbd15925a9d3c6b1da0d426dbc6351b (diff)
downloadsrc-1c49736857cfe0b562e2f1e100ab2307e882a9e6.tar.gz
src-1c49736857cfe0b562e2f1e100ab2307e882a9e6.zip
- Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after: 14 days Approved by: thompsa (mentor)
Notes
Notes: svn path=/head/; revision=219100
Diffstat (limited to 'lib/libusb/libusb20.c')
-rw-r--r--lib/libusb/libusb20.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c
index f8edfc38d343..bcaa1e47ff13 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);