I've seen problems similar to mine here and elsewhere but was unable to find a definite answer.
I'm part of a team bringing USB support to an academic OS, and so far everything was good.
We got several devices working and tested on real hw (mouse, keyboard, hubs), however some are causing problems (namely Microsoft IntelliMouse Optical).
After plugging in the mouse it responds to the first SETUP packet with Timeout/CRC and ultimately Stall, exact value of of TD status field is 4450007 (LOW SPEED, STALL, CRC/TIMEOUT, RESERVED BIT, 8 bytes transfered, what is this thing with reserved status bit(bit 16) set?)
Funny thing is that it works with other devices that i tried, Logitech keyboard, Genius mouse, usb hubs. The fact that the same microsoft mouse works when connected via another hub, has led me to believe that problem is with UHCI port reset routine (it's the only thing that differs).
my reset routine, called immediately after CSC bit is detected and bit 0 indicates there is a device connected:
Code: Select all
mwait(100) /* 100ms, my understanding is that this one is not necessary and 100ms timeout shall be provided by UHCI before indicating the device presence, but can't hurt */
port_write(0x0200) /* starts reset signaling */
mwait(50) /* 50 ms, USB spec 7.1.7.3 mentions that reset from root hub ports should be 50 ms, however OHCI does not do it, and sends reset signal for 10ms (UHCI 1.0a p. 131) */
port_write(0) /* stops reset signaling, keeps CSC, and possibly PCE bits untouched */
p = port_read()
p |= 0x4
port_write(p); /* this sets port to enabled state, and clears WC bits */
mwait(10) /* 10 ms reset recovery */
during my experiments I found out that devices react differently to incorrect/absent reset, some worked even without a reset signal, some responded NAK to everything, and some responded the same way as this MS mouse (another thing that let me believe there is something wrong with reset sequence)
is there something I missed, or some kind of quirk that certain devices need?
any input is welcome as I am stuck on this.
thanks
PS: The mouse works well with both Linux and Windows,
out of 3(different models) Microsoft optical mice I tried, only one worked, other devices I tried don't have this problem