diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-04-15 04:10:07 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-04-15 04:10:07 +0000 |
commit | a21e6e3dde46fd8cec2ec4a68a670a0673adfd11 (patch) | |
tree | 47bffa4ed4720daabec1861f69e78a608be8cc92 | |
parent | e283eb5dccbe91011ea7295742b8da443b784500 (diff) |
check for IFF_RUNNING being set before calling gem_init().
-rw-r--r-- | sys/dev/ic/gem.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index e22f9468f02..401b11f23c9 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.57 2006/03/25 22:41:43 djm Exp $ */ +/* $OpenBSD: gem.c,v 1.58 2006/04/15 04:10:06 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -691,11 +691,6 @@ gem_init(struct ifnet *ifp) s = splnet(); - if (ifp->if_flags & IFF_RUNNING) { - splx(s); - return (0); - } - DPRINTF(sc, ("%s: gem_init: calling stop\n", sc->sc_dev.dv_xname)); /* * Initialization sequence. The numbered steps below correspond @@ -1091,10 +1086,8 @@ gem_intr(v) printf("%s: MAC tx fault, status %x\n", sc->sc_dev.dv_xname, txstat); #endif - if (txstat & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) { - ifp->if_flags &= ~IFF_RUNNING; + if (txstat & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) gem_init(ifp); - } } if (status & GEM_INTR_RX_MAC) { int rxstat = bus_space_read_4(t, seb, GEM_MAC_RX_STATUS); @@ -1109,7 +1102,6 @@ gem_intr(v) */ if (rxstat & GEM_MAC_RX_OVERFLOW) { ifp->if_ierrors++; - ifp->if_flags &= ~IFF_RUNNING; gem_init(ifp); } #ifdef GEM_DEBUG @@ -1138,7 +1130,6 @@ gem_watchdog(ifp) ++ifp->if_oerrors; /* Try to get more packets going. */ - ifp->if_flags &= ~IFF_RUNNING; gem_init(ifp); } @@ -1369,16 +1360,12 @@ gem_ioctl(ifp, cmd, data) case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - gem_init(ifp); - switch (ifa->ifa_addr->sa_family) { + if ((ifp->if_flags & IFF_RUNNING) == 0) + gem_init(ifp); #ifdef INET - case AF_INET: + if (ifa->ifa_addr->sa_family == AF_INET) arp_ifinit(&sc->sc_arpcom, ifa); - break; #endif - default: - break; - } break; case SIOCSIFFLAGS: @@ -1387,8 +1374,10 @@ gem_ioctl(ifp, cmd, data) ((ifp->if_flags ^ sc->sc_if_flags) & (IFF_ALLMULTI | IFF_PROMISC)) != 0) gem_setladrf(sc); - else - gem_init(ifp); + else { + if ((ifp->if_flags & IFF_RUNNING) == 0) + gem_init(ifp); + } } else { if (ifp->if_flags & IFF_RUNNING) gem_stop(ifp, 1); |