diff options
| author | ichiro <ichiro@NetBSD.org> | 2003-10-16 07:55:18 +0000 |
|---|---|---|
| committer | ichiro <ichiro@NetBSD.org> | 2003-10-16 07:55:18 +0000 |
| commit | 581dfca2767f72e98a2dfd5fc99bf75ccd573a94 (patch) | |
| tree | f46a2f765bf6e1f771c984688ac7dcce514823f5 /sys/dev | |
| parent | f845a339ac6f38f110765eb11c25e4088311e794 (diff) | |
add {shutdownhook,powerhook}disestablish()
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/ath.c | 22 | ||||
| -rw-r--r-- | sys/dev/ic/athvar.h | 7 |
2 files changed, 22 insertions, 7 deletions
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index b49695f055f..23cdafaa3e4 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -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 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) /* * 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 @@ ath_detach(struct ath_softc *sc) 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 @@ ath_power(int why, void *arg) } splx(s); } +#endif void ath_suspend(struct ath_softc *sc, int why) @@ -530,6 +534,15 @@ ath_resume(struct ath_softc *sc, int why) } } +#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_shutdown(struct ath_softc *sc) ath_stop(ifp); #endif } +#endif #ifdef __NetBSD__ int diff --git a/sys/dev/ic/athvar.h b/sys/dev/ic/athvar.h index a4c9e4cde85..10cf3f5e31b 100644 --- a/sys/dev/ic/athvar.h +++ b/sys/dev/ic/athvar.h @@ -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_attach(u_int16_t, struct ath_softc *); 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 |
