On Friday 07 July 2006 6:16 pm, Vivek Dharmadhikari wrote: > Hello David > > I posted earlier questions regarding the scanning of qhs and is reproduced > below
Is your mailer not capable of wrapping lines correctly? > I used the standard idiom like below to dump all the qh and qtds. > > qh = ehci->async->qh_next.qh; > if(qh) > { > do { > dbg_qh ("ehci-hcd",ehci, qh); > qh = qh->qh_next.qh; > } while (qh); > } > > I do the above after the expiry of 30 seconds scsi timer and i always see that > there is only one queue head in the list where as i was expecting at least two > queue head. And you expected two of them ... why? From what you had said before, only one QH would be active, so that's the only one I'd expect to see. > After reading the code, i think only active qh and its associated > qtds are shown. If a qh has no qtd,then above code fragment won't produce all > the qhs. Is this observation correct ? There's always a head, and otherwise the only way an empty qh (no qtds) will be scheduled is if it's about to be removed. An empty qh is shown, but it won't have any qtds. > Alternately, I tried to dump all the qhs by doing something like below > > addr = readl(&ehci->regs->async_next); > addr = le32_to_cpu(addr); /* My system is big endian */ > qh = (struct ehci_qh *)bus_to_virt(addr); Two things wrong there. (a) the low bits of that pointer are used as hardware type codes, so you need to mask them off; and (b) bus_to_virt() is deprecated for all kinds of good reasons, don't use it. > dbg_qh ("ehci-hcd",ehci, (struct ehci_qh *)qh); > > addr = le32_to_cpu(qh->hw_next); > qh = (struct ehci_qh *)bus_to_virt(addr); Same things again. > dbg_qh ("ehci-hcd",ehci, (struct ehci_qh *)qh); > > The dword1 which contains RL,H,Device Address etc fields obtained using above > code fragment contained wrong values. Obviously i did something wrong above. What makes you think they are wrong? That should give you a big clue... > What am i missing here ? What is the correct way to dump all qhs either ? The correct way is to use the C data structures, and walk them using normal CPU virtual addresses. If you're paranoid, double check them as you walk, to make sure the views from the CPU and the controller are exactly in sync while you walk the data structures. - Dave Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel