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/arch/macppc/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/arch/macppc/dev')
-rw-r--r-- | sys/arch/macppc/dev/if_bm.c | 5 | ||||
-rw-r--r-- | sys/arch/macppc/dev/if_mc.c | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index 67cf62e873c..eb0d056eb56 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bm.c,v 1.22 2007/04/22 22:31:14 deraadt Exp $ */ +/* $OpenBSD: if_bm.c,v 1.23 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_bm.c,v 1.1 1999/01/01 01:27:52 tsubai Exp $ */ /*- @@ -753,7 +753,6 @@ bmac_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splnet(); switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; @@ -827,7 +826,7 @@ bmac_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, &sc->arpcom, cmd, data); } splx(s); diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c index 54e89adbb0f..d2c9d086989 100644 --- a/sys/arch/macppc/dev/if_mc.c +++ b/sys/arch/macppc/dev/if_mc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mc.c,v 1.10 2007/04/22 22:31:14 deraadt Exp $ */ +/* $OpenBSD: if_mc.c,v 1.11 2008/10/02 20:21:13 brad Exp $ */ /* $NetBSD: if_mc.c,v 1.9.16.1 2006/06/21 14:53:13 yamt Exp $ */ /*- @@ -501,7 +501,6 @@ mc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) int s = splnet(), err = 0; switch (cmd) { - case SIOCSIFADDR: ifp->if_flags |= IFF_UP; if (!(ifp->if_flags & IFF_RUNNING)) @@ -555,8 +554,9 @@ mc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; default: - err = EINVAL; + err = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data); } + splx(s); return (err); } |