Hi,
Your explanation is a little confusing to me, so I will try to explain the process.
First, EHCI has nothing to do with BBB (Bulk Bulk Bulk) transport. BBB transport is the same whether it is UHCI, OHCI, EHCI, or xHCI.
However, I do see why you chose to use EHCI as the example, because, yes you show each TD pointing to the next.
Second, just a few notes. A BBB device, called a Mass Storage Device (see note below), will most likely have a bulk endpoint max packet size the size of the largest allowed size for the speed of the device. For example, if the device is a full-speed device, it most likely will have a max packet size of 64 for the two bulk endpoints. If it is a super-speed device, it might have a max packet size of 512.
However, as you state, let's assume for arguments sake, the bulk endpoint has a max packet size of 64.
Therefore, if I want to read a 512-byte sector from the device, I must use ten (10) TD's.
CBW TD OUT as 31 bytes.
TD0 IN 64 bytes
TD1 IN 64 bytes
TD2 IN 64 bytes
TD3 IN 64 bytes
TD4 IN 64 bytes
TD5 IN 64 bytes
TD6 IN 64 bytes
TD7 IN 64 bytes
CSW TD IN as 13 bytes.
You can create the TD stack however you wish. The TDs do not have to be in a single Queue Head. You may have multiple QHs. Again, the TDs and QHs are EHCI specific, not BBB specific.
An 8-byte max packet size is illegal with BBB devices. The two wrapper transfers must be single transfers so the max packet size must be at at least 31 bytes. (If memory serves. I would have to look at my notes to verify this for sure.)
Please note that even if one of the data transfers between the two wrapper packets stalls or errors, you must still read the CSW wrapper packet. Except for unrecoverable errors, the device will still expect you to read the CSW packet. This gets to be dificult if not done correctly because you have to know the toggle bit status of the last successful transfer to know what the toggle bit will be for the CSW transfer.
Note on Mass Storage Devices (MSDs). MSD can have different forms of transfer protocols. The common protocol is the BBB protocol shown here. A new(ish) protocol is the UAS protocol. UAS stands for USB Attached SCSI. This protocol allows for much faster transfers and requires at least high-speed (EHCI) but is really designed for super-speed (xHCI) and streams.
The MSD will tell you which protocol it uses. My point here is, please don't confuse protocols by joining them. The physical transport of data (UHCI, OHCI, EHCI, xHCI) is one driver (layer). The MSD protocol is another layer. The BBB or UAS is another layer. Therefore, you should have
at least three separate layers/drivers for BBB devices.
1) USB Controller Driver
2) MSD driver
3a) BBB protocol
3b) UAS protocol
Also, MSD actually has other protocols as well, including CB and CBI for floppies, Control Bulk [Interrupt].
Hope this helps,
Ben
-
http://www.fysnet.net/the_universal_serial_bus.htm