summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_nfe.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-04-26 01:20:29 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-04-26 01:20:29 +0000
commit8d1a92a7bf116579515b6972ddcadff3c581f349 (patch)
tree4241c777114b4eea4be748f896a5fe6110ad22db /sys/dev/pci/if_nfe.c
parent604b19adb54a4aec58ff6d5ec6c7894e48c111e7 (diff)
check for IFF_RUNNING being set before calling nfe_init().
ok damien@ jsg@
Diffstat (limited to 'sys/dev/pci/if_nfe.c')
-rw-r--r--sys/dev/pci/if_nfe.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c
index cde2a3ea7d2..b9e494408a7 100644
--- a/sys/dev/pci/if_nfe.c
+++ b/sys/dev/pci/if_nfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfe.c,v 1.54 2006/04/07 12:38:12 jsg Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.55 2006/04/26 01:20:28 brad Exp $ */
/*-
* Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -302,7 +302,6 @@ nfe_power(int why, void *arg)
if (why == PWR_RESUME) {
ifp = &sc->sc_arpcom.ac_if;
if (ifp->if_flags & IFF_UP) {
- ifp->if_flags &= ~IFF_RUNNING;
nfe_init(ifp);
if (ifp->if_flags & IFF_RUNNING)
nfe_start(ifp);
@@ -472,14 +471,12 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
- nfe_init(ifp);
- switch (ifa->ifa_addr->sa_family) {
+ if (!(ifp->if_flags & IFF_RUNNING))
+ nfe_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;
@@ -502,10 +499,12 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
*/
if ((ifp->if_flags & IFF_RUNNING) &&
((ifp->if_flags ^ sc->sc_if_flags) &
- (IFF_ALLMULTI | IFF_PROMISC)) != 0)
+ (IFF_ALLMULTI | IFF_PROMISC)) != 0) {
nfe_setmulti(sc);
- else
- nfe_init(ifp);
+ } else {
+ if (!(ifp->if_flags & IFF_RUNNING))
+ nfe_init(ifp);
+ }
} else {
if (ifp->if_flags & IFF_RUNNING)
nfe_stop(ifp, 1);
@@ -1006,7 +1005,6 @@ nfe_watchdog(struct ifnet *ifp)
printf("%s: watchdog timeout\n", sc->sc_dev.dv_xname);
- ifp->if_flags &= ~IFF_RUNNING;
nfe_init(ifp);
ifp->if_oerrors++;
@@ -1018,9 +1016,6 @@ nfe_init(struct ifnet *ifp)
struct nfe_softc *sc = ifp->if_softc;
uint32_t tmp;
- if (ifp->if_flags & IFF_RUNNING)
- return 0;
-
nfe_stop(ifp, 0);
NFE_WRITE(sc, NFE_TX_UNK, 0);