Hi, I am rather new to USB.
I've tried to do Interrupt IN transfers in HighSpeed from a Cypress FX2 Dev Board using libusb ( 1.8 / Linux 2.6.5 , the relevant code is still the same in 2.6.10) This does not work. It breaks in the IOCTL submitting the urb for this transaction returning -ENOMEM. the problem seems to be in the handling of ep->bInterval
the codepath goes through devio.c:
file:/usr/src/linux/drivers/usb/core/devio.c
904 if (ps->dev->speed == USB_SPEED_HIGH)
905 interval = (1 << (min ((u8)16,ep_desc->bInterval ) - 1));
--------^^^^^^^^^^^^^^^^^^
906 else
907 interval = ep_desc->bInterval;
..
938 as->urb->number_of_packets = uurb.number_of_packets;
939 as->urb->interval = interval;
940 as->urb->context = as;
this line was changed from 2.6.5 to 2.6.10
905 interval = (1 << (min ((u8)16,ep_desc->bInterval ) - 1));
to
905 interval = (1 << (min (15,ep_desc->bInterval ) - 1));
which should make no difference in this case?
and from there to this part:
file:/usr/src/linux/drivers/usb/host/ehci-q.c
ehci-q.c-632- qh->gap_uf = 0;
ehci-q.c-633-
ehci-q.c-634- /* FIXME handle HS periods of less than 1 frame. */
ehci-q.c-635- qh->period = urb->interval >> 3;
---------------------------------------------^^^^^^^^^^^^^
ehci-q.c-636- if (qh->period < 1) {
ehci-q.c:637: dbg ("intr period %d uframes, NYET!",
ehci-q.c-638- urb->interval);
ehci-q.c-639- goto done;
ehci-q.c-640- }
ehci-q.c-641- } else {
ehci-q.c-642- /* gap is f(FS/LS transfer times) */
ehci-q.c:710:done:
ehci-q.c-711- qh_put (qh);
ehci-q.c-712- return 0;
ehci-q.c-713- }
causing a return with -ENOMEM in devio.c
The descriptor of the FX2DevBrd for ep6IN(alt2) is bmEndPointAddress 86 bmAttributes 03 wMaxPcketSize 512 bInterval 1
from the usb spec (2.0 p51) interval = 1 seems to be valid. <cite> High-speed endpoints can specify a desired period (2^(bInterval-1))x125 µs, where bInterval is in the range 1 to (including) 16. The USB System Software will use this information during configuration to determine a.. </cite>
if i do force ep->interval to 8 reading interrupt packets works.
question: shouldn't qh->period be at least 1? is there a way overiding the descriptor interval with longer periods?
G! uwe
uwe
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users