Module Name:    src
Committed By:   dyoung
Date:           Mon Mar 22 16:11:58 UTC 2010

Modified Files:
        src/sys/dev/ic: i82557.c

Log Message:
In fxp_detach(), fxp_stop(), first.  fxp_stop() stops the callout.
Destroy the callout in fxp_detach().


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/ic/i82557.c

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/i82557.c
diff -u src/sys/dev/ic/i82557.c:1.132 src/sys/dev/ic/i82557.c:1.133
--- src/sys/dev/ic/i82557.c:1.132	Thu Feb 25 23:40:39 2010
+++ src/sys/dev/ic/i82557.c	Mon Mar 22 16:11:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82557.c,v 1.132 2010/02/25 23:40:39 dyoung Exp $	*/
+/*	$NetBSD: i82557.c,v 1.133 2010/03/22 16:11:58 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.132 2010/02/25 23:40:39 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.133 2010/03/22 16:11:58 dyoung Exp $");
 
 #include "rnd.h"
 
@@ -2494,14 +2494,19 @@
 fxp_detach(struct fxp_softc *sc, int flags)
 {
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
-	int i;
+	int i, s;
+
+	s = splnet();
+	/* Stop the interface. Callouts are stopped in it. */
+	fxp_stop(ifp, 1);
+	splx(s);
 
 	/* Succeed now if there's no work to do. */
 	if ((sc->sc_flags & FXPF_ATTACHED) == 0)
 		return (0);
 
-	/* Unhook our tick handler. */
-	callout_stop(&sc->sc_callout);
+	/* Destroy our callout. */
+	callout_destroy(&sc->sc_callout);
 
 	if (sc->sc_flags & FXPF_MII) {
 		/* Detach all PHYs */

Reply via email to