? sys/external/bsd/dwc2/cscope.out Index: sys/external/bsd/dwc2/dwc2.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/dwc2/dwc2.c,v retrieving revision 1.15 diff -u -p -r1.15 dwc2.c --- sys/external/bsd/dwc2/dwc2.c 22 Oct 2013 09:42:20 -0000 1.15 +++ sys/external/bsd/dwc2/dwc2.c 22 Oct 2013 13:02:57 -0000 @@ -1328,13 +1328,40 @@ dwc2_device_start(usbd_xfer_handle xfer) dwc2_urb->status = -EINPROGRESS; dwc2_urb->packet_count = xfer->nframes; - if (xfertype == UE_INTERRUPT) { - if (dpipe->pipe.interval == USBD_DEFAULT_INTERVAL) - dwc2_urb->interval = ed->bInterval; + if (xfertype == UE_INTERRUPT || + xfertype == UE_ISOCHRONOUS) { + uint16_t ival; + + if (xfertype == UE_ISOCHRONOUS || + dpipe->pipe.interval == USBD_DEFAULT_INTERVAL) + ival = ed->bInterval; else - dwc2_urb->interval = dpipe->pipe.interval; - } else if (xfertype == UE_ISOCHRONOUS) - dwc2_urb->interval = ed->bInterval; + ival = dpipe->pipe.interval; + + if (ival < 1) { + retval = -ENODEV; + goto fail; + } + switch (dev->speed) { + case USB_SPEED_HIGH: + if (ival > 16) { + /* + * illegal with high-speed, but there + * were documentation bugs in the spec, + * so be generous + */ + ival = 256; + } else + ival = (1 << (ival - 1)); + break; + + case USB_SPEED_LOW: + if (xfertype == UE_INTERRUPT && ival < 10) + ival = 10; + break; + } + dwc2_urb->interval = ival; + } /* XXXNH bring down from callers?? */ // mutex_enter(&sc->sc_lock);