Page 1 of 1

ehci transfer types

Posted: Sat Jun 20, 2020 6:49 am
by SanderR
hello everyone,

I was reading the EHCI specification.
I wrote a driver which can detect attached ports on qemu and real hardware.
I want to talk to the port but im unsure which steps I have to take. like, there are several transfer methods (periodic+queuehead) and I dont see how I should issue a command like setaddress,getdevicedescriptor etcetra and which type I should use.

I hope someone can tell which type i need to use and how to send a command to a port.

thank you in advantage.

Re: ehci transfer types

Posted: Wed Jun 24, 2020 9:55 am
by BenLunt
Hi guys,

[Sorry for my absence lately. My wife is having some health issues and this seems to take a majority of my free time now.]

The EHCI, as well as the other protocols, are simply a mechanism to transport data across a wire to the device. The actual data transported is the same no matter if you use EHCI, UHCI, OHCI, or xHCI. However, the way you transport it does matter.

Periodical transports are just that, periodic. For example, a mouse or keyboard will need to periodically be monitored for keypresses or mouse movements. This is done via an interrupt pipe and is on the periodic list.

Setting a device's address and getting descriptors are a one time thing, non-periodic. Therefore, they are on the Control pipe and done via the async list.

Each list (may) use queue heads and transfer descriptors. You set up a count of queue heads and transfer descriptors to send or receive a count of bytes of data from the wire and place these blocks into one of the lists. The controller will attempt to transfer the data and respond with a status.

In my opinion, the EHCI was the hardest controller to use and learn. It was a "patch" to get high-speed transfers but still allow backward compatibility with full- and low-speed devices. If you are just learning USB, I would suggest that you learn UHCI, OHCI, or even xHCI. Once you have an idea how things are done, EHCI becomes a bit easier to manage.

If you are looking for a good resource, my book explains in detail all four controllers, detailing how to do exactly what you are asking.

Ben
- http://www.fysnet.net/the_universal_serial_bus.htm