diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-11-28 02:44:19 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-11-28 02:44:19 +0000 |
commit | 7da313a2f65e39b86488c21555c356ca3a9100e5 (patch) | |
tree | 391b806058ca43cb3ba624dce63764bce2b9b2b1 /sys/arch/sparc | |
parent | 37778efb0de37bd00e9269e32ac772f743cce430 (diff) |
Eliminate the redundant bits of code for MTU and multicast handling
from the individual drivers now that ether_ioctl() handles this.
Shrinks the i386 kernels by..
RAMDISK - 2176 bytes
RAMDISKB - 1504 bytes
RAMDISKC - 736 bytes
Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users.
Build tested on almost all archs by todd@/brad@
ok naddy@
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/dev/be.c | 25 | ||||
-rw-r--r-- | sys/arch/sparc/dev/hme.c | 25 | ||||
-rw-r--r-- | sys/arch/sparc/dev/if_ie.c | 26 | ||||
-rw-r--r-- | sys/arch/sparc/dev/qe.c | 25 |
4 files changed, 31 insertions, 70 deletions
diff --git a/sys/arch/sparc/dev/be.c b/sys/arch/sparc/dev/be.c index ed47a39d63a..cbdc6652e55 100644 --- a/sys/arch/sparc/dev/be.c +++ b/sys/arch/sparc/dev/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.42 2008/10/15 19:12:19 blambert Exp $ */ +/* $OpenBSD: be.c,v 1.43 2008/11/28 02:44:17 brad Exp $ */ /* * Copyright (c) 1998 Theo de Raadt and Jason L. Wright. @@ -615,30 +615,21 @@ beioctl(ifp, cmd, data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_arpcom): - ether_delmulti(ifr, &sc->sc_arpcom); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - be_mcreset(sc); - error = 0; - } - break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, cmd); break; + default: error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + be_mcreset(sc); + error = 0; + } + splx(s); return error; } diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c index ef974a765cd..d67279ce6ef 100644 --- a/sys/arch/sparc/dev/hme.c +++ b/sys/arch/sparc/dev/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.57 2008/10/14 18:01:53 naddy Exp $ */ +/* $OpenBSD: hme.c,v 1.58 2008/11/28 02:44:17 brad Exp $ */ /* * Copyright (c) 1998 Jason L. Wright (jason@thought.net) @@ -440,30 +440,21 @@ hmeioctl(ifp, cmd, data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_arpcom): - ether_delmulti(ifr, &sc->sc_arpcom); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - hme_mcreset(sc); - error = 0; - } - break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd); break; + default: error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + hme_mcreset(sc); + error = 0; + } + sc->sc_if_flags = ifp->if_flags; splx(s); return (error); diff --git a/sys/arch/sparc/dev/if_ie.c b/sys/arch/sparc/dev/if_ie.c index b26ae16859d..216ead5c32c 100644 --- a/sys/arch/sparc/dev/if_ie.c +++ b/sys/arch/sparc/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.38 2008/10/02 20:21:13 brad Exp $ */ +/* $OpenBSD: if_ie.c,v 1.39 2008/11/28 02:44:17 brad Exp $ */ /* $NetBSD: if_ie.c,v 1.33 1997/07/29 17:55:38 fair Exp $ */ /*- @@ -1948,7 +1948,6 @@ ieioctl(ifp, cmd, data) { struct ie_softc *sc = ifp->if_softc; struct ifaddr *ifa = (struct ifaddr *)data; - struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; s = splnet(); @@ -2003,27 +2002,16 @@ ieioctl(ifp, cmd, data) #endif break; - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_arpcom): - ether_delmulti(ifr, &sc->sc_arpcom); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - mc_reset(sc); - error = 0; - } - break; - default: error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + mc_reset(sc); + error = 0; + } + splx(s); return error; } diff --git a/sys/arch/sparc/dev/qe.c b/sys/arch/sparc/dev/qe.c index 360ee17842a..44f5bfa8d3b 100644 --- a/sys/arch/sparc/dev/qe.c +++ b/sys/arch/sparc/dev/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.31 2008/10/02 20:21:13 brad Exp $ */ +/* $OpenBSD: qe.c,v 1.32 2008/11/28 02:44:17 brad Exp $ */ /* * Copyright (c) 1998, 2000 Jason L. Wright. @@ -634,30 +634,21 @@ qeioctl(ifp, cmd, data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_arpcom): - ether_delmulti(ifr, &sc->sc_arpcom); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - qeinit(sc); - error = 0; - } - break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, cmd); break; + default: error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + qeinit(sc); + error = 0; + } + splx(s); return (error); } |