Module Name: src Committed By: tsutsui Date: Tue Sep 1 15:20:53 UTC 2009
Modified Files: src/sys/dev/ic: dp83932.c dp83932var.h Log Message: Replace shutdownhook_establish(9) with pmf_device_register1(9). To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/dp83932.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/dp83932var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/dp83932.c diff -u src/sys/dev/ic/dp83932.c:1.27 src/sys/dev/ic/dp83932.c:1.28 --- src/sys/dev/ic/dp83932.c:1.27 Sat Aug 23 15:46:47 2008 +++ src/sys/dev/ic/dp83932.c Tue Sep 1 15:20:53 2009 @@ -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; } /* Index: src/sys/dev/ic/dp83932var.h diff -u src/sys/dev/ic/dp83932var.h:1.11 src/sys/dev/ic/dp83932var.h:1.12 --- src/sys/dev/ic/dp83932var.h:1.11 Mon Apr 28 20:23:49 2008 +++ src/sys/dev/ic/dp83932var.h Tue Sep 1 15:20:53 2009 @@ -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 */