Page 1 of 1

Example generic USB commands for EHCI driver

Posted: Wed Feb 15, 2012 11:41 am
by bsdero
Hi guys!!

I'm just complete my DMA handling part in my EHCI driver for SGI IRIX. But right now I need to do further tests, and I'm in doubt about the numeric representation of USB commands for testing.

I would like to get descriptors, enumerate and so on...
Which hex numeric values would be ok to test with? something like a ping or similar stuff?

which USB commands is the most suggested in order to get something in the DMA and see the device is "there"??

Thanks in advance guys

Re: Example generic USB commands for EHCI driver

Posted: Wed Feb 15, 2012 9:48 pm
by thepowersgang
USB is _very_ complex (as someone who is implementing it at this very moment)

I suggest actually building up a basic USB stack first, testing on qemu (a custom build, with debugging printfs) and then writing the SGI EHCI driver.

Most of what makes USB complex, is it's all host-driven, so there isn't really a ping command (that I recall), if you feel up to it, try assigning an address then reading the device descriptor (read the USB spec to find out how to do that).

Re: Example generic USB commands for EHCI driver

Posted: Sun Feb 19, 2012 10:59 pm
by Hoozim
Hello,

USB is definitely complex. I have fully implemented EHCI Mass Storage support. So if you want any source code exemplars, I will provide them.

Actually, today I optimized the EHCI driver. Originally, it took about 15 seconds to read 64 sectors off of the device. I was working with a device formatted with FAT16 64sectors/cluster! By compressing the number of transactions and cutting the delays as short as possible (any shorter and the hardware won't update quick enough), I was able to cut that time down to about a quarter of a second!

Hoozim