Three main ways to understand how the Linux-USB stack works:

- Use the USB 2.0 spec. (1.1 is obsolete now.)

 - Use The Source!  Turn on all the debugging info you can,
   and run things too.  I'd strongly recommend looking at
   the ohci-hcd code for HC level stuff ... it's simplest,
   and it should be reasonably documented.  (All Linux UHCI
   drivers are overly complex.)

 - Spec for your USB host controller.  Again I'd suggest
   starting with OHCI ... UHCI specs aren't complete, and
   EHCI is just too complex if you're just starting.

If you're investing the time, do it with the 2.6 stack not
the 2.4 one; it's much more correct and complete.  That's
especially true for host controller infrastructure, which
in 2.4 has all sorts of complex quirks (which aren't all
that consistently implemented between the HCDs).


Where in particular is the point where hcd says to hc: now do transfer!?

In the enqueue() method when it patches the queues that the HC will be reading (using DMA). All the HCs have some kind of "transfer descriptors" (TDs), read by the controller. EHCI has three different types, OHCI has two, and UHCI has just one. The TDs go into queues.


How are the synchronisation mechanisms implemented in this context?

That's HC-specific, look at their specs. OHCI for example will both mark the TDs inactive and add them to a "done list" which is reported back to the HCD. EHCI and UHCI just mark the TDs as inactive, so they can just scan data structures rather than needing completion IRQs.

There are actually multiple synchronization mechanisms.
When there's a queue head (QH, or for OHCI "ED") there's
synch to link those to the controller ... and to unlink
them too.  Likewise, canceling a request after it's been
handed to the HC needs special synchronization.

- Dave



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to