diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-10-02 20:21:16 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-10-02 20:21:16 +0000 |
commit | 8d3b73e0ab70c1110b5b479b02809b80891945cc (patch) | |
tree | 6f9f4aecd17358436877da1307c753e5db774045 /sys/dev | |
parent | 6d6833da157e83635382235a3f52b938de757cc4 (diff) |
First step towards cleaning up the Ethernet driver ioctl handling.
Move calling ether_ioctl() from the top of the ioctl function, which
at the moment does absolutely nothing, to the default switch case.
Thus allowing drivers to define their own ioctl handlers and then
falling back on ether_ioctl(). The only functional change this results
in at the moment is having all Ethernet drivers returning the proper
errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown
ioctl's.
Shrinks the i386 kernels by..
RAMDISK - 1024 bytes
RAMDISKB - 1120 bytes
RAMDISKC - 832 bytes
Tested by martin@/jsing@/todd@/brad@
Build tested on almost all archs by todd@/brad@
ok jsing@
Diffstat (limited to 'sys/dev')
60 files changed, 135 insertions, 488 deletions
diff --git a/sys/dev/ic/aic6915.c b/sys/dev/ic/aic6915.c index d47d53230ac..24253a42ded 100644 --- a/sys/dev/ic/aic6915.c +++ b/sys/dev/ic/aic6915.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic6915.c,v 1.6 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: aic6915.c,v 1.7 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: aic6915.c,v 1.15 2005/12/24 20:27:29 perry Exp $ */ /*- @@ -543,11 +543,6 @@ sf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -603,7 +598,7 @@ sf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } /* Try to get more packets going. */ diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c index 0aec5414156..46e48aa7507 100644 --- a/sys/dev/ic/am7990.c +++ b/sys/dev/ic/am7990.c @@ -1,4 +1,4 @@ -/* $OpenBSD: am7990.c,v 1.41 2006/04/20 20:31:12 miod Exp $ */ +/* $OpenBSD: am7990.c,v 1.42 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: am7990.c,v 1.22 1996/10/13 01:37:19 christos Exp $ */ /*- @@ -843,13 +843,7 @@ am7990_ioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -924,8 +918,7 @@ am7990_ioctl(ifp, cmd, data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index c52f2b0f6f0..1f6be3b776e 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.103 2008/09/12 05:44:52 brad Exp $ */ +/* $OpenBSD: dc.c,v 1.104 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2973,11 +2973,6 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -3039,12 +3034,10 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) #endif break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 3ea2003922a..e3a3298ac4b 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3.c,v 1.71 2007/10/13 16:12:29 fgsch Exp $ */ +/* $OpenBSD: elink3.c,v 1.72 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */ /* @@ -1477,13 +1477,7 @@ epioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1556,8 +1550,7 @@ epioctl(ifp, cmd, data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 229f68720f4..a1c06209a9a 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.92 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: fxp.c,v 1.93 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -1633,11 +1633,6 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch (command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1691,8 +1686,9 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } + splx(s); return (error); } diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 3d15faffa0d..231eebcf580 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.78 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: gem.c,v 1.79 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -1423,13 +1423,7 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; if ((ifp->if_flags & IFF_RUNNING) == 0) @@ -1492,8 +1486,7 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index 19853211493..f80e9e04ada 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.50 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: hme.c,v 1.51 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */ /*- @@ -1212,13 +1212,7 @@ hme_ioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { - case SIOCSIFADDR: switch (ifa->ifa_addr->sa_family) { #ifdef INET @@ -1298,8 +1292,7 @@ hme_ioctl(ifp, cmd, data) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } sc->sc_if_flags = ifp->if_flags; diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c index 3a2ad10a1a5..798f4722eaf 100644 --- a/sys/dev/ic/i82596.c +++ b/sys/dev/ic/i82596.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i82596.c,v 1.29 2008/06/26 05:42:15 ray Exp $ */ +/* $OpenBSD: i82596.c,v 1.30 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */ /*- @@ -1870,13 +1870,7 @@ i82596_ioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch(cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1949,8 +1943,9 @@ i82596_ioctl(ifp, cmd, data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + splx(s); return (error); } diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index cf37c4bb405..bc876e1966c 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.140 2008/04/18 09:16:14 djm Exp $ */ +/* $OpenBSD: if_wi.c,v 1.141 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -126,7 +126,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.140 2008/04/18 09:16:14 djm Exp $"; + "$OpenBSD: if_wi.c,v 1.141 2008/10/02 20:21:13 brad Exp $"; #endif /* lint */ #ifdef foo @@ -1574,11 +1574,6 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data) DPRINTF (WID_IOCTL, ("wi_ioctl: command %lu data %p\n", command, data)); - if ((error = ether_ioctl(ifp, &sc->sc_ic.ic_ac, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -2053,14 +2048,14 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = wihap_ioctl(sc, command, data); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_ic.ic_ac, command, data); } if (wreq) free(wreq, M_DEVBUF); if (nwidp) free(nwidp, M_DEVBUF); + splx(s); return(error); } diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c index 4fb409dc208..464ce3690c2 100644 --- a/sys/dev/ic/lemac.c +++ b/sys/dev/ic/lemac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lemac.c,v 1.10 2006/04/16 16:32:08 miod Exp $ */ +/* $OpenBSD: lemac.c,v 1.11 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */ /*- @@ -799,11 +799,6 @@ lemac_ifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -856,8 +851,7 @@ lemac_ifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/ic/mtd8xx.c b/sys/dev/ic/mtd8xx.c index 3d2f601a9e1..0256e67a490 100644 --- a/sys/dev/ic/mtd8xx.c +++ b/sys/dev/ic/mtd8xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtd8xx.c,v 1.13 2007/11/26 09:28:33 martynas Exp $ */ +/* $OpenBSD: mtd8xx.c,v 1.14 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru> @@ -580,13 +580,9 @@ mtd_ioctl(struct ifnet *ifp, u_long command, caddr_t data) struct mtd_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifaddr *ifa = (struct ifaddr *)data; - int s, error; + int s, error = 0; s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) { - splx(s); - return (error); - } switch (command) { case SIOCSIFADDR: @@ -637,8 +633,7 @@ mtd_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 3ee58670a43..22446b01f55 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.90 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: re.c,v 1.91 2008/10/02 20:21:13 brad Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -2050,12 +2050,6 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, - data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -2104,12 +2098,10 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index bc437adb649..f7e9c98f9d9 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.59 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.60 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1093,11 +1093,6 @@ int rl_ioctl(ifp, command, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1150,12 +1145,10 @@ int rl_ioctl(ifp, command, data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c index af2b8ca9a19..1b05cf3337b 100644 --- a/sys/dev/ic/smc83c170.c +++ b/sys/dev/ic/smc83c170.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smc83c170.c,v 1.11 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: smc83c170.c,v 1.12 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */ /*- @@ -551,15 +551,10 @@ epic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct epic_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifaddr *ifa = (struct ifaddr *)data; - int s, error; + int s, error = 0; s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -622,8 +617,9 @@ epic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + splx(s); return (error); } diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index 8f426de177d..cbab3bfd8af 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.81 2008/09/18 15:16:30 naddy Exp $ */ +/* $OpenBSD: xl.c,v 1.82 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2271,11 +2271,6 @@ xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -2344,12 +2339,10 @@ xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data) &mii->mii_media, command); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c index 641ad511eeb..c68bac2a81c 100644 --- a/sys/dev/isa/if_ef_isapnp.c +++ b/sys/dev/isa/if_ef_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ef_isapnp.c,v 1.22 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_ef_isapnp.c,v 1.23 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -346,11 +346,6 @@ efioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -396,8 +391,7 @@ efioctl(ifp, cmd, data) efsetmulti(sc); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c index 334fa72f300..5d5d2e28409 100644 --- a/sys/dev/isa/if_eg.c +++ b/sys/dev/isa/if_eg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eg.c,v 1.30 2007/01/07 15:15:58 miod Exp $ */ +/* $OpenBSD: if_eg.c,v 1.31 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */ /* @@ -786,13 +786,7 @@ egioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -839,8 +833,7 @@ egioctl(ifp, cmd, data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c index 8e4d0b7b599..63ba41ec46f 100644 --- a/sys/dev/isa/if_el.c +++ b/sys/dev/isa/if_el.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_el.c,v 1.20 2006/03/25 22:41:44 djm Exp $ */ +/* $OpenBSD: if_el.c,v 1.21 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_el.c,v 1.39 1996/05/12 23:52:32 mycroft Exp $ */ /* @@ -595,13 +595,7 @@ elioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -644,8 +638,7 @@ elioctl(ifp, cmd, data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/isa/if_ex.c b/sys/dev/isa/if_ex.c index 54b3d84b6a3..6ccec01b67f 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.32 2007/10/21 03:02:09 brad Exp $ */ +/* $OpenBSD: if_ex.c,v 1.33 2008/10/02 20:21:13 brad Exp $ */ /* * Copyright (c) 1997, Donald A. Schmidt * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) @@ -744,11 +744,6 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch(cmd) { case SIOCSIFADDR: DODEBUG(Start_End, printf("SIOCSIFADDR");); @@ -792,13 +787,10 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, cmd); break; default: - DODEBUG(Start_End, printf("unknown");); - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, cmd, data); } splx(s); - DODEBUG(Start_End, printf("\nex_ioctl: finish\n");); return(error); } diff --git a/sys/dev/isa/if_ie.c b/sys/dev/isa/if_ie.c index 11b5283716c..0639fbeae9d 100644 --- a/sys/dev/isa/if_ie.c +++ b/sys/dev/isa/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.33 2006/04/16 00:46:32 pascoe Exp $ */ +/* $OpenBSD: if_ie.c,v 1.34 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_ie.c,v 1.51 1996/05/12 23:52:48 mycroft Exp $ */ /*- @@ -2126,13 +2126,7 @@ ieioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -2200,8 +2194,9 @@ ieioctl(ifp, cmd, data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + splx(s); return error; } diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index 4878cb58a5d..eae61660a28 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bce.c,v 1.25 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_bce.c,v 1.26 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */ /* @@ -440,11 +440,6 @@ bce_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->bce_ac, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -498,8 +493,7 @@ bce_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->bce_mii.mii_media, cmd); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->bce_ac, cmd, data); } if (error == 0) { diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index ece8c2fca30..539479badda 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.245 2008/09/23 00:27:18 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.246 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -3274,11 +3274,6 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -3351,12 +3346,10 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 55b5617337b..aea799bddb6 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.66 2008/10/02 20:21:14 brad Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -4606,11 +4606,6 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch (command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -4668,12 +4663,10 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 7172f60b739..a6cfd556c05 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.21 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_cas.c,v 1.22 2008/10/02 20:21:14 brad Exp $ */ /* * @@ -1689,13 +1689,7 @@ cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; if ((ifp->if_flags & IFF_RUNNING) == 0) @@ -1758,8 +1752,7 @@ cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 4958a4a33af..6bc9a6b689e 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.99 2008/03/04 19:43:18 miod Exp $ */ +/* $OpenBSD: if_de.c,v 1.100 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */ /*- @@ -4152,11 +4152,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->tulip_ac, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: { ifp->if_flags |= IFF_UP; @@ -4218,8 +4213,7 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->tulip_ac, cmd, data); } splx(s); diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 90048c260f5..85042fc2691 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.189 2008/09/30 17:59:22 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.190 2008/10/02 20:21:14 brad Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -535,11 +535,6 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->interface_data, command, data)) > 0) { - splx(s); - return (error); - } - switch (command) { case SIOCSIFADDR: IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFADDR (Set Interface " @@ -612,8 +607,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; default: - IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%x)", (int)command); - error = ENOTTY; + error = ether_ioctl(ifp, &sc->interface_data, command, data); } splx(s); diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index f80a5a004c8..8330c518b8f 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_et.c,v 1.13 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_et.c,v 1.14 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. * @@ -1038,11 +1038,6 @@ et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1097,11 +1092,10 @@ et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_miibus.mii_media, cmd); break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); - return error; } diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index f49899d9e14..a32f50555e2 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.8 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_ix.c,v 1.9 2008/10/02 20:21:14 brad Exp $ */ /****************************************************************************** @@ -434,11 +434,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch (command) { case SIOCSIFADDR: IOCTL_DEBUGOUT("ioctl: SIOCxIFADDR (Get/Set Interface Addr)"); @@ -499,9 +494,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; default: - IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 8faabde5d53..2e919761e78 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.47 2008/09/30 17:59:22 brad Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.48 2008/10/02 20:21:14 brad Exp $ */ #include <dev/pci/if_ixgb.h> @@ -370,11 +370,6 @@ ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->interface_data, command, data)) > 0) { - splx(s); - return (error); - } - switch (command) { case SIOCSIFADDR: IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFADDR (Set Interface " @@ -438,8 +433,7 @@ ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; default: - IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%X)\n", (int)command); - error = ENOTTY; + error = ether_ioctl(ifp, &sc->interface_data, command, data); } splx(s); diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c index 1403a69b9b2..660db35f37d 100644 --- a/sys/dev/pci/if_jme.c +++ b/sys/dev/pci/if_jme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_jme.c,v 1.3 2008/09/29 22:43:45 deraadt Exp $ */ +/* $OpenBSD: if_jme.c,v 1.4 2008/10/02 20:21:14 brad Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -1320,11 +1320,6 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1401,8 +1396,7 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index 960c76fa457..a6f3d1e45dd 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lii.c,v 1.18 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_lii.c,v 1.19 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2007 The NetBSD Foundation. @@ -1049,14 +1049,10 @@ lii_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) struct lii_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)addr; struct ifaddr *ifa; - int s, error; + int s, error = 0; s = splnet(); - error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr); - if (error > 0) - goto err; - switch(cmd) { case SIOCSIFADDR: SET(ifp->if_flags, IFF_UP); @@ -1090,18 +1086,16 @@ lii_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr); } -err: if (error == ENETRESET) { if (ifp->if_flags & IFF_RUNNING) lii_iff(sc); error = 0; } - splx(s); + splx(s); return error; } diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index f7f4a8526b2..489ef5e9b96 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_msk.c,v 1.66 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -734,11 +734,6 @@ msk_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc_if->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -794,12 +789,10 @@ msk_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc_if->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 2096cf0d59e..27ff873b5c3 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.8 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_myx.c,v 1.9 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -822,10 +822,6 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) int s, error = 0; s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_ac, cmd, data)) > 0) { - splx(s); - return (error); - } switch (cmd) { case SIOCSIFADDR: @@ -868,7 +864,7 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_ac, cmd, data); } if (error == ENETRESET) { @@ -879,7 +875,6 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } splx(s); - return (error); } diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 43bb11763c6..79d09748713 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.81 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.82 2008/10/02 20:21:14 brad Exp $ */ /*- * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr> @@ -527,11 +527,6 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -586,11 +581,10 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd); break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); - return error; } diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index bf9a030f957..ef1703a53a9 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.58 2008/05/23 08:49:27 brad Exp $ */ +/* $OpenBSD: if_nge.c,v 1.59 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -2046,11 +2046,6 @@ nge_ioctl(ifp, command, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFMTU: if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu) @@ -2123,12 +2118,10 @@ nge_ioctl(ifp, command, data) } break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c index ce105f74562..788a17e88d4 100644 --- a/sys/dev/pci/if_nxe.c +++ b/sys/dev/pci/if_nxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nxe.c,v 1.55 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_nxe.c,v 1.56 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1020,16 +1020,12 @@ nxe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) struct nxe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)addr; struct ifaddr *ifa; - int error; + int error = 0; int s; rw_enter_write(&sc->sc_lock); s = splnet(); - error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr); - if (error > 0) - goto err; - timeout_del(&sc->sc_tick); switch (cmd) { @@ -1066,8 +1062,7 @@ nxe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr); } if (error == ENETRESET) { @@ -1081,7 +1076,6 @@ nxe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) nxe_tick(sc); -err: splx(s); rw_exit_write(&sc->sc_lock); return (error); diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index 1d23e361ed5..58d5339d6c9 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pcn.c,v 1.19 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_pcn.c,v 1.20 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */ /* @@ -1088,14 +1088,6 @@ pcn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - /* Try to get more packets going. */ - pcn_start(ifp); - - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1157,7 +1149,7 @@ pcn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } /* Try to get more packets going. */ diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index b83130f53db..34fd7dac425 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.81 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_sis.c,v 1.82 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1895,11 +1895,6 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1959,12 +1954,10 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index cf48c0597b8..13c3b8b0e4c 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.147 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_sk.c,v 1.148 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -866,11 +866,6 @@ sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc_if->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -926,12 +921,10 @@ sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc_if->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c index c2f1b3fe9bd..f817717a6b5 100644 --- a/sys/dev/pci/if_ste.c +++ b/sys/dev/pci/if_ste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ste.c,v 1.41 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_ste.c,v 1.42 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1282,11 +1282,6 @@ ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1349,12 +1344,10 @@ ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index c9a8273968a..d9e75e8e1d1 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_stge.c,v 1.40 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_stge.c,v 1.41 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */ /*- @@ -690,18 +690,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct stge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifaddr *ifa = (struct ifaddr *)data; - int s, error; + int s, error = 0; s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - /* Try to get more packets going. */ - stge_start(ifp); - - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -761,7 +753,7 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } /* Try to get more packets going. */ diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index 0f1eaf41b17..f20a2597307 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.118 2008/09/10 14:01:22 blambert Exp $ */ +/* $OpenBSD: if_tht.c,v 1.119 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -866,16 +866,12 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) struct tht_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)addr; struct ifaddr *ifa; - int error; + int error = 0; int s; rw_enter_write(&sc->sc_lock); s = splnet(); - error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr); - if (error > 0) - goto err; - switch (cmd) { case SIOCSIFADDR: ifa = (struct ifaddr *)addr; @@ -919,8 +915,7 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr); } if (error == ENETRESET) { @@ -929,7 +924,6 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) error = 0; } -err: splx(s); rw_exit_write(&sc->sc_lock); diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index d78a80f617a..a0045948c75 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ti.c,v 1.87 2008/09/24 19:12:59 chl Exp $ */ +/* $OpenBSD: if_ti.c,v 1.88 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2478,11 +2478,6 @@ ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -2546,8 +2541,7 @@ ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c index bf42496923d..ac7a9dda767 100644 --- a/sys/dev/pci/if_tl.c +++ b/sys/dev/pci/if_tl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tl.c,v 1.44 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_tl.c,v 1.45 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1788,11 +1788,6 @@ int tl_ioctl(ifp, command, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1854,12 +1849,10 @@ int tl_ioctl(ifp, command, data) &sc->sc_mii.mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index 7642e8a1183..ba6043f8172 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txp.c,v 1.94 2008/09/18 15:16:30 naddy Exp $ */ +/* $OpenBSD: if_txp.c,v 1.95 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2001 @@ -1213,11 +1213,6 @@ txp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1262,12 +1257,10 @@ txp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index 24a0c1200ee..8259c41a1bf 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vge.c,v 1.38 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_vge.c,v 1.39 2008/10/02 20:21:14 brad Exp $ */ /* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */ /* * Copyright (c) 2004 @@ -1707,11 +1707,6 @@ vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch (command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1772,8 +1767,7 @@ vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index 15dedb3ef91..7c52bbbd4a1 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.54 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_vic.c,v 1.55 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -1181,11 +1181,6 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_ac, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifa = (struct ifaddr *)data; @@ -1234,8 +1229,7 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->sc_ac, cmd, data); } if (error == ENETRESET) { @@ -1246,7 +1240,6 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } splx(s); - return (error); } diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 27115075d12..e4def20edf5 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.77 2008/09/24 08:41:29 mpf Exp $ */ +/* $OpenBSD: if_vr.c,v 1.78 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1333,11 +1333,6 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return error; - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1402,12 +1397,10 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index b869ec8322b..e94485747a7 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wb.c,v 1.39 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_wb.c,v 1.40 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1619,11 +1619,6 @@ int wb_ioctl(ifp, command, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) { - splx(s); - return (error); - } - switch(command) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1668,12 +1663,10 @@ int wb_ioctl(ifp, command, data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command); break; default: - error = ENOTTY; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return(error); } diff --git a/sys/dev/pci/if_xge.c b/sys/dev/pci/if_xge.c index 8636c04ea33..53db5138991 100644 --- a/sys/dev/pci/if_xge.c +++ b/sys/dev/pci/if_xge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xge.c,v 1.44 2008/09/24 19:12:59 chl Exp $ */ +/* $OpenBSD: if_xge.c,v 1.45 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */ /* @@ -964,11 +964,6 @@ xge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1018,11 +1013,10 @@ xge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->xena_media, cmd); break; default: - error = ENOTTY; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); - return (error); } diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c index 1a920526027..a20d495834b 100644 --- a/sys/dev/pcmcia/if_ray.c +++ b/sys/dev/pcmcia/if_ray.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ray.c,v 1.34 2006/08/18 08:17:07 jsg Exp $ */ +/* $OpenBSD: if_ray.c,v 1.35 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */ /* @@ -943,10 +943,9 @@ ray_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ray_softc *sc; struct ifreq *ifr; struct ifaddr *ifa; - int error, error2, s, i; + int error = 0, error2, s, i; sc = ifp->if_softc; - error = 0; ifr = (struct ifreq *)data; @@ -955,11 +954,6 @@ ray_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) RAY_DPRINTF(("%s: ioctl: cmd 0x%lx data 0x%lx\n", ifp->if_xname, cmd, (long)data)); - if ((error = ether_ioctl(ifp, &sc->sc_ec, cmd, data)) > 0) { - splx(s); - return error; - } - switch (cmd) { case SIOCSIFADDR: RAY_DPRINTF(("%s: ioctl: cmd SIOCSIFADDR\n", ifp->if_xname)); @@ -1076,15 +1070,12 @@ ray_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; #endif default: - RAY_DPRINTF(("%s: ioctl: unknown\n", ifp->if_xname)); - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_ec, cmd, data); } RAY_DPRINTF(("%s: ioctl: returns %d\n", ifp->if_xname, error)); splx(s); - return (error); } diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index 6c5d738cc2d..c73ef6b2ec0 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.21 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: be.c,v 1.22 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: be.c,v 1.26 2001/03/20 15:39:20 pk Exp $ */ /*- @@ -933,11 +933,6 @@ beioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -1007,9 +1002,9 @@ beioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + splx(s); return (error); } diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c index a242c7c2e26..e75e0ef2600 100644 --- a/sys/dev/sbus/qe.c +++ b/sys/dev/sbus/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.21 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: qe.c,v 1.22 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: qe.c,v 1.16 2001/03/30 17:30:18 christos Exp $ */ /*- @@ -905,11 +905,6 @@ qeioctl(ifp, cmd, data) s = splnet(); - if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) { - splx(s); - return (error); - } - switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -978,8 +973,7 @@ qeioctl(ifp, cmd, data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } splx(s); diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 802cf569540..fb530a31317 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.72 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_aue.c,v 1.73 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1579,12 +1579,10 @@ aue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index a2bb9b44c2b..10f8968fda8 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.87 2008/09/21 23:59:20 brad Exp $ */ +/* $OpenBSD: if_axe.c,v 1.88 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> @@ -1408,8 +1408,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->arpcom, cmd, data); } splx(s); diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index adc6e1ef64b..d19d56e366f 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdce.c,v 1.41 2008/03/14 21:54:23 mbalmer Exp $ */ +/* $OpenBSD: if_cdce.c,v 1.42 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -579,12 +579,11 @@ cdce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, &sc->cdce_arpcom, command, data); break; } splx(s); - return (error); } diff --git a/sys/dev/usb/if_cdcef.c b/sys/dev/usb/if_cdcef.c index 4267d2ec167..a2a61de305e 100644 --- a/sys/dev/usb/if_cdcef.c +++ b/sys/dev/usb/if_cdcef.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdcef.c,v 1.20 2007/11/25 16:40:03 jmc Exp $ */ +/* $OpenBSD: if_cdcef.c,v 1.21 2008/10/02 20:21:14 brad Exp $ */ /* * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> @@ -518,12 +518,10 @@ cdcef_ioctl(struct ifnet *ifp, u_long command, caddr_t data) break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 8b6df602f65..3accd93c7ea 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cue.c,v 1.49 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_cue.c,v 1.50 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1167,12 +1167,10 @@ cue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 99671a1bde0..d6757cdf7b5 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.56 2007/10/11 18:33:14 deraadt Exp $ */ +/* $OpenBSD: if_kue.c,v 1.57 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1130,12 +1130,10 @@ kue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->arpcom, command, data); } splx(s); - return (error); } diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 8b6628e3d2e..cb96fc006e3 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.41 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: if_udav.c,v 1.42 2008/10/02 20:21:14 brad Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -1273,12 +1273,10 @@ udav_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; default: - error = EINVAL; - break; + error = ether_ioctl(ifp, &sc->sc_ac, cmd, data); } splx(s); - return (error); } |