Module Name:    src
Committed By:   dyoung
Date:           Mon Mar 22 17:11:19 UTC 2010

Modified Files:
        src/sys/dev/ic: elinkxl.c elinkxlvar.h

Log Message:
Add a self-suspensor.  It's not used, yet.

In ex_detach(), call ex_stop(), first.  ex_stop() stops the callout.
Destroy the callout in ex_detach().


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/ic/elinkxl.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/elinkxlvar.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/elinkxl.c
diff -u src/sys/dev/ic/elinkxl.c:1.110 src/sys/dev/ic/elinkxl.c:1.111
--- src/sys/dev/ic/elinkxl.c:1.110	Tue Jan 19 22:06:24 2010
+++ src/sys/dev/ic/elinkxl.c	Mon Mar 22 17:11:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: elinkxl.c,v 1.110 2010/01/19 22:06:24 pooka Exp $	*/
+/*	$NetBSD: elinkxl.c,v 1.111 2010/03/22 17:11:19 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.110 2010/01/19 22:06:24 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.111 2010/03/22 17:11:19 dyoung Exp $");
 
 #include "rnd.h"
 
@@ -181,6 +181,8 @@
 	bus_space_handle_t ioh = sc->sc_ioh;
 	int i, error, attach_stage;
 
+	pmf_self_suspensor_init(sc->sc_dev, &sc->sc_suspensor, &sc->sc_qual);
+
 	callout_init(&sc->ex_mii_callout, 0);
 
 	ex_reset(sc);
@@ -1688,14 +1690,19 @@
 {
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
 	struct ex_rxdesc *rxd;
-	int i;
+	int i, s;
 
 	/* Succeed now if there's no work to do. */
 	if ((sc->ex_flags & EX_FLAGS_ATTACHED) == 0)
 		return (0);
 
-	/* Unhook our tick handler. */
-	callout_stop(&sc->ex_mii_callout);
+	s = splnet();
+	/* Stop the interface. Callouts are stopped in it. */
+	ex_stop(ifp, 1);
+	splx(s);
+
+	/* Destroy our callout. */
+	callout_destroy(&sc->ex_mii_callout);
 
 	if (sc->ex_conf & EX_CONF_MII) {
 		/* Detach all PHYs */

Index: src/sys/dev/ic/elinkxlvar.h
diff -u src/sys/dev/ic/elinkxlvar.h:1.20 src/sys/dev/ic/elinkxlvar.h:1.21
--- src/sys/dev/ic/elinkxlvar.h:1.20	Mon Apr 28 20:23:49 2008
+++ src/sys/dev/ic/elinkxlvar.h	Mon Mar 22 17:11:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: elinkxlvar.h,v 1.20 2008/04/28 20:23:49 martin Exp $	*/
+/*	$NetBSD: elinkxlvar.h,v 1.21 2010/03/22 17:11:19 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -40,6 +40,8 @@
  */
 struct ex_softc {
 	device_t sc_dev;
+	device_suspensor_t sc_suspensor;
+	pmf_qual_t sc_qual;
 	void *sc_ih;
 
 	struct ethercom sc_ethercom;	/* Ethernet common part		*/

Reply via email to