Module Name: src Committed By: tsutsui Date: Thu Sep 3 14:13:16 UTC 2009
Modified Files: src/sys/dev/ic: smc83c170.c smc83c170var.h Log Message: Replace shutdownhook_establish(9) with pmf_device_register1(). Tested EtherPower II 10/100 (SMC9432TX) on macppc. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ic/smc83c170.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/smc83c170var.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/smc83c170.c diff -u src/sys/dev/ic/smc83c170.c:1.76 src/sys/dev/ic/smc83c170.c:1.77 --- src/sys/dev/ic/smc83c170.c:1.76 Sun Jul 6 14:32:56 2008 +++ src/sys/dev/ic/smc83c170.c Thu Sep 3 14:13:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: smc83c170.c,v 1.76 2008/07/06 14:32:56 tsutsui Exp $ */ +/* $NetBSD: smc83c170.c,v 1.77 2009/09/03 14:13:16 tsutsui Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.76 2008/07/06 14:32:56 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.77 2009/09/03 14:13:16 tsutsui Exp $"); #include "bpfilter.h" @@ -77,7 +77,7 @@ int epic_init(struct ifnet *); void epic_stop(struct ifnet *, int); -void epic_shutdown(void *); +bool epic_shutdown(device_t, int); void epic_reset(struct epic_softc *); void epic_rxdrain(struct epic_softc *); @@ -301,10 +301,12 @@ /* * Make sure the interface is shutdown during reboot. */ - sc->sc_sdhook = shutdownhook_establish(epic_shutdown, sc); - if (sc->sc_sdhook == NULL) + if (pmf_device_register1(sc->sc_dev, NULL, NULL, epic_shutdown)) + pmf_class_network_register(sc->sc_dev, ifp); + else aprint_error_dev(sc->sc_dev, - "WARNING: unable to establish shutdown hook\n"); + "couldn't establish power handler\n"); + return; /* @@ -340,12 +342,14 @@ /* * Shutdown hook. Make sure the interface is stopped at reboot. */ -void -epic_shutdown(void *arg) +bool +epic_shutdown(device_t self, int howto) { - struct epic_softc *sc = arg; + struct epic_softc *sc = device_private(self); epic_stop(&sc->sc_ethercom.ec_if, 1); + + return true; } /* Index: src/sys/dev/ic/smc83c170var.h diff -u src/sys/dev/ic/smc83c170var.h:1.13 src/sys/dev/ic/smc83c170var.h:1.14 --- src/sys/dev/ic/smc83c170var.h:1.13 Sun Jul 6 14:32:56 2008 +++ src/sys/dev/ic/smc83c170var.h Thu Sep 3 14:13:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: smc83c170var.h,v 1.13 2008/07/06 14:32:56 tsutsui Exp $ */ +/* $NetBSD: smc83c170var.h,v 1.14 2009/09/03 14:13:16 tsutsui Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -98,7 +98,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_hwflags; /* info about board */ #define EPIC_HAS_BNC 0x01 /* BNC on serial interface */