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/pci/if_em.c | |
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/pci/if_em.c')
-rw-r--r-- | sys/dev/pci/if_em.c | 10 |
1 files changed, 2 insertions, 8 deletions
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); |