summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ohci.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-07 14:31:03 +0000
committerjoe <joe@FreeBSD.org>2002-04-07 14:31:03 +0000
commitf4e30c6cd66f52a217cd7f5bf6d645d5d75423ce (patch)
tree0968a41dc93a8517b3078ad0a1bb3a0a6551e05c /sys/dev/usb/ohci.c
parent15941fbd97b74997e142c500d2f0523a5db58397 (diff)
downloadFreeBSD-src-f4e30c6cd66f52a217cd7f5bf6d645d5d75423ce.zip
FreeBSD-src-f4e30c6cd66f52a217cd7f5bf6d645d5d75423ce.tar.gz
MFNetBSD:
revision 1.95 date: 2000/12/13 03:09:06; author: augustss; state: Exp; lines: +19 -3 Make the ohci driver not hang suspend/resume. It still doesn't resume correctly. From itohy@netbsd.org (ITOH Yasufumi) PR kern/11714.
Diffstat (limited to 'sys/dev/usb/ohci.c')
-rw-r--r--sys/dev/usb/ohci.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index c8b8c4c..c0fc284 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.100 2001/01/28 16:18:09 augustss Exp $ */
+/* $NetBSD: ohci.c,v 1.101 2001/02/20 15:20:32 minoura Exp $ */
/* $FreeBSD$ */
/*
@@ -859,6 +859,7 @@ ohci_init(ohci_softc_t *sc)
sc->sc_bus.pipe_size = sizeof(struct ohci_pipe);
#if defined(__NetBSD__) || defined(__OPENBSD__)
+ sc->sc_control = sc->sc_intre = 0;
sc->sc_powerhook = powerhook_establish(ohci_power, sc);
sc->sc_shutdownhook = shutdownhook_establish(ohci_shutdown, sc);
#endif
@@ -948,13 +949,29 @@ ohci_shutdown(void *v)
void
ohci_power(int why, void *v)
{
-#ifdef OHCI_DEBUG
ohci_softc_t *sc = v;
+ int s;
+#ifdef OHCI_DEBUG
DPRINTF(("ohci_power: sc=%p, why=%d\n", sc, why));
- /* XXX should suspend/resume */
ohci_dumpregs(sc);
#endif
+
+ s = splusb();
+ switch (why) {
+ case PWR_SUSPEND:
+ case PWR_STANDBY:
+ OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_SUSPEND);
+ break;
+ case PWR_RESUME:
+ OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESUME);
+ break;
+ case PWR_SOFTSUSPEND:
+ case PWR_SOFTSTANDBY:
+ case PWR_SOFTRESUME:
+ break;
+ }
+ splx(s);
}
#endif
OpenPOWER on IntegriCloud