diff options
| author | dyoung <dyoung@NetBSD.org> | 2007-09-01 07:32:22 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2007-09-01 07:32:22 +0000 |
| commit | dcd89234297aa3b534c5ebf5dbeed011892cf0f0 (patch) | |
| tree | 99d2ce40cafbafb96449da886d2559788f9cf586 /sys/dev | |
| parent | 9bee2cd7f153f3c94c3828d72228f8a2461c68f5 (diff) | |
Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);
if (error == ENETRESET) {
to this,
if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
which does the same thing.
(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)
Use ifreq_getaddr() twice in es(4).
Whitespace nits.
Diffstat (limited to 'sys/dev')
35 files changed, 127 insertions, 259 deletions
diff --git a/sys/dev/bi/if_ni.c b/sys/dev/bi/if_ni.c index 67e356dece1..c787a2a7dc0 100644 --- a/sys/dev/bi/if_ni.c +++ b/sys/dev/bi/if_ni.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ni.c,v 1.30 2007/03/08 23:17:56 he Exp $ */ +/* $NetBSD: if_ni.c,v 1.31 2007/09/01 07:32:25 dyoung Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.30 2007/03/08 23:17:56 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.31 2007/09/01 07:32:25 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -749,11 +749,7 @@ niioctl(ifp, cmd, data) /* * Update our multicast list. */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec): - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 6056e7a12d5..09079b61df6 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $NetBSD: ath.c,v 1.85 2007/08/29 22:33:42 dyoung Exp $ */ +/* $NetBSD: ath.c,v 1.86 2007/09/01 07:32:25 dyoung Exp $ */ /*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.85 2007/08/29 22:33:42 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.86 2007/09/01 07:32:25 dyoung Exp $"); #endif /* @@ -5263,10 +5263,7 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, void *data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) ath_mode_init(sc); error = 0; diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index 6f150b0f769..34c04a6dfd7 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.127 2007/07/09 21:00:34 ad Exp $ */ +/* $NetBSD: atw.c,v 1.128 2007/09/01 07:32:25 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.127 2007/07/09 21:00:34 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.128 2007/09/01 07:32:25 dyoung Exp $"); #include "bpfilter.h" @@ -3851,7 +3851,6 @@ int atw_ioctl(struct ifnet *ifp, u_long cmd, void *data) { struct atw_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; /* XXX monkey see, monkey do. comes from wi_ioctl. */ @@ -3877,10 +3876,7 @@ atw_ioctl(struct ifnet *ifp, u_long cmd, void *data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) atw_filter_setup(sc); /* do not rescan */ error = 0; diff --git a/sys/dev/ic/awi.c b/sys/dev/ic/awi.c index e47befdc2ff..abe81fd42df 100644 --- a/sys/dev/ic/awi.c +++ b/sys/dev/ic/awi.c @@ -1,4 +1,4 @@ -/* $NetBSD: awi.c,v 1.75 2007/08/26 22:45:55 dyoung Exp $ */ +/* $NetBSD: awi.c,v 1.76 2007/09/01 07:32:26 dyoung Exp $ */ /*- * Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc. @@ -86,7 +86,7 @@ #include <sys/cdefs.h> #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.75 2007/08/26 22:45:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.76 2007/09/01 07:32:26 dyoung Exp $"); #endif #ifdef __FreeBSD__ __FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.30 2004/01/15 13:30:06 onoe Exp $"); @@ -954,9 +954,7 @@ awi_ioctl(struct ifnet *ifp, u_long cmd, void *data) #ifdef __FreeBSD__ error = ENETRESET; /* XXX */ #else - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); + error = ether_ioctl(ifp, cmd, data); #endif if (error == ENETRESET) { /* do not rescan */ diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index 78294e6d28c..f26007b236e 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -1,4 +1,4 @@ -/* $NetBSD: dp8390.c,v 1.64 2007/08/26 22:45:55 dyoung Exp $ */ +/* $NetBSD: dp8390.c,v 1.65 2007/09/01 07:32:26 dyoung Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -14,7 +14,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.64 2007/08/26 22:45:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.65 2007/09/01 07:32:26 dyoung Exp $"); #include "opt_ipkdb.h" #include "opt_inet.h" @@ -928,11 +928,7 @@ dp8390_ioctl(ifp, cmd, data) } /* Update our multicast list. */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index 6ee33f1d738..58069cd8df9 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $NetBSD: hme.c,v 1.58 2007/07/12 17:42:17 martin Exp $ */ +/* $NetBSD: hme.c,v 1.59 2007/09/01 07:32:26 dyoung Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.58 2007/07/12 17:42:17 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.59 2007/09/01 07:32:26 dyoung Exp $"); /* #define HMEDEBUG */ @@ -1497,11 +1497,7 @@ hme_ioctl(ifp, cmd, data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c index 87b28633eea..9df40a0afdc 100644 --- a/sys/dev/ic/lance.c +++ b/sys/dev/ic/lance.c @@ -1,4 +1,4 @@ -/* $NetBSD: lance.c,v 1.38 2007/03/04 06:01:57 christos Exp $ */ +/* $NetBSD: lance.c,v 1.39 2007/09/01 07:32:26 dyoung Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.38 2007/03/04 06:01:57 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.39 2007/09/01 07:32:26 dyoung Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -567,20 +567,13 @@ lance_ioctl(ifp, cmd, data) s = splnet(); switch (cmd) { - case SIOCSIFADDR: case SIOCSIFFLAGS: error = ether_ioctl(ifp, cmd, data); break; - - case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c index 5447b4dfaaa..fdc8c62a061 100644 --- a/sys/dev/ic/lemac.c +++ b/sys/dev/ic/lemac.c @@ -1,4 +1,4 @@ -/* $NetBSD: lemac.c,v 1.32 2007/03/04 15:35:20 yamt Exp $ */ +/* $NetBSD: lemac.c,v 1.33 2007/09/01 07:32:26 dyoung Exp $ */ /*- * Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com> @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.32 2007/03/04 15:35:20 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.33 2007/09/01 07:32:26 dyoung Exp $"); #include "opt_inet.h" #include "rnd.h" @@ -788,12 +788,7 @@ lemac_ifioctl( /* * Update multicast listeners */ - if (cmd == SIOCADDMULTI) - error = ether_addmulti((struct ifreq *)data, &sc->sc_ec); - else - error = ether_delmulti((struct ifreq *)data, &sc->sc_ec); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* reset multicast filtering */ if (ifp->if_flags & IFF_RUNNING) lemac_init(sc); diff --git a/sys/dev/ic/mb86960.c b/sys/dev/ic/mb86960.c index fa5c869995f..dae0e90e1ae 100644 --- a/sys/dev/ic/mb86960.c +++ b/sys/dev/ic/mb86960.c @@ -1,4 +1,4 @@ -/* $NetBSD: mb86960.c,v 1.66 2007/03/04 06:01:58 christos Exp $ */ +/* $NetBSD: mb86960.c,v 1.67 2007/09/01 07:32:27 dyoung Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.66 2007/03/04 06:01:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.67 2007/09/01 07:32:27 dyoung Exp $"); /* * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards. @@ -1247,11 +1247,7 @@ mb86960_ioctl(struct ifnet *ifp, u_long cmd, void *data) } /* Update our multicast list. */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/ic/mtd803.c b/sys/dev/ic/mtd803.c index a5820c88a32..46a8e0e3c54 100644 --- a/sys/dev/ic/mtd803.c +++ b/sys/dev/ic/mtd803.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtd803.c,v 1.13 2007/03/04 06:01:59 christos Exp $ */ +/* $NetBSD: mtd803.c,v 1.14 2007/09/01 07:32:27 dyoung Exp $ */ /*- * @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.13 2007/03/04 06:01:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.14 2007/09/01 07:32:27 dyoung Exp $"); #include "bpfilter.h" @@ -583,33 +583,28 @@ mtd_ioctl(ifp, cmd, data) void *data; { struct mtd_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; s = splnet(); /* Don't do anything special */ switch(cmd) { - case SIOCADDMULTI: - case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->ethercom) : - ether_delmulti(ifr, &sc->ethercom); - - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware - * filter accordingly. - */ - if (ifp->if_flags & IFF_RUNNING) - mtd_setmulti(sc); - error = 0; - } - break; + case SIOCADDMULTI: + case SIOCDELMULTI: + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { + /* + * Multicast list has changed; set the hardware + * filter accordingly. + */ + if (ifp->if_flags & IFF_RUNNING) + mtd_setmulti(sc); + error = 0; + } + break; - default: - error = ether_ioctl(ifp, cmd, data); - break; + default: + error = ether_ioctl(ifp, cmd, data); + break; } splx(s); diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c index 91eabd725d1..d1013ac367e 100644 --- a/sys/dev/ic/pdq_ifsubr.c +++ b/sys/dev/ic/pdq_ifsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: pdq_ifsubr.c,v 1.48 2007/03/04 06:01:59 christos Exp $ */ +/* $NetBSD: pdq_ifsubr.c,v 1.49 2007/09/01 07:32:27 dyoung Exp $ */ /*- * Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com> @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.48 2007/03/04 06:01:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.49 2007/09/01 07:32:27 dyoung Exp $"); #ifdef __NetBSD__ #include "opt_inet.h" @@ -463,12 +463,7 @@ pdq_ifioctl( /* * Update multicast listeners */ - if (cmd == SIOCADDMULTI) - error = ether_addmulti((struct ifreq *)data, PDQ_FDDICOM(sc)); - else - error = ether_delmulti((struct ifreq *)data, PDQ_FDDICOM(sc)); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (sc->sc_if.if_flags & IFF_RUNNING) pdq_run(sc->sc_pdq); error = 0; diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index c755c4559bf..dc03ae8336e 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2560.c,v 1.10 2007/08/26 22:45:56 dyoung Exp $ */ +/* $NetBSD: rt2560.c,v 1.11 2007/09/01 07:32:28 dyoung Exp $ */ /* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */ /* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/ @@ -24,7 +24,7 @@ * http://www.ralinktech.com/ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.10 2007/08/26 22:45:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.11 2007/09/01 07:32:28 dyoung Exp $"); #include "bpfilter.h" @@ -2252,7 +2252,6 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, void *data) { struct rt2560_softc *sc = ifp->if_softc; struct ieee80211com *ic = &sc->sc_ic; - struct ifreq *ifr; int s, error = 0; s = splnet(); @@ -2272,12 +2271,8 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: - ifr = (struct ifreq *)data; - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) + /* XXX no h/w multicast filter? --dyoung */ + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) error = 0; break; diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index 810189f348b..c0f8d19c37f 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2661.c,v 1.16 2007/08/26 22:45:56 dyoung Exp $ */ +/* $NetBSD: rt2661.c,v 1.17 2007/09/01 07:32:27 dyoung Exp $ */ /* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */ /* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */ @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.16 2007/08/26 22:45:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.17 2007/09/01 07:32:27 dyoung Exp $"); #include "bpfilter.h" @@ -2028,7 +2028,6 @@ rt2661_ioctl(struct ifnet *ifp, u_long cmd, void *data) { struct rt2661_softc *sc = ifp->if_softc; struct ieee80211com *ic = &sc->sc_ic; - struct ifreq *ifr; int s, error = 0; s = splnet(); @@ -2048,13 +2047,8 @@ rt2661_ioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: - ifr = (struct ifreq *)data; - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - - - if (error == ENETRESET) + /* XXX no h/w multicast filter? --dyoung */ + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) error = 0; break; diff --git a/sys/dev/ic/sgec.c b/sys/dev/ic/sgec.c index 0cacead07e3..dc783caecf6 100644 --- a/sys/dev/ic/sgec.c +++ b/sys/dev/ic/sgec.c @@ -1,4 +1,4 @@ -/* $NetBSD: sgec.c,v 1.31 2007/08/27 14:48:55 dyoung Exp $ */ +/* $NetBSD: sgec.c,v 1.32 2007/09/01 07:32:27 dyoung Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.31 2007/08/27 14:48:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.32 2007/09/01 07:32:27 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -588,11 +588,7 @@ zeioctl(ifp, cmd, data) /* * Update our multicast list. */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec): - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c index 6bc970ddbcd..df33cd9e8fe 100644 --- a/sys/dev/ic/smc91cxx.c +++ b/sys/dev/ic/smc91cxx.c @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.61 2007/08/27 14:48:55 dyoung Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.62 2007/09/01 07:32:27 dyoung Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.61 2007/08/27 14:48:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.62 2007/09/01 07:32:27 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -1309,10 +1309,7 @@ smc91cxx_ioctl(ifp, cmd, data) break; } - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware * filter accordingly. diff --git a/sys/dev/ic/wi.c b/sys/dev/ic/wi.c index 8abc61a1d87..0e38994c28e 100644 --- a/sys/dev/ic/wi.c +++ b/sys/dev/ic/wi.c @@ -1,4 +1,4 @@ -/* $NetBSD: wi.c,v 1.220 2007/07/09 21:00:40 ad Exp $ */ +/* $NetBSD: wi.c,v 1.221 2007/09/01 07:32:28 dyoung Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.220 2007/07/09 21:00:40 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.221 2007/09/01 07:32:28 dyoung Exp $"); #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -1391,10 +1391,7 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, void *data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) { /* do not rescan */ error = wi_write_multi(sc); diff --git a/sys/dev/isa/if_iy.c b/sys/dev/isa/if_iy.c index d60e694e901..10822e200e5 100644 --- a/sys/dev/isa/if_iy.c +++ b/sys/dev/isa/if_iy.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_iy.c,v 1.76 2007/08/26 22:45:57 dyoung Exp $ */ +/* $NetBSD: if_iy.c,v 1.77 2007/09/01 07:32:28 dyoung Exp $ */ /* #define IYDEBUG */ /* #define IYMEMDEBUG */ @@ -46,7 +46,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.76 2007/08/26 22:45:57 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.77 2007/09/01 07:32:28 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -1267,11 +1267,7 @@ iyioctl(ifp, cmd, data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom): - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/marvell/if_gfe.c b/sys/dev/marvell/if_gfe.c index 4d738bd65cf..9ab518620f6 100644 --- a/sys/dev/marvell/if_gfe.c +++ b/sys/dev/marvell/if_gfe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_gfe.c,v 1.24 2007/08/26 22:45:57 dyoung Exp $ */ +/* $NetBSD: if_gfe.c,v 1.25 2007/09/01 07:32:29 dyoung Exp $ */ /* * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.24 2007/08/26 22:45:57 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.25 2007/09/01 07:32:29 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -471,10 +471,7 @@ gfe_ifioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) - ? ether_addmulti(ifr, &sc->sc_ec) - : ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) error = gfe_whack(sc, GE_WHACK_CHANGE); else diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 9d77ab6b202..3008f943b75 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.124 2007/07/09 21:00:53 ad Exp $ */ +/* $NetBSD: if_de.c,v 1.125 2007/09/01 07:32:29 dyoung Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) @@ -37,7 +37,7 @@ * board which support 21040, 21041, or 21140 (mostly). */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.124 2007/07/09 21:00:53 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.125 2007/09/01 07:32:29 dyoung Exp $"); #define TULIP_HDR_DATA @@ -4832,12 +4832,7 @@ tulip_ifioctl( /* * Update multicast listeners */ - if (cmd == SIOCADDMULTI) - error = ether_addmulti(ifr, TULIP_ETHERCOM(sc)); - else - error = ether_delmulti(ifr, TULIP_ETHERCOM(sc)); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) { tulip_addr_filter(sc); /* reset multicast filtering */ tulip_init(sc); diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index a8f2f182d27..8d356c017e5 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ipw.c,v 1.32 2007/03/04 06:02:20 christos Exp $ */ +/* $NetBSD: if_ipw.c,v 1.33 2007/09/01 07:32:29 dyoung Exp $ */ /* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */ /*- @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.32 2007/03/04 06:02:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.33 2007/09/01 07:32:29 dyoung Exp $"); /*- * Intel(R) PRO/Wireless 2100 MiniPCI driver @@ -1733,10 +1733,8 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + /* XXX no h/w multicast filter? --dyoung */ + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* setup multicast filter, etc */ error = 0; } diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 31ba5a416c3..1e7775ee9f0 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_iwi.c,v 1.63 2007/08/26 22:45:58 dyoung Exp $ */ +/* $NetBSD: if_iwi.c,v 1.64 2007/09/01 07:32:29 dyoung Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.63 2007/08/26 22:45:58 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.64 2007/09/01 07:32:29 dyoung Exp $"); /*- * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver @@ -1934,10 +1934,8 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + /* XXX no h/w multicast filter? --dyoung */ + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* setup multicast filter, etc */ error = 0; } diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 376f588569d..30d5fca5f71 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_nfe.c,v 1.16 2007/07/09 21:00:54 ad Exp $ */ +/* $NetBSD: if_nfe.c,v 1.17 2007/09/01 07:32:30 dyoung Exp $ */ /* $OpenBSD: if_nfe.c,v 1.52 2006/03/02 09:04:00 jsg Exp $ */ /*- @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.16 2007/07/09 21:00:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.17 2007/09/01 07:32:30 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -591,11 +591,7 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, void *data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) nfe_setmulti(sc); error = 0; diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 5073c3527bf..1b3abe43d7f 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ti.c,v 1.75 2007/08/29 22:33:43 dyoung Exp $ */ +/* $NetBSD: if_ti.c,v 1.76 2007/09/01 07:32:30 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -81,7 +81,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.75 2007/08/29 22:33:43 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.76 2007/09/01 07:32:30 dyoung Exp $"); #include "bpfilter.h" #include "opt_inet.h" @@ -2835,10 +2835,7 @@ static int ti_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (command == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->ethercom) : - ether_delmulti(ifr, &sc->ethercom); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) ti_setmulti(sc); error = 0; diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index 22aff5e57d2..7ddaec1a092 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_txp.c,v 1.20 2007/07/09 21:00:55 ad Exp $ */ +/* $NetBSD: if_txp.c,v 1.21 2007/09/01 07:32:30 dyoung Exp $ */ /* * Copyright (c) 2001 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.20 2007/07/09 21:00:55 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.21 2007/09/01 07:32:30 dyoung Exp $"); #include "bpfilter.h" #include "opt_inet.h" @@ -1300,11 +1300,7 @@ txp_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (command == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_arpcom) : - ether_delmulti(ifr, &sc->sc_arpcom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware * filter accordingly. diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index 31c61e78b8c..9fd23174aa5 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vge.c,v 1.36 2007/07/09 21:00:56 ad Exp $ */ +/* $NetBSD: if_vge.c,v 1.37 2007/09/01 07:32:30 dyoung Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.36 2007/07/09 21:00:56 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.37 2007/09/01 07:32:30 dyoung Exp $"); /* * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver. @@ -2085,11 +2085,7 @@ vge_ioctl(struct ifnet *ifp, u_long command, void *data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (command == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 70f74a71154..724d46ca22e 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wpi.c,v 1.20 2007/08/26 22:45:58 dyoung Exp $ */ +/* $NetBSD: if_wpi.c,v 1.21 2007/09/01 07:32:30 dyoung Exp $ */ /*- * Copyright (c) 2006, 2007 @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.20 2007/08/26 22:45:58 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.21 2007/09/01 07:32:30 dyoung Exp $"); /* * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters. @@ -2043,7 +2043,6 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, void *data) struct wpi_softc *sc = ifp->if_softc; struct ieee80211com *ic = &sc->sc_ic; - struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; s = splnet(); @@ -2061,10 +2060,8 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec) : - ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + /* XXX no h/w multicast filter? --dyoung */ + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* setup multicast filter, etc */ error = 0; } diff --git a/sys/dev/pcmcia/if_cnw.c b/sys/dev/pcmcia/if_cnw.c index 0b0a5c9d69a..9e65cd52bd9 100644 --- a/sys/dev/pcmcia/if_cnw.c +++ b/sys/dev/pcmcia/if_cnw.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cnw.c,v 1.41 2007/03/04 06:02:27 christos Exp $ */ +/* $NetBSD: if_cnw.c,v 1.42 2007/09/01 07:32:31 dyoung Exp $ */ /*- * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -112,7 +112,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.41 2007/03/04 06:02:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.42 2007/09/01 07:32:31 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -1098,10 +1098,7 @@ cnw_ioctl(ifp, cmd, data) case SIOCADDMULTI: case SIOCDELMULTI: /* Update our multicast list. */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) cnw_init(sc); error = 0; @@ -1109,7 +1106,7 @@ cnw_ioctl(ifp, cmd, data) break; case SIOCGCNWDOMAIN: - ((struct ifreq *)data)->ifr_domain = sc->sc_domain; + ifr->ifr_domain = sc->sc_domain; break; case SIOCSCNWDOMAIN: diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c index 8e33ae9ffe1..a44bf8a7e74 100644 --- a/sys/dev/pcmcia/if_ray.c +++ b/sys/dev/pcmcia/if_ray.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ray.c,v 1.65 2007/07/09 21:01:20 ad Exp $ */ +/* $NetBSD: if_ray.c,v 1.66 2007/09/01 07:32:31 dyoung Exp $ */ /* * Copyright (c) 2000 Christian E. Hopps @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.65 2007/07/09 21:01:20 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.66 2007/09/01 07:32:31 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -971,11 +971,7 @@ ray_ioctl(ifp, cmd, data) if (cmd == SIOCDELMULTI) RAY_DPRINTF(("%s: ioctl: cmd SIOCDELMULTI\n", ifp->if_xname)); - if (cmd == SIOCADDMULTI) - error = ether_addmulti(ifr, &sc->sc_ec); - else - error = ether_delmulti(ifr, &sc->sc_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) ray_update_mcast(sc); error = 0; diff --git a/sys/dev/pcmcia/if_xi.c b/sys/dev/pcmcia/if_xi.c index b515a9f8009..c34d216858a 100644 --- a/sys/dev/pcmcia/if_xi.c +++ b/sys/dev/pcmcia/if_xi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_xi.c,v 1.61 2007/08/29 22:33:43 dyoung Exp $ */ +/* $NetBSD: if_xi.c,v 1.62 2007/09/01 07:32:31 dyoung Exp $ */ /* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */ /* @@ -55,7 +55,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.61 2007/08/29 22:33:43 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.62 2007/09/01 07:32:31 dyoung Exp $"); #include "opt_inet.h" #include "opt_ipx.h" @@ -1015,10 +1015,7 @@ xi_ioctl(ifp, cmd, data) break; } - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware * filter accordingly. diff --git a/sys/dev/qbus/if_qe.c b/sys/dev/qbus/if_qe.c index 6c5ff73bd43..6d89787da5a 100644 --- a/sys/dev/qbus/if_qe.c +++ b/sys/dev/qbus/if_qe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_qe.c,v 1.62 2007/03/04 06:02:29 christos Exp $ */ +/* $NetBSD: if_qe.c,v 1.63 2007/09/01 07:32:31 dyoung Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.62 2007/03/04 06:02:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.63 2007/09/01 07:32:31 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -698,11 +698,7 @@ qeioctl(struct ifnet *ifp, u_long cmd, void *data) /* * Update our multicast list. */ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ec): - ether_delmulti(ifr, &sc->sc_ec); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index cebc0e3f33a..4af4d656240 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $NetBSD: be.c,v 1.53 2007/07/09 21:01:20 ad Exp $ */ +/* $NetBSD: be.c,v 1.54 2007/09/01 07:32:31 dyoung Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.53 2007/07/09 21:01:20 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.54 2007/09/01 07:32:31 dyoung Exp $"); #include "opt_ddb.h" #include "opt_inet.h" @@ -1042,11 +1042,7 @@ beioctl(ifp, cmd, data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom): - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c index 7c07ab6ed76..8fe4fff9368 100644 --- a/sys/dev/sbus/qe.c +++ b/sys/dev/sbus/qe.c @@ -1,4 +1,4 @@ -/* $NetBSD: qe.c,v 1.41 2007/03/04 07:54:11 christos Exp $ */ +/* $NetBSD: qe.c,v 1.42 2007/09/01 07:32:32 dyoung Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.41 2007/03/04 07:54:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.42 2007/09/01 07:32:32 dyoung Exp $"); #define QEDEBUG @@ -977,11 +977,7 @@ qeioctl(ifp, cmd, data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom): - ether_delmulti(ifr, &sc->sc_ethercom); - - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. diff --git a/sys/dev/scsipi/if_se.c b/sys/dev/scsipi/if_se.c index 3b00fc9935c..35293c4f93b 100644 --- a/sys/dev/scsipi/if_se.c +++ b/sys/dev/scsipi/if_se.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_se.c,v 1.66 2007/07/09 21:01:21 ad Exp $ */ +/* $NetBSD: if_se.c,v 1.67 2007/09/01 07:32:32 dyoung Exp $ */ /* * Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au> @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.66 2007/07/09 21:01:21 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.67 2007/09/01 07:32:32 dyoung Exp $"); #include "opt_inet.h" #include "opt_atalk.h" @@ -1051,14 +1051,11 @@ se_ioctl(ifp, cmd, data) case SIOCADDMULTI: case SIOCDELMULTI: - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->sc_ethercom) : - ether_delmulti(ifr, &sc->sc_ethercom); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) { error = (cmd == SIOCADDMULTI) ? - se_set_multi(sc, ifr->ifr_addr.sa_data) : - se_remove_multi(sc, ifr->ifr_addr.sa_data); + se_set_multi(sc, ifreq_getaddr(cmd, ifr)->sa_data) : + se_remove_multi(sc, ifreq_getaddr(cmd, ifr)->sa_data); } else error = 0; } diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 8a91f8e91b3..861aa1b90a6 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aue.c,v 1.103 2007/08/29 22:33:43 dyoung Exp $ */ +/* $NetBSD: if_aue.c,v 1.104 2007/09/01 07:32:32 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.103 2007/08/29 22:33:43 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.104 2007/09/01 07:32:32 dyoung Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -1613,10 +1613,7 @@ aue_ioctl(struct ifnet *ifp, u_long command, void *data) break; case SIOCADDMULTI: case SIOCDELMULTI: - error = (command == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->aue_ec) : - ether_delmulti(ifr, &sc->aue_ec); - if (error == ENETRESET) { + if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) { #if defined(__NetBSD__) workqueue_enqueue(sc->wqp,&sc->wk, NULL); diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 9c9e0dec09c..0ee6db45c58 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.19 2007/03/13 13:51:54 drochner Exp $ */ +/* $NetBSD: if_axe.c,v 1.20 2007/09/01 07:32:32 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.19 2007/03/13 13:51:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.20 2007/09/01 07:32:32 dyoung Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -1239,9 +1239,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, void *data) case SIOCADDMULTI: case SIOCDELMULTI: #ifdef __NetBSD__ - error = (cmd == SIOCADDMULTI) ? - ether_addmulti(ifr, &sc->axe_ec) : - ether_delmulti(ifr, &sc->axe_ec); + error = ether_ioctl(ifp, cmd, data); #else error = (cmd == SIOCADDMULTI) ? ether_addmulti(ifr, &sc->arpcom) : |
