From 69a4436f8ba4a0486b4c2aff1e6b6cc6b3803c73 Mon Sep 17 00:00:00 2001 From: thorpej Date: Wed, 17 Feb 1999 03:40:59 +0000 Subject: [PATCH] Avoid initializing the interface in the SIOCSIFFLAGS if ! UP and ! RUNNING. --- sys/dev/ic/dp8390.c | 4 ++-- sys/dev/ic/elink3.c | 4 ++-- sys/dev/ic/elinkxl.c | 9 +++++++-- sys/dev/ic/i82586.c | 4 ++-- sys/dev/ic/lance.c | 4 ++-- sys/dev/ic/mb86960.c | 4 ++-- sys/dev/ic/smc91cxx.c | 4 ++-- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index 6cc28fa7d4bc..6358e27d1aa8 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -1,4 +1,4 @@ -/* $NetBSD: dp8390.c,v 1.20 1999/02/07 01:54:50 thorpej Exp $ */ +/* $NetBSD: dp8390.c,v 1.21 1999/02/17 03:40:59 thorpej Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -890,7 +890,7 @@ dp8390_ioctl(ifp, cmd, data) if ((error = dp8390_enable(sc)) != 0) break; dp8390_init(sc); - } else if (sc->sc_enabled) { + } else if ((ifp->if_flags & IFF_UP) != 0) { /* * Reset the interface to pick up changes in any other * flags that affect hardware registers. diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 7c637393a00f..13143dcd2235 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $NetBSD: elink3.c,v 1.51 1998/12/12 16:36:24 mycroft Exp $ */ +/* $NetBSD: elink3.c,v 1.52 1999/02/17 03:41:00 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -1725,7 +1725,7 @@ epioctl(ifp, cmd, data) if ((error = epenable(sc)) != 0) break; epinit(sc); - } else if (sc->enabled) { + } else if ((ifp->if_flags & IFF_UP) != 0) { /* * deal with flags changes: * IFF_MULTICAST, IFF_PROMISC. diff --git a/sys/dev/ic/elinkxl.c b/sys/dev/ic/elinkxl.c index 84900ed7ab65..0e4e803cd8ce 100644 --- a/sys/dev/ic/elinkxl.c +++ b/sys/dev/ic/elinkxl.c @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.3 1999/01/10 14:19:46 drochner Exp $ */ +/* $NetBSD: elinkxl.c,v 1.4 1999/02/17 03:41:00 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -1299,8 +1299,13 @@ ex_ioctl(ifp, cmd, data) * start it. */ ex_init(sc); - } else + } else if ((ifp->if_flags & IFF_UP) != 0) { + /* + * Deal with other flags that change hardware + * state, i.e. IFF_PROMISC. + */ ex_set_mc(sc); + } break; case SIOCADDMULTI: diff --git a/sys/dev/ic/i82586.c b/sys/dev/ic/i82586.c index 31da2d3be98d..16697496407e 100644 --- a/sys/dev/ic/i82586.c +++ b/sys/dev/ic/i82586.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82586.c,v 1.19 1998/12/12 16:58:10 mycroft Exp $ */ +/* $NetBSD: i82586.c,v 1.20 1999/02/17 03:41:00 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -2026,7 +2026,7 @@ i82586_ioctl(ifp, cmd, data) * start it. */ i82586_init(sc); - } else { + } else if ((ifp->if_flags & IFF_UP) != 0) { /* * Reset the interface to pick up changes in any other * flags that affect hardware registers. diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c index 88cd81845c17..15607da42158 100644 --- a/sys/dev/ic/lance.c +++ b/sys/dev/ic/lance.c @@ -1,4 +1,4 @@ -/* $NetBSD: lance.c,v 1.5 1998/12/12 16:58:10 mycroft Exp $ */ +/* $NetBSD: lance.c,v 1.6 1999/02/17 03:41:01 thorpej Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -654,7 +654,7 @@ lance_ioctl(ifp, cmd, data) * start it. */ lance_init(sc); - } else { + } else if ((ifp->if_flags & IFF_UP) != 0) { /* * Reset the interface to pick up changes in any other * flags that affect hardware registers. diff --git a/sys/dev/ic/mb86960.c b/sys/dev/ic/mb86960.c index 5fd21bd2f446..89d65cea4d3f 100644 --- a/sys/dev/ic/mb86960.c +++ b/sys/dev/ic/mb86960.c @@ -1,4 +1,4 @@ -/* $NetBSD: mb86960.c,v 1.29 1998/12/03 23:33:45 pk Exp $ */ +/* $NetBSD: mb86960.c,v 1.30 1999/02/17 03:41:01 thorpej Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -1251,7 +1251,7 @@ mb86960_ioctl(ifp, cmd, data) if ((error = mb86960_enable(sc)) != 0) break; mb86960_init(sc); - } else if (sc->sc_enabled) { + } else if ((ifp->if_flags & IFF_UP) != 0) { /* * Reset the interface to pick up changes in any other * flags that affect hardware registers. diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c index 61f641f5994d..b5a84753e3f0 100644 --- a/sys/dev/ic/smc91cxx.c +++ b/sys/dev/ic/smc91cxx.c @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.13 1998/11/18 18:34:52 thorpej Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.14 1999/02/17 03:41:01 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -1056,7 +1056,7 @@ smc91cxx_ioctl(ifp, cmd, data) if ((error = smc91cxx_enable(sc)) != 0) break; smc91cxx_init(sc); - } else if (sc->sc_enabled) { + } else if ((ifp->if_flags & IFF_UP) != 0) { /* * Reset the interface to pick up changes in any * other flags that affect hardware registers.