Module Name:    src
Committed By:   tsutsui
Date:           Sun Sep 27 10:00:11 UTC 2009

Modified Files:
        src/sys/dev/ic: aic6915.c aic6915var.h

Log Message:
Replace shutdownhook_establish(9) with pmf_device_register1(9).
Compile test only.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/aic6915.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/aic6915var.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/aic6915.c
diff -u src/sys/dev/ic/aic6915.c:1.24 src/sys/dev/ic/aic6915.c:1.25
--- src/sys/dev/ic/aic6915.c:1.24	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/aic6915.c	Sun Sep 27 10:00:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic6915.c,v 1.24 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: aic6915.c,v 1.25 2009/09/27 10:00:11 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.24 2009/05/12 14:25:17 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.25 2009/09/27 10:00:11 tsutsui Exp $");
 
 #include "bpfilter.h"
 
@@ -75,7 +75,7 @@
 static int	sf_init(struct ifnet *);
 static void	sf_stop(struct ifnet *, int);
 
-static void	sf_shutdown(void *);
+static bool	sf_shutdown(device_t, int);
 
 static void	sf_txintr(struct sf_softc *);
 static void	sf_rxintr(struct sf_softc *);
@@ -291,9 +291,11 @@
 	/*
 	 * Make sure the interface is shutdown during reboot.
 	 */
-	sc->sc_sdhook = shutdownhook_establish(sf_shutdown, sc);
-	if (sc->sc_sdhook == NULL)
-		aprint_error_dev(&sc->sc_dev, "WARNING: unable to establish shutdown hook\n");
+	if (pmf_device_register1(&sc->sc_dev, NULL, NULL, sf_shutdown))
+		pmf_class_network_register(&sc->sc_dev, ifp);
+	else
+		aprint_error_dev(&sc->sc_dev,
+		    "couldn't establish power handler\n");
 	return;
 
 	/*
@@ -329,12 +331,15 @@
  *
  *	Shutdown hook -- make sure the interface is stopped at reboot.
  */
-static void
-sf_shutdown(void *arg)
+static bool
+sf_shutdown(device_t self, int howto)
 {
-	struct sf_softc *sc = arg;
+	struct sf_softc *sc;
 
+	sc = device_private(self);
 	sf_stop(&sc->sc_ethercom.ec_if, 1);
+
+	return true;
 }
 
 /*

Index: src/sys/dev/ic/aic6915var.h
diff -u src/sys/dev/ic/aic6915var.h:1.2 src/sys/dev/ic/aic6915var.h:1.3
--- src/sys/dev/ic/aic6915var.h:1.2	Mon Apr 28 20:23:49 2008
+++ src/sys/dev/ic/aic6915var.h	Sun Sep 27 10:00:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic6915var.h,v 1.2 2008/04/28 20:23:49 martin Exp $	*/
+/*	$NetBSD: aic6915var.h,v 1.3 2009/09/27 10:00:11 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -118,7 +118,6 @@
 	bus_space_handle_t sc_sh_func;	/* sub-handle for func regs */
 	bus_dma_tag_t sc_dmat;		/* bus DMA tag */
 	struct ethercom sc_ethercom;	/* ethernet common data */
-	void *sc_sdhook;		/* shutdown hook */
 	int sc_iomapped;		/* are we I/O mapped? */
 
 	struct mii_data sc_mii;		/* MII/media information */

Reply via email to