summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-02-15 20:43:17 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-02-15 20:43:17 +0000
commit945021b98380cf8ec176b994e7ea92ed24f85550 (patch)
tree431b5b0e66242e35cd10ac197b8b1b9ec5e1d3fc /sys/dev/usb/uhci.c
parent86c0720b63f5f31d1534841e5abb8539586de70a (diff)
downloadFreeBSD-src-945021b98380cf8ec176b994e7ea92ed24f85550.zip
FreeBSD-src-945021b98380cf8ec176b994e7ea92ed24f85550.tar.gz
Added more verbose debugging output to uhci_run
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 2041089..319e510 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);
OpenPOWER on IntegriCloud