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/pcmcia | |
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/pcmcia')
-rw-r--r-- | sys/dev/pcmcia/if_ray.c | 15 |
1 files changed, 3 insertions, 12 deletions
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); } |