summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-01-21 23:31:58 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-01-21 23:31:58 +0000
commitca386e735566fb504682944ed30900dd3959d14c (patch)
tree3783864068b97086b1ee75c2837d5e8adb0e30a2 /sys/dev/usb/uhci.c
parentf41dcfcfec718c6c3290e166fde10bd4521c6091 (diff)
downloadFreeBSD-src-ca386e735566fb504682944ed30900dd3959d14c.zip
FreeBSD-src-ca386e735566fb504682944ed30900dd3959d14c.tar.gz
Fixed bug that made UHCI controllers fail to start.
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 707bfe3..b2f07b6 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,5 +1,5 @@
/* $NetBSD: uhci.c,v 1.22 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: uhci.c,v 1.6 1999/01/07 23:31:33 n_hibma Exp $ */
+/* $FreeBSD$ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -935,16 +935,18 @@ uhci_run(sc, run)
{
int s, n, running;
- run = run != 0;
s = splusb();
- running = !(UREAD2(sc, UHCI_STS) & UHCI_STS_HCH);
+ running = ((UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) == 0);
+ DPRINTF(("sc->sc_iobase=0x%x run=0x%x, running=0x%x\n",
+ sc->sc_iobase, run,running));
if (run == running) {
splx(s);
return (USBD_NORMAL_COMPLETION);
}
UWRITE2(sc, UHCI_CMD, run ? UHCI_CMD_RS : 0);
for(n = 0; n < 10; n++) {
- running = !(UREAD2(sc, UHCI_STS) & UHCI_STS_HCH);
+ running = ((UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) == 0);
+ DPRINTF(("run=0x%x, running=0x%x\n", run,running));
/* return when we've entered the state we want */
if (run == running) {
splx(s);
@@ -955,6 +957,9 @@ uhci_run(sc, run)
splx(s);
printf("%s: cannot %s\n", USBDEVNAME(sc->sc_bus.bdev),
run ? "start" : "stop");
+#ifdef USB_DEBUG
+ uhci_dumpregs(sc);
+#endif
return (USBD_IOERROR);
}
OpenPOWER on IntegriCloud