Example generic USB commands for EHCI driver

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
bsdero
Posts: 9
Joined: Mon Jan 09, 2012 12:36 pm

Example generic USB commands for EHCI driver

Post 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
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Example generic USB commands for EHCI driver

Post 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).
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Hoozim
Member
Member
Posts: 53
Joined: Fri Jul 23, 2010 8:26 am

Re: Example generic USB commands for EHCI driver

Post 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
Post Reply