diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2011-02-28 17:23:15 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2011-02-28 17:23:15 +0000 |
commit | 1c49736857cfe0b562e2f1e100ab2307e882a9e6 (patch) | |
tree | 47ed63016899826a83fbbc10b56bb53c1b6d65cd /lib/libusb/libusb10.c | |
parent | 898899d9ddbd15925a9d3c6b1da0d426dbc6351b (diff) | |
download | src-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/libusb10.c')
-rw-r--r-- | lib/libusb/libusb10.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 3b8d567dae9b..fa50ea784dfb 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -51,7 +51,6 @@ struct libusb_context *usbi_default_context = NULL; /* Prototypes */ static struct libusb20_transfer *libusb10_get_transfer(struct libusb20_device *, uint8_t, uint8_t); -static int libusb10_get_maxframe(struct libusb20_device *, libusb_transfer *); static int libusb10_get_buffsize(struct libusb20_device *, libusb_transfer *); static int libusb10_convert_error(uint8_t status); static void libusb10_complete_transfer(struct libusb20_transfer *, struct libusb_super_transfer *, int); @@ -810,25 +809,14 @@ libusb_free_transfer(struct libusb_transfer *uxfer) free(sxfer); } -static int +static uint32_t libusb10_get_maxframe(struct libusb20_device *pdev, libusb_transfer *xfer) { - int ret; - int usb_speed; - - usb_speed = libusb20_dev_get_speed(pdev); + uint32_t ret; switch (xfer->type) { case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: - switch (usb_speed) { - case LIBUSB20_SPEED_LOW: - case LIBUSB20_SPEED_FULL: - ret = 60 * 1; - break; - default: - ret = 60 * 8; - break; - } + ret = 60 | LIBUSB20_MAX_FRAME_PRE_SCALE; /* 60ms */ break; case LIBUSB_TRANSFER_TYPE_CONTROL: ret = 2; |