Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Nov 2005 01:36:44 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        taozhen@sbcglobal.net
Cc:        freebsd-usb@freebsd.org
Subject:   Re: usb0: host system err in 6.0
Message-ID:  <200511240136.45579.hselasky@c2i.net>
In-Reply-To: <4383A73B.4080805@sbcglobal.net>
References:  <43763A9B.1010901@sbcglobal.net> <200511191226.44448.hselasky@c2i.net> <4383A73B.4080805@sbcglobal.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 23 November 2005 00:18, Tao Zhen wrote:
> Hans Petter Selasky wrote:

>
> Here are some more error messages, hopefully they are helpful. I had to
> disable the debugging as the error message quickly filled up the partition
> with log files. USBD_TIMEOUT message never showed up as I didn't plug in a
> device at all.
>

The "dmesg" looks ok. Edit "/sys/dev/usb2/_uhci.c" and lookup 
"uhci_dump_all()". I am not sure how to best do it, but I want a binary copy 
of the structure pointed to by "sc". Maybe someone else on this list has a 
better suggestion, but here is what you can do:

static void
uhci_dump_all(uhci_softc_t *sc)
{
        uhci_dumpregs(sc);
        printf("intrs=%d\n", sc->sc_bus.no_intrs);
        uhci_dump_qh(&sc->sc_ls_ctl_start);
        uhci_dump_qh(&sc->sc_hs_ctl_start);
        uhci_dump_qh(&sc->sc_bulk_start);
        uhci_dump_qh(&sc->sc_last_qh);

        /*
         * a binary dump, that contains all 
         * hardware structures, is smaller
         * than a decoded dump
         */
        if(sc->sc_vendor[14] != '@')
        {
           u_int32_t len = sizeof(uhci_softc_t);
           char buffer[(sizeof(uhci_softc_t)*2)+1];
           char *dst = &buffer[0];
           u_int8_t *src = (void *)sc;
           u_int8_t last = 0;

           sc->sc_vendor[14] = '@';
           sc->sc_vendor[15] = 0;

           while(len--) {

             if(src[0] != last) {
               last = src[0];
               *dst++ = (last >> 4) + 'a';
               *dst++ = (last & 0xF) +'a';
             } else {
               *dst++ = 'z';
             }
             src++;
           }
           *dst++ = 0;

           printf("dumping %d (%d) bytes: <%s>\n", 
                  sizeof(uhci_softc_t), dst-&buffer[0]-1, &buffer[0]);
        }
        return;
}

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511240136.45579.hselasky>