EHCI/USB Split Transactions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Z3NT0N
Posts: 9
Joined: Thu Apr 13, 2023 7:51 am

EHCI/USB Split Transactions

Post by Z3NT0N »

Hi,
so my question is what should a split transaction for a "get descriptor"(device descriptor) request look if this is
what the request to a high-speed device looks like:

QueueHead:
-------------
0x00031502
0x1008E000
0x40000000

Overlay:
0x00000000
0x00032000
0x00000001
...


TD1 0x32000 (Setup):
------------------------
0x00033000
0x00034000
0x00080E80
0x00035000
0x00036000
0x00037000
0x00038000
0x00039000

TD2 0x33000 (Data):
-----------------------
0x00034000
0x00034000
0x80080D80
0x00036000
0x00037000
0x00038000
0x00039000
0x0003A000

TD3 0x34000 (Handshake):
------------------------------
0x00000001
0x00000001
0x80000C80
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000

Setup Buffer Content - 0x35000:
----------------------------------
0x01000680
0x00080000



This is what i am assuming a start-split should look like:
I have set the control endpoint flag, appropriate speed of the device i want to talk to(low speed),
also the hubs address and port(to which it is attached to) in the QH. The TD's have the
"Split Transaction State" bit in the status byte set to 0 for "Do Start Split":

QueueHead:
-------------
0x00031502
0x1808C000
0x40810000

Overlay:
0x00000000
0x00032000
0x00000001
...


TD1 - 0x32000 (Setup):
--------------------------
0x00033000
0x00034000
0x00080E80
0x00035000
0x00036000
0x00037000
0x00038000
0x00039000

TD2 - 0x33000 (Data):
------------------ ------
0x00034000
0x00034000
0x80080D80
0x00036000
0x00037000
0x00038000
0x00039000
0x0003A000

TD3 - 0x34000 (Handshake):
--------------------------------
0x00000001
0x00000001
0x80000C80
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000

Setup Buffer Content - 0x35000:
------------------------------------
0x01000680
0x00080000
Split Transactions.png
Above is an image of part of the documentation for the split transactions in the USB 2.0 document.
According to the document Start Split transactions can consist of 2,3, or 4 packets depending on transfer
type and direction. Does this mean that the start split token must have its own TD, then making it 4 TD's.
But if I look at the structure of the QH and TD's there is no way to send a SSplit PID token on its own.
I am assuming that it gets sent with the all three TD's?

If I am correct on the above "start-split", would the complete-split look like this:

QueueHead:
-------------
0x00031502
0x1808C000
0x40810000

Overlay:
0x00000000
0x00032000
0x00000001
...


TD1 - 0x32000 (Setup):
--------------------------
0x00033000
0x00033000
0x00080E82
0x00035000
0x00036000
0x00037000
0x00038000
0x00039000

TD2 - 0x33000 (Data):
------------------ ------
0x00000001
0x00000001
0x80080D82
0x00036000
0x00037000
0x00038000
0x00039000
0x0003A000

Setup Buffer Content - 0x35000:
------------------------------------
0x01000680
0x00080000

Thanks in advance for any help.
nullplan
Member
Member
Posts: 1789
Joined: Wed Aug 30, 2017 8:24 am

Re: EHCI/USB Split Transactions

Post by nullplan »

I may be wrong, but I had thought the EHCI completely handles the split transaction itself. That is why you have to provide the hub address in the queue head somewhere. That is the address of the deepest USB 2 hub in the tree.
Carpe diem!
Z3NT0N
Posts: 9
Joined: Thu Apr 13, 2023 7:51 am

Re: EHCI/USB Split Transactions

Post by Z3NT0N »

Hi nullplan, yes you were correct. It seems that in the code I managed to leave out the size of data to be transferred in the setup packet, instead of 0x00080000 I just had 0x00000000. But I managed to confuse myself thinking that the standard requests have to be modified to some split transaction format, so I did not even double check my packet data since I thought it was a TD sequence issue. Thanks.
Post Reply