Module Name: src Committed By: dyoung Date: Tue Sep 15 19:20:30 UTC 2009
Modified Files: src/sys/dev/ic: elink3.c elinkxl.c i82557.c Log Message: Simplify activation routines: don't call mii_activate(), it's a no-op. Don't block interrupts, if_deactivate() does it. Compile-tested, only. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/dev/ic/elink3.c cvs rdiff -u -r1.108 -r1.109 src/sys/dev/ic/elinkxl.c cvs rdiff -u -r1.129 -r1.130 src/sys/dev/ic/i82557.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/elink3.c diff -u src/sys/dev/ic/elink3.c:1.128 src/sys/dev/ic/elink3.c:1.129 --- src/sys/dev/ic/elink3.c:1.128 Sat Sep 5 12:30:59 2009 +++ src/sys/dev/ic/elink3.c Tue Sep 15 19:20:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: elink3.c,v 1.128 2009/09/05 12:30:59 tsutsui Exp $ */ +/* $NetBSD: elink3.c,v 1.129 2009/09/15 19:20:29 dyoung Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.128 2009/09/05 12:30:59 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.129 2009/09/15 19:20:29 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -2002,24 +2002,14 @@ ep_activate(device_t self, enum devact act) { struct ep_softc *sc = device_private(self); - struct ifnet *ifp = &sc->sc_ethercom.ec_if; - int error = 0, s; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - error = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: - if (sc->ep_flags & ELINK_FLAGS_MII) - mii_activate(&sc->sc_mii, act, MII_PHY_ANY, - MII_OFFSET_ANY); - if_deactivate(ifp); - break; + if_deactivate(&sc->sc_ethercom.ec_if); + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return (error); } /* Index: src/sys/dev/ic/elinkxl.c diff -u src/sys/dev/ic/elinkxl.c:1.108 src/sys/dev/ic/elinkxl.c:1.109 --- src/sys/dev/ic/elinkxl.c:1.108 Sat Sep 5 14:19:30 2009 +++ src/sys/dev/ic/elinkxl.c Tue Sep 15 19:20:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.108 2009/09/05 14:19:30 tsutsui Exp $ */ +/* $NetBSD: elinkxl.c,v 1.109 2009/09/15 19:20:30 dyoung Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.108 2009/09/05 14:19:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.109 2009/09/15 19:20:30 dyoung Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -1679,24 +1679,14 @@ ex_activate(device_t self, enum devact act) { struct ex_softc *sc = device_private(self); - int s, error = 0; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - error = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: - if (sc->ex_conf & EX_CONF_MII) - mii_activate(&sc->ex_mii, act, MII_PHY_ANY, - MII_OFFSET_ANY); if_deactivate(&sc->sc_ethercom.ec_if); - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - - return (error); } int Index: src/sys/dev/ic/i82557.c diff -u src/sys/dev/ic/i82557.c:1.129 src/sys/dev/ic/i82557.c:1.130 --- src/sys/dev/ic/i82557.c:1.129 Mon Mar 16 12:13:04 2009 +++ src/sys/dev/ic/i82557.c Tue Sep 15 19:20:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.129 2009/03/16 12:13:04 tsutsui Exp $ */ +/* $NetBSD: i82557.c,v 1.130 2009/09/15 19:20:30 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.129 2009/03/16 12:13:04 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.130 2009/09/15 19:20:30 dyoung Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -2482,24 +2482,14 @@ fxp_activate(device_t self, enum devact act) { struct fxp_softc *sc = device_private(self); - int s, error = 0; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - error = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: - if (sc->sc_flags & FXPF_MII) - mii_activate(&sc->sc_mii, act, MII_PHY_ANY, - MII_OFFSET_ANY); if_deactivate(&sc->sc_ethercom.ec_if); - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - - return (error); } /*