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/usb | |
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/usb')
-rw-r--r-- | sys/dev/usb/if_aue.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_axe.c | 5 | ||||
-rw-r--r-- | sys/dev/usb/if_cdce.c | 5 | ||||
-rw-r--r-- | sys/dev/usb/if_cdcef.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_udav.c | 6 |
7 files changed, 14 insertions, 26 deletions
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); } |