Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Simplify activation routines: don't call mii_acti...



details:   https://anonhg.NetBSD.org/src/rev/f69daf392a66
branches:  trunk
changeset: 747449:f69daf392a66
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Sep 15 19:20:29 2009 +0000

description:
Simplify activation routines: don't call mii_activate(), it's a
no-op.  Don't block interrupts, if_deactivate() does it.
Compile-tested, only.

diffstat:

 sys/dev/ic/elink3.c  |  22 ++++++----------------
 sys/dev/ic/elinkxl.c |  20 +++++---------------
 sys/dev/ic/i82557.c  |  20 +++++---------------
 3 files changed, 16 insertions(+), 46 deletions(-)

diffs (139 lines):

diff -r 2088aeffac1c -r f69daf392a66 sys/dev/ic/elink3.c
--- a/sys/dev/ic/elink3.c       Tue Sep 15 18:37:02 2009 +0000
+++ b/sys/dev/ic/elink3.c       Tue Sep 15 19:20:29 2009 +0000
@@ -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);
 }
 
 /*
diff -r 2088aeffac1c -r f69daf392a66 sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c      Tue Sep 15 18:37:02 2009 +0000
+++ b/sys/dev/ic/elinkxl.c      Tue Sep 15 19:20:29 2009 +0000
@@ -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
diff -r 2088aeffac1c -r f69daf392a66 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Tue Sep 15 18:37:02 2009 +0000
+++ b/sys/dev/ic/i82557.c       Tue Sep 15 19:20:29 2009 +0000
@@ -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);
 }
 
 /*



Home | Main Index | Thread Index | Old Index