From 48f79d0e5ccefcfe47a37f2d0470d41c4e0b95d6 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Mon, 15 Feb 1999 20:43:17 +0000 Subject: [PATCH] Added more verbose debugging output to uhci_run --- sys/dev/usb/uhci.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 2041089931c1..319e510bf812 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -324,8 +324,19 @@ uhci_init(sc) UWRITE2(sc, UHCI_FRNUM, 0); /* set frame number to 0 */ UWRITE4(sc, UHCI_FLBASEADDR, DMAADDR(&dma)); /* set frame list */ +#ifdef USB_DEBUG + /* PR1 */ + if ( UREAD4(sc, UHCI_FLBASEADDR) != DMAADDR(&dma) ) + printf("PR1:before busreset: FLBASEADDR = 0x%08x != DMADDR(&dma) = 0x%08x\n", + UREAD4(sc, UHCI_FLBASEADDR), DMAADDR(&dma)); +#endif uhci_busreset(sc); - +#ifdef USB_DEBUG + /* PR1 */ + if ( UREAD4(sc, UHCI_FLBASEADDR) != DMAADDR(&dma) ) + printf("PR1:after busreset: FLBASEADDR = 0x%08x != DMADDR(&dma) = 0x%08x\n", + UREAD4(sc, UHCI_FLBASEADDR), DMAADDR(&dma)); +#endif /* Allocate the dummy QH where bulk traffic will be queued. */ bsqh = uhci_alloc_sqh(sc); if (!bsqh) @@ -391,7 +402,7 @@ static void uhci_dumpregs(sc) uhci_softc_t *sc; { - printf("%s; regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, " + printf("%s: regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, " "flbase=%08x, sof=%02x, portsc1=%04x, portsc2=%04x, " "legsup=%04x\n", USBDEVNAME(sc->sc_bus.bdev), @@ -937,11 +948,19 @@ uhci_run(sc, run) int run; { int s, n, running; +#ifdef USB_DEBUG + printf("PR1:uhci_run:start: "); + uhci_dumpregs(sc); +#endif s = splusb(); running = ((UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) == 0); if (run == running) { splx(s); +#ifdef USB_DEBUG + printf("PR1:uhci_run:do_nothing: "); + uhci_dumpregs(sc); +#endif return (USBD_NORMAL_COMPLETION); } UWRITE2(sc, UHCI_CMD, run ? UHCI_CMD_RS : 0); @@ -950,6 +969,10 @@ uhci_run(sc, run) /* return when we've entered the state we want */ if (run == running) { splx(s); +#ifdef USB_DEBUG + printf("PR1:uhci_run:succeed(%d): ", n); + uhci_dumpregs(sc); +#endif return (USBD_NORMAL_COMPLETION); } usb_delay_ms(&sc->sc_bus, 1); @@ -958,6 +981,7 @@ uhci_run(sc, run) printf("%s: cannot %s\n", USBDEVNAME(sc->sc_bus.bdev), run ? "start" : "stop"); #ifdef USB_DEBUG + printf("PR1:uhci_run:fail: "); uhci_dumpregs(sc); #endif return (USBD_IOERROR);