diff options
author | thompsa <thompsa@FreeBSD.org> | 2009-11-08 20:54:03 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2009-11-08 20:54:03 +0000 |
commit | c6a81c309174934d240db225d172ee92b4d3b800 (patch) | |
tree | 38d1ce357e1d8e0aa717569c3ccf460b6b8f0387 /sys/dev/usb/usb_transfer.c | |
parent | 138b1174a623634b265299a95c263adcbc9c76de (diff) | |
download | FreeBSD-src-c6a81c309174934d240db225d172ee92b4d3b800.zip FreeBSD-src-c6a81c309174934d240db225d172ee92b4d3b800.tar.gz |
improve support for high speed isochronous endpoints which does not run 1:1,
but needs intervalling 1:2, 1:4 or 1:8
Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/usb_transfer.c')
-rw-r--r-- | sys/dev/usb/usb_transfer.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c index bfb6430..4169ac8 100644 --- a/sys/dev/usb/usb_transfer.c +++ b/sys/dev/usb/usb_transfer.c @@ -416,9 +416,15 @@ usbd_transfer_setup_sub(struct usb_setup_params *parm) case USB_SPEED_LOW: case USB_SPEED_FULL: frame_limit = USB_MAX_FS_ISOC_FRAMES_PER_XFER; + xfer->fps_shift = 0; break; default: frame_limit = USB_MAX_HS_ISOC_FRAMES_PER_XFER; + xfer->fps_shift = edesc->bInterval; + if (xfer->fps_shift > 0) + xfer->fps_shift--; + if (xfer->fps_shift > 3) + xfer->fps_shift = 3; break; } @@ -1826,6 +1832,23 @@ usbd_xfer_get_frame(struct usb_xfer *xfer, usb_frcount_t frindex) return (&xfer->frbuffers[frindex]); } +/*------------------------------------------------------------------------* + * usbd_xfer_get_fps_shift + * + * The following function is only useful for isochronous transfers. It + * returns how many times the frame execution rate has been shifted + * down. + * + * Return value: + * Success: 0..3 + * Failure: 0 + *------------------------------------------------------------------------*/ +uint8_t +usbd_xfer_get_fps_shift(struct usb_xfer *xfer) +{ + return (xfer->fps_shift); +} + usb_frlength_t usbd_xfer_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex) { |