Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Make the ohci driver not hang suspend/resume. I...



details:   https://anonhg.NetBSD.org/src/rev/a39267413e30
branches:  trunk
changeset: 500515:a39267413e30
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed Dec 13 03:09:06 2000 +0000

description:
Make the ohci driver not hang suspend/resume.  It still doesn't resume
correctly.  From itohy%netbsd.org@localhost (ITOH Yasufumi) PR kern/11714.

diffstat:

 sys/dev/usb/ohci.c |  24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r ca44ca3053cf -r a39267413e30 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Wed Dec 13 03:04:51 2000 +0000
+++ b/sys/dev/usb/ohci.c        Wed Dec 13 03:09:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.94 2000/11/10 14:11:49 augustss Exp $       */
+/*     $NetBSD: ohci.c,v 1.95 2000/12/13 03:09:06 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -939,13 +939,29 @@
 void
 ohci_power(int why, void *v)
 {
+       ohci_softc_t *sc = v;
+       int s;
+
 #ifdef OHCI_DEBUG
-       ohci_softc_t *sc = v;
-
        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);
 }
 
 #ifdef OHCI_DEBUG



Home | Main Index | Thread Index | Old Index