Page 1 of 1

Weird output from UHCI

Posted: Thu Jul 04, 2013 5:47 pm
by bsdero
Hi guys!!!

I'm working in my own USB stack, and one component in it is uhci.

All seems ok, detection of port connection, register access, and so on.
But I can not get successful USB transfers yet.

Got a log of a QH-TDs chain, and I can not see anything wrong.

I'm getting the next QH and TDs, pls does anybody may check?
Note: "this" below is a 32 bit device address, the 64 bit values has nothing to do
with the chain, are just memory addresses in my 64bit OS. My PCI USB controller
is a VIA VT6212.

Code: Select all

1435:------------------ CHAIN DUMP-------------------------------------
1438: QH:        0xa8000000df1c3900 <--64 bit address, device can not see this
1440: link:      0x00000001               <--last one
1442: element:   0x40023980            <---at first this pointed to the first TD at 0x40023940, but controller updated it
1444: this:      0x40023900              <--this QH 32 bit device address, device can't see this
1450: TD[0]:        0xa8000000df1c3940  <--64 bit address, device can not see this
1452:   link:          0x40023980          <--next TD address
1454:   status:        0x1c000007       <---got 8 bits transferred successfully!!!
1456:   token:         0x00e0002d        <---and that is all, no more data, remaining TD is intact
1458:   buffer:        0x40023b00        <---buffer pointer, below is the buffer content
1460:   this:          0x40023940        <---this TD 32 bit device address, device can't see this
1450: TD[1]:        0xa8000000df1c3980 <---this TD remains intact
1452:   link:          0x400239c0        
1454:   status:        0x1c800000          <--has been not processed yet
1456:   token:         0x00e80069
1458:   buffer:        0x40023b20
1460:   this:          0x40023980
1450: TD[2]:        0xa8000000df1c39c0  <--last TD, intact also
1452:   link:          0x00000001
1454:   status:        0x1d800000
1456:   token:         0xffe800e1
1458:   buffer:        0x00000000
1460:   this:          0x400239c0
1467: BUF0:        0xa8000000df1c3b00,0x40023b00 <---- buffer of the first TD, with 64 and 32 bit addresses
--------  ------------  ----
[0x0000]  [0x80060001]   <---simple get descriptor 8 command
[0x0001]  [0x00000800]  
[0x0002]  [0x00000000]  
[0x0003]  [0x00000000]  
1467: BUF1:        0xa8000000df1c3b20,0x40023b20
--------  ------------  ----
[0x0000]  [0x00000000]   <---- data buffer of the second TD
[0x0001]  [0x00000000]  
[0x0002]  [0x00000000]  
[0x0003]  [0x00000000]  
USB:usbuhci.c,uhci_ioctl,1768:end

I've been double checking all and testing but no transfer are possible!!

Pls help!! What am I doing wrong?

Re: Weird output from UHCI

Posted: Thu Jul 04, 2013 8:27 pm
by thepowersgang
I suspect your problem lies with the PID for the second TD. It's supposed to be 0x96, not 0x69. The rest of your dump checks out (although, the format is a little confusing)

Re: Weird output from UHCI

Posted: Fri Jul 05, 2013 9:24 am
by bsdero
I read again the intel spec for UHCI, and got the description for the PID field, below:

Packet Identification (PID). This field contains the Packet ID to be used for this transaction. Only
the IN (69h), OUT (E1h), and SETUP (2Dh) tokens are allowed. Any other value in this field causes
a consistency check failure resulting in an immediate halt of the Host Controller. Bits [3:0] are
complements of bits [7:4].

I Think its value is ok, but do u can see other suspicious thing?

Re: Weird output from UHCI

Posted: Fri Jul 05, 2013 11:08 am
by TomT
Have you released the port to the UHCI companion controller ?
We assume you have the proper bus/dev/fun number for the companion.
By default the ehci controller owns the 4 ports.

I have this same pci add-on card and have usb driver code that works.

Also take a look at the output of prepareTDchain() to compare with your TD's.

TomT
http://code.google.com/p/tatos/