Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Make sure to untimeout() things on detach.



details:   https://anonhg.NetBSD.org/src/rev/1f3e73500269
branches:  trunk
changeset: 481579:1f3e73500269
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed Feb 02 08:57:51 2000 +0000

description:
Make sure to untimeout() things on detach.

diffstat:

 sys/dev/ic/elink3.c    |  15 +++++++++------
 sys/dev/ic/elink3var.h |   4 ++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diffs (79 lines):

diff -r aea6d9ceafbf -r 1f3e73500269 sys/dev/ic/elink3.c
--- a/sys/dev/ic/elink3.c       Wed Feb 02 08:41:00 2000 +0000
+++ b/sys/dev/ic/elink3.c       Wed Feb 02 08:57:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elink3.c,v 1.70 2000/02/02 08:41:00 augustss Exp $     */
+/*     $NetBSD: elink3.c,v 1.71 2000/02/02 08:57:51 augustss Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -520,7 +520,7 @@
        sc->tx_start_thresh = 20;       /* probably a good starting point. */
 
        /*  Establish callback to reset card when we reboot. */
-       sc->shutdown_hook = shutdownhook_establish(epshutdown, sc);
+       sc->sd_hook = shutdownhook_establish(epshutdown, sc);
 
        ep_reset_cmd(sc, ELINK_COMMAND, RX_RESET);
        ep_reset_cmd(sc, ELINK_COMMAND, TX_RESET);
@@ -2111,12 +2111,12 @@
 {
        struct ep_softc *sc = (struct ep_softc *)self;
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
-       int rv = 0, s;
+       int error = 0, s;
 
        s = splnet();
        switch (act) {
        case DVACT_ACTIVATE:
-               rv = EOPNOTSUPP;
+               error = EOPNOTSUPP;
                break;
 
        case DVACT_DEACTIVATE:
@@ -2124,7 +2124,7 @@
                break;
        }
        splx(s);
-       return (rv);
+       return (error);
 }
 
 int
@@ -2137,6 +2137,9 @@
 
        epdisable(sc);
 
+       untimeout(ep_tick, sc);
+       untimeout(epmbuffill, sc);
+
        ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
 #if NBPFILTER > 0
        bpfdetach(ifp);
@@ -2144,7 +2147,7 @@
        ether_ifdetach(ifp);
        if_detach(ifp);
 
-       shutdownhook_disestablish(sc->shutdown_hook);
+       shutdownhook_disestablish(sc->sd_hook);
 
        return (0);
 }
diff -r aea6d9ceafbf -r 1f3e73500269 sys/dev/ic/elink3var.h
--- a/sys/dev/ic/elink3var.h    Wed Feb 02 08:41:00 2000 +0000
+++ b/sys/dev/ic/elink3var.h    Wed Feb 02 08:57:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elink3var.h,v 1.22 2000/02/02 08:00:22 augustss Exp $  */
+/*     $NetBSD: elink3var.h,v 1.23 2000/02/02 08:57:52 augustss Exp $  */
 
 /*
  * Copyright (c) 1994 Herb Peyerl <hpeyerl%beer.org@localhost>
@@ -100,7 +100,7 @@
        rndsource_element_t rnd_source;
 #endif
 
-       void *shutdown_hook;
+       void *sd_hook;
 
        /* power management hooks */
        int (*enable) __P((struct ep_softc *));



Home | Main Index | Thread Index | Old Index