weird usb problem
Hans Petter Selasky
hselasky at c2i.net
Tue Aug 9 18:40:00 GMT 2005
On Tuesday 09 August 2005 19:26, Maksim Yevmenkin wrote:
> Guys,
>
> >
> > From a quick glimpse, you need to add something like
> >
> > "ehci_pcd(sc, sc->sc_intrxfer);" after "ehci_pcd_able(sc, 1);".
> >
> > In the middle you have to add something like this:
> >
> > /* acknowledge any PCD interrupt */
> > EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_PCD);
> >
> > Just look at the code in my USB driver, and if it fixes the problem, just
> > backport it.
>
> well, i tried a naive thing like this
>
> beetle% diff -u10 ehci.c.orig ehci.c
> --- ehci.c.orig Sat May 28 21:42:27 2005
> +++ ehci.c Tue Aug 9 09:53:13 2005
> @@ -632,20 +632,21 @@
> sc->sc_eintrs &= ~EHCI_STS_PCD;
> EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
> }
>
> void
> ehci_pcd_enable(void *v_sc)
> {
> ehci_softc_t *sc = v_sc;
>
> ehci_pcd_able(sc, 1);
You need to clear the PCD interrupt bit here, because it is possibly still
set, and enabling bits in the interrupt mask does not generate another
interrupt!
/* acknowledge any PCD interrupt */
EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_PCD);
> + ehci_pcd(sc, sc->sc_intrxfer);
> }
>
>
> other usb slots are connected to the uhub5 ports 2 to 4 and the usb
> 2.0 device is _not_ working when plugged into these slots.
>
> usb 1.0 devices work in every usb slot.
>
If you have got your source tree in another directory, which makes installing
to "/usr/src" difficult, you can set the variable "S" in the Makefile to that
director and it will install there.
Do like this:
sysctl hw.usb.ehci.debug=15
Then plug your device.
sysctl hw.usb.ehci.debug=0
If you see a pcd change message your device is detected. But just watch and
you will see that it stops interrupting.
The problem is the same with OHCI.
--HPS
More information about the freebsd-usb
mailing list