Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic add {shutdownhook, powerhook}disestablish()



details:   https://anonhg.NetBSD.org/src/rev/6839cc7947e8
branches:  trunk
changeset: 553421:6839cc7947e8
user:      ichiro <ichiro%NetBSD.org@localhost>
date:      Thu Oct 16 07:55:18 2003 +0000

description:
add {shutdownhook,powerhook}disestablish()

diffstat:

 sys/dev/ic/ath.c    |  22 ++++++++++++++++++----
 sys/dev/ic/athvar.h |   7 ++++---
 2 files changed, 22 insertions(+), 7 deletions(-)

diffs (105 lines):

diff -r a363fb64a816 -r 6839cc7947e8 sys/dev/ic/ath.c
--- a/sys/dev/ic/ath.c  Thu Oct 16 07:20:54 2003 +0000
+++ b/sys/dev/ic/ath.c  Thu Oct 16 07:55:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ath.c,v 1.9 2003/10/15 23:23:39 itojun Exp $   */
+/*     $NetBSD: ath.c,v 1.10 2003/10/16 07:55:18 ichiro Exp $  */
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
 __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.14 2003/09/05 22:22:49 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.9 2003/10/15 23:23:39 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.10 2003/10/16 07:55:18 ichiro Exp $");
 #endif
 
 /*
@@ -430,12 +430,10 @@
        /*
         * Make sure the interface is shutdown during reboot.
         */
-#if 0
        sc->sc_sdhook = shutdownhook_establish(ath_shutdown, sc);
        if (sc->sc_sdhook == NULL)
                printf("%s: WARNING: unable to establish shutdown hook\n",
                        sc->sc_dev.dv_xname);
-#endif
        sc->sc_powerhook = powerhook_establish(ath_power, sc);
        if (sc->sc_powerhook == NULL)
                printf("%s: WARNING: unable to establish power hook\n",
@@ -471,9 +469,14 @@
        if_detach(ifp);
 #endif
        ath_softc_critsect_end(sc, s);
+#ifdef __NetBSD__
+       powerhook_disestablish(sc->sc_sdhook);
+       shutdownhook_disestablish(sc->sc_powerhook);
+#endif
        return 0;
 }
 
+#ifdef __NetBSD__
 void
 ath_power(int why, void *arg)
 {
@@ -498,6 +501,7 @@
        }
        splx(s);
 }
+#endif
 
 void
 ath_suspend(struct ath_softc *sc, int why)
@@ -530,6 +534,15 @@
        }
 }
 
+#ifdef __NetBSD__
+void
+ath_shutdown(void *arg)
+{
+       struct ath_softc *sc = arg;
+
+       ath_stop(&sc->sc_ic.ic_if);
+}
+#else
 void
 ath_shutdown(struct ath_softc *sc)
 {
@@ -543,6 +556,7 @@
        ath_stop(ifp);
 #endif
 }
+#endif
 
 #ifdef __NetBSD__
 int
diff -r a363fb64a816 -r 6839cc7947e8 sys/dev/ic/athvar.h
--- a/sys/dev/ic/athvar.h       Thu Oct 16 07:20:54 2003 +0000
+++ b/sys/dev/ic/athvar.h       Thu Oct 16 07:55:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: athvar.h,v 1.4 2003/10/15 23:23:39 itojun Exp $        */
+/*     $NetBSD: athvar.h,v 1.5 2003/10/16 07:55:18 ichiro Exp $        */
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -202,14 +202,15 @@
 int    ath_detach(struct ath_softc *);
 void   ath_resume(struct ath_softc *, int);
 void   ath_suspend(struct ath_softc *, int);
-void   ath_shutdown(struct ath_softc *);
-#ifndef __FreeBSD__
+#ifdef __NetBSD__
 int    ath_activate(struct device *, enum devact);
 void   ath_power(int, void *);
 #endif
 #ifdef __FreeBSD__
+void   ath_shutdown(struct ath_softc *);
 void   ath_intr(void *);
 #else
+void   ath_shutdown(void *);
 int    ath_intr(void *);
 #endif
 



Home | Main Index | Thread Index | Old Index