EHCI - Data Toggle/Bytes To Transfer [ SOLVED ]
Posted: Sun Apr 04, 2010 9:48 pm
Hello Friends,
I recently am able to get EHCI Async schedule work with few control transfers to get device desc, set address, get config value etc...
Before I proceed, I am very much confused with the way EHCI Data Toggling works and also how Total Bytes to Transfer is interpreted by controller and device.
I have read the EHCI doc but not able to understand or get clarifications about this.
Question 1: Can anybody please explain how Data Toggle works (DTC and DT) ?
In UHCI, it was straight fwd as I just need to toggle the data toggle bit for every control transaction starting at "0"
If I do the same with EHCI, it doesn't work properly for all control transfers !
Question 2: What should be the value of Length field in qTD token and also in USB Device Request structure (wLength) for a SETUP transaction of 8 bytes
and for an IN transaction of 18 bytes ?
In UHCI, it is very clear. Length field in USB Device Request (URB) is exactly equal to Length of bytes to transfer. It will be zero for zero length transfer
Length field in TD Token will be always 1 less than the number of bytes to transfer. For Zero Length transaction it should be 0x7FF
In EHCI, While doing GetDeviceDesc control transaction, it works if the Length Field in URB is (Len + 1) and the length field in qTD Token = Len !!
If I have Length field in URB = Len and length field in qTD Token = (Len - 1), it works but it transfers only (Len - 1) bytes
If I have Length field in URB = Len and length field in qTD Token also = Len, Transaction fails.
This issue is compounded with Data Toggle issue as I am not sure when to toggle the bits ?
I am thinking that every new control transaction will start with Data Toggle value of "0" like the way it works in UHCI
i.e,
for SetAddress it will be SETUP (0), IN ACK(1)
for GetDeviceDesc it will be SETUP(0), IN Desc(1), OUT ACK(0)
Thanks very much in advance for helping on this
Best Regards,
- MosMan
I recently am able to get EHCI Async schedule work with few control transfers to get device desc, set address, get config value etc...
Before I proceed, I am very much confused with the way EHCI Data Toggling works and also how Total Bytes to Transfer is interpreted by controller and device.
I have read the EHCI doc but not able to understand or get clarifications about this.
Question 1: Can anybody please explain how Data Toggle works (DTC and DT) ?
In UHCI, it was straight fwd as I just need to toggle the data toggle bit for every control transaction starting at "0"
If I do the same with EHCI, it doesn't work properly for all control transfers !
Question 2: What should be the value of Length field in qTD token and also in USB Device Request structure (wLength) for a SETUP transaction of 8 bytes
and for an IN transaction of 18 bytes ?
In UHCI, it is very clear. Length field in USB Device Request (URB) is exactly equal to Length of bytes to transfer. It will be zero for zero length transfer
Length field in TD Token will be always 1 less than the number of bytes to transfer. For Zero Length transaction it should be 0x7FF
In EHCI, While doing GetDeviceDesc control transaction, it works if the Length Field in URB is (Len + 1) and the length field in qTD Token = Len !!
If I have Length field in URB = Len and length field in qTD Token = (Len - 1), it works but it transfers only (Len - 1) bytes
If I have Length field in URB = Len and length field in qTD Token also = Len, Transaction fails.
This issue is compounded with Data Toggle issue as I am not sure when to toggle the bits ?
I am thinking that every new control transaction will start with Data Toggle value of "0" like the way it works in UHCI
i.e,
for SetAddress it will be SETUP (0), IN ACK(1)
for GetDeviceDesc it will be SETUP(0), IN Desc(1), OUT ACK(0)
Thanks very much in advance for helping on this
Best Regards,
- MosMan