summaryrefslogtreecommitdiff
path: root/sys/dev/ic/re.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-10-02 20:21:16 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-10-02 20:21:16 +0000
commit8d3b73e0ab70c1110b5b479b02809b80891945cc (patch)
tree6f9f4aecd17358436877da1307c753e5db774045 /sys/dev/ic/re.c
parent6d6833da157e83635382235a3f52b938de757cc4 (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/ic/re.c')
-rw-r--r--sys/dev/ic/re.c12
1 files changed, 2 insertions, 10 deletions
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);
}