diff options
author | 2008-11-28 02:44:17 +0000 | |
---|---|---|
committer | 2008-11-28 02:44:17 +0000 | |
commit | 34f0f0fd1c54e0d34e58050bb846537e88e7a968 (patch) | |
tree | 2aab646cb12e9ca85bddc28715f323aaf67dd81e /sys/dev/isa/if_ex.c | |
parent | Make growfs refuse to run on a dirty filesystem, and set the filesystem to (diff) | |
download | wireguard-openbsd-34f0f0fd1c54e0d34e58050bb846537e88e7a968.tar.xz wireguard-openbsd-34f0f0fd1c54e0d34e58050bb846537e88e7a968.zip |
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/dev/isa/if_ex.c')
-rw-r--r-- | sys/dev/isa/if_ex.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/sys/dev/isa/if_ex.c b/sys/dev/isa/if_ex.c index 0bb810f82c7..e9ab96f0532 100644 --- a/sys/dev/isa/if_ex.c +++ b/sys/dev/isa/if_ex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ex.c,v 1.34 2008/11/22 13:14:35 oga Exp $ */ +/* $OpenBSD: if_ex.c,v 1.35 2008/11/28 02:44:17 brad Exp $ */ /* * Copyright (c) 1997, Donald A. Schmidt * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) @@ -737,8 +737,8 @@ ex_rx_intr(struct ex_softc *sc) int ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ifaddr *ifa = (struct ifaddr *) data; struct ex_softc *sc = ifp->if_softc; + struct ifaddr *ifa = (struct ifaddr *) data; struct ifreq *ifr = (struct ifreq *) data; int s, error = 0; @@ -765,25 +765,6 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } else ex_init(sc); break; - case SIOCSIFMTU: - DODEBUG(Start_End, printf("SIOCSIFMTU");); - if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) - 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->arpcom) - : ether_delmulti(ifr, &sc->arpcom); - - if (error == ENETRESET) { - if (ifp->if_flags & IFF_RUNNING) - ex_init(sc); - error = 0; - } - break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, cmd); @@ -792,6 +773,12 @@ ex_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) + ex_init(sc); + error = 0; + } + splx(s); DODEBUG(Start_End, printf("\nex_ioctl: finish\n");); return(error); |