Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Replace shutdownhook_establish(9) with pmf_device_regist...
details: https://anonhg.NetBSD.org/src/rev/53e10008eb78
branches: trunk
changeset: 747078:53e10008eb78
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Tue Sep 01 15:19:20 2009 +0000
description:
Replace shutdownhook_establish(9) with pmf_device_register1(9).
diffstat:
sys/arch/sgimips/mace/if_mec.c | 17 +++++++++--------
sys/dev/ic/dp83932.c | 17 +++++++++--------
sys/dev/ic/dp83932var.h | 3 +--
3 files changed, 19 insertions(+), 18 deletions(-)
diffs (134 lines):
diff -r 03958f7bbe9c -r 53e10008eb78 sys/arch/sgimips/mace/if_mec.c
--- a/sys/arch/sgimips/mace/if_mec.c Tue Sep 01 15:16:41 2009 +0000
+++ b/sys/arch/sgimips/mace/if_mec.c Tue Sep 01 15:19:20 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.35 2009/05/09 18:31:46 tsutsui Exp $ */
+/* $NetBSD: if_mec.c,v 1.36 2009/09/01 15:19:20 tsutsui Exp $ */
/*-
* Copyright (c) 2004, 2008 Izumi Tsutsui. All rights reserved.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.35 2009/05/09 18:31:46 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.36 2009/09/01 15:19:20 tsutsui Exp $");
#include "opt_ddb.h"
#include "bpfilter.h"
@@ -293,7 +293,6 @@
bus_space_tag_t sc_st; /* bus_space tag */
bus_space_handle_t sc_sh; /* bus_space handle */
bus_dma_tag_t sc_dmat; /* bus_dma tag */
- void *sc_sdhook; /* shutdown hook */
struct ethercom sc_ethercom; /* Ethernet common part */
@@ -416,7 +415,7 @@
static void mec_rxcsum(struct mec_softc *, struct mbuf *, uint16_t,
uint32_t);
static void mec_txintr(struct mec_softc *, uint32_t);
-static void mec_shutdown(void *);
+static bool mec_shutdown(device_t, int);
CFATTACH_DECL_NEW(mec, sizeof(struct mec_softc),
mec_match, mec_attach, NULL, NULL);
@@ -727,7 +726,7 @@
#endif
/* set shutdown hook to reset interface on powerdown */
- sc->sc_sdhook = shutdownhook_establish(mec_shutdown, sc);
+ pmf_device_register1(self, NULL, NULL, mec_shutdown);
return;
@@ -1952,12 +1951,14 @@
ifp->if_flags &= ~IFF_OACTIVE;
}
-static void
-mec_shutdown(void *arg)
+static bool
+mec_shutdown(device_t self, int howto)
{
- struct mec_softc *sc = arg;
+ struct mec_softc *sc = device_private(self);
mec_stop(&sc->sc_ethercom.ec_if, 1);
/* make sure to stop DMA etc. */
mec_reset(sc);
+
+ return true;
}
diff -r 03958f7bbe9c -r 53e10008eb78 sys/dev/ic/dp83932.c
--- a/sys/dev/ic/dp83932.c Tue Sep 01 15:16:41 2009 +0000
+++ b/sys/dev/ic/dp83932.c Tue Sep 01 15:19:20 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dp83932.c,v 1.27 2008/08/23 15:46:47 tsutsui Exp $ */
+/* $NetBSD: dp83932.c,v 1.28 2009/09/01 15:20:53 tsutsui Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.27 2008/08/23 15:46:47 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.28 2009/09/01 15:20:53 tsutsui Exp $");
#include "bpfilter.h"
@@ -71,7 +71,7 @@
int sonic_init(struct ifnet *);
void sonic_stop(struct ifnet *, int);
-void sonic_shutdown(void *);
+bool sonic_shutdown(device_t, int);
void sonic_reset(struct sonic_softc *);
void sonic_rxdrain(struct sonic_softc *);
@@ -222,8 +222,7 @@
/*
* Make sure the interface is shutdown during reboot.
*/
- sc->sc_sdhook = shutdownhook_establish(sonic_shutdown, sc);
- if (sc->sc_sdhook == NULL)
+ if (!pmf_device_register1(sc->sc_dev, NULL, NULL, sonic_shutdown))
aprint_error_dev(sc->sc_dev,
"WARNING: unable to establish shutdown hook\n");
return;
@@ -262,12 +261,14 @@
*
* Make sure the interface is stopped at reboot.
*/
-void
-sonic_shutdown(void *arg)
+bool
+sonic_shutdown(device_t self, int howto)
{
- struct sonic_softc *sc = arg;
+ struct sonic_softc *sc = device_private(self);
sonic_stop(&sc->sc_ethercom.ec_if, 1);
+
+ return true;
}
/*
diff -r 03958f7bbe9c -r 53e10008eb78 sys/dev/ic/dp83932var.h
--- a/sys/dev/ic/dp83932var.h Tue Sep 01 15:16:41 2009 +0000
+++ b/sys/dev/ic/dp83932var.h Tue Sep 01 15:19:20 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dp83932var.h,v 1.11 2008/04/28 20:23:49 martin Exp $ */
+/* $NetBSD: dp83932var.h,v 1.12 2009/09/01 15:20:53 tsutsui Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -151,7 +151,6 @@
bus_space_handle_t sc_sh; /* bus space handle */
bus_dma_tag_t sc_dmat; /* bus DMA tag */
struct ethercom sc_ethercom; /* ethernet common data */
- void *sc_sdhook; /* shutdown hook */
int sc_32bit; /* use 32-bit mode */
int sc_bigendian; /* BMODE -> Vcc */
Home |
Main Index |
Thread Index |
Old Index