Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic In fxp_detach(), fxp_stop(), first. fxp_stop() s...



details:   https://anonhg.NetBSD.org/src/rev/19316a3f7139
branches:  trunk
changeset: 753295:19316a3f7139
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Mon Mar 22 16:11:58 2010 +0000

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

diffstat:

 sys/dev/ic/i82557.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r bba272333afc -r 19316a3f7139 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Mon Mar 22 15:08:35 2010 +0000
+++ b/sys/dev/ic/i82557.c       Mon Mar 22 16:11:58 2010 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index