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/vax | |
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/vax')
-rw-r--r-- | sys/arch/vax/bi/if_ni.c | 29 | ||||
-rw-r--r-- | sys/arch/vax/if/if_qe.c | 28 | ||||
-rw-r--r-- | sys/arch/vax/if/sgec.c | 33 |
3 files changed, 23 insertions, 67 deletions
diff --git a/sys/arch/vax/bi/if_ni.c b/sys/arch/vax/bi/if_ni.c index 8fe236275df..2813aed66b1 100644 --- a/sys/arch/vax/bi/if_ni.c +++ b/sys/arch/vax/bi/if_ni.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ni.c,v 1.12 2008/10/08 23:53:08 brad Exp $ */ +/* $OpenBSD: if_ni.c,v 1.13 2008/11/28 02:44:17 brad Exp $ */ /* $NetBSD: if_ni.c,v 1.15 2002/05/22 16:03:14 wiz Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. @@ -695,7 +695,6 @@ niioctl(ifp, cmd, data) caddr_t data; { struct ni_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; struct ifaddr *ifa = (struct ifaddr *)data; int s, error = 0; @@ -739,30 +738,16 @@ niioctl(ifp, cmd, data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - /* - * Update our multicast list. - */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec): - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - ni_setup(sc); - error = 0; - } - break; - default: error = ether_ioctl(ifp, &sc->sc_ec, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + ni_setup(sc); + error = 0; + } + splx(s); return (error); } diff --git a/sys/arch/vax/if/if_qe.c b/sys/arch/vax/if/if_qe.c index 736db37ff29..dfd60210414 100644 --- a/sys/arch/vax/if/if_qe.c +++ b/sys/arch/vax/if/if_qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_qe.c,v 1.23 2008/10/08 23:53:08 brad Exp $ */ +/* $OpenBSD: if_qe.c,v 1.24 2008/11/28 02:44:17 brad Exp $ */ /* $NetBSD: if_qe.c,v 1.51 2002/06/08 12:28:37 ragge Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. @@ -631,7 +631,6 @@ int qeioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct qe_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; struct ifaddr *ifa = (struct ifaddr *)data; int s, error = 0; @@ -676,29 +675,16 @@ qeioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - /* - * Update our multicast list. - */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ac): - ether_delmulti(ifr, &sc->sc_ac); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - qe_setup(sc); - error = 0; - } - break; - default: error = ether_ioctl(ifp, &sc->sc_ac, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + qe_setup(sc); + error = 0; + } + splx(s); return (error); } diff --git a/sys/arch/vax/if/sgec.c b/sys/arch/vax/if/sgec.c index 2f827913e64..db60b04e24f 100644 --- a/sys/arch/vax/if/sgec.c +++ b/sys/arch/vax/if/sgec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sgec.c,v 1.18 2008/10/09 00:17:54 brad Exp $ */ +/* $OpenBSD: sgec.c,v 1.19 2008/11/28 02:44:17 brad Exp $ */ /* $NetBSD: sgec.c,v 1.5 2000/06/04 02:14:14 matt Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. @@ -625,8 +625,8 @@ zeioctl(ifp, cmd, data) caddr_t data; { struct ze_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; s = splnet(); @@ -646,8 +646,7 @@ zeioctl(ifp, cmd, data) case SIOCSIFMEDIA: case SIOCGIFMEDIA: - error = ifmedia_ioctl(ifp, (struct ifreq *)data, - &sc->sc_ifmedia, cmd); + error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, cmd); break; case SIOCSIFFLAGS: @@ -676,30 +675,16 @@ zeioctl(ifp, cmd, data) } break; - case SIOCADDMULTI: - case SIOCDELMULTI: - /* - * Update our multicast list. - */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ac): - ether_delmulti(ifr, &sc->sc_ac); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - ze_setup(sc); - error = 0; - } - break; - default: error = ether_ioctl(ifp, &sc->sc_ac, cmd, data); } + if (error == ENETRESET) { + if (ifp->if_flags & IFF_RUNNING) + ze_setup(sc); + error = 0; + } + splx(s); return (error); } |