From 7da313a2f65e39b86488c21555c356ca3a9100e5 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 28 Nov 2008 02:44:19 +0000 Subject: 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@ --- sys/arch/socppc/dev/if_tsec.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'sys/arch/socppc/dev') diff --git a/sys/arch/socppc/dev/if_tsec.c b/sys/arch/socppc/dev/if_tsec.c index 6ac28f5fd99..67ec14712b9 100644 --- a/sys/arch/socppc/dev/if_tsec.c +++ b/sys/arch/socppc/dev/if_tsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tsec.c,v 1.13 2008/10/15 19:12:19 blambert Exp $ */ +/* $OpenBSD: if_tsec.c,v 1.14 2008/11/28 02:44:17 brad Exp $ */ /* * Copyright (c) 2008 Mark Kettenis @@ -480,26 +480,6 @@ tsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) } break; - case SIOCSIFMTU: - if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu) - error = EINVAL; - else if (ifp->if_mtu != ifr->ifr_mtu) - ifp->if_mtu = ifr->ifr_mtu; - break; - - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ac) : - ether_delmulti(ifr, &sc->sc_ac); - - if (error == ENETRESET) { - if (ifp->if_flags & IFF_RUNNING) - tsec_iff(sc); - error = 0; - } - break; - case SIOCGIFMEDIA: case SIOCSIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); @@ -510,6 +490,12 @@ tsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) break; } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + tsec_iff(sc); + error = 0; + } + splx(s); return (error); } -- cgit v1.2.3