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/macppc | |
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/macppc')
-rw-r--r-- | sys/arch/macppc/dev/if_bm.c | 29 | ||||
-rw-r--r-- | sys/arch/macppc/dev/if_mc.c | 26 |
2 files changed, 16 insertions, 39 deletions
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index d47a3251c0d..26471c4e44c 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bm.c,v 1.24 2008/10/15 19:12:19 blambert Exp $ */ +/* $OpenBSD: if_bm.c,v 1.25 2008/11/28 02:44:17 brad Exp $ */ /* $NetBSD: if_bm.c,v 1.1 1999/01/01 01:27:52 tsubai Exp $ */ /*- @@ -801,25 +801,6 @@ bmac_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #endif break; - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->arpcom) : - ether_delmulti(ifr, &sc->arpcom); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) { - bmac_init(sc); - bmac_setladrf(sc); - } - error = 0; - } - break; - case SIOCGIFMEDIA: case SIOCSIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd); @@ -829,6 +810,14 @@ bmac_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ether_ioctl(ifp, &sc->arpcom, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) { + bmac_init(sc); + bmac_setladrf(sc); + } + error = 0; + } + splx(s); return (error); } diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c index e2a6e928655..2f24b75bda5 100644 --- a/sys/arch/macppc/dev/if_mc.c +++ b/sys/arch/macppc/dev/if_mc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mc.c,v 1.12 2008/10/08 23:53:08 brad Exp $ */ +/* $OpenBSD: if_mc.c,v 1.13 2008/11/28 02:44:17 brad Exp $ */ /* $NetBSD: if_mc.c,v 1.9.16.1 2006/06/21 14:53:13 yamt Exp $ */ /*- @@ -496,7 +496,6 @@ mc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct mc_softc *sc = ifp->if_softc; struct ifaddr *ifa = (struct ifaddr *)data; - struct ifreq *ifr; int s, err = 0; s = splnet(); @@ -537,27 +536,16 @@ mc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - ifr = (struct ifreq *) data; - err = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_arpcom) : - ether_delmulti(ifr, &sc->sc_arpcom); - - if (err == ENETRESET) { - /* - * Multicast list has changed; set the hardware - * filter accordingly. But remember UP flag! - */ - if (ifp->if_flags & IFF_RUNNING) - mc_reset(sc); - err = 0; - } - break; default: err = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + if (err == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + mc_reset(sc); + err = 0; + } + splx(s); return (err); } |