summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_axe.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-11-28 02:44:19 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-11-28 02:44:19 +0000
commit7da313a2f65e39b86488c21555c356ca3a9100e5 (patch)
tree391b806058ca43cb3ba624dce63764bce2b9b2b1 /sys/dev/usb/if_axe.c
parent37778efb0de37bd00e9269e32ac772f743cce430 (diff)
Eliminate the redundant bits of code for MTU and multicast handling
from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
Diffstat (limited to 'sys/dev/usb/if_axe.c')
-rw-r--r--sys/dev/usb/if_axe.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index ab00e05ed9d..62af3637512 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.90 2008/11/06 02:32:28 brad Exp $ */
+/* $OpenBSD: if_axe.c,v 1.91 2008/11/28 02:44:18 brad Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org>
@@ -1352,13 +1352,6 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
#endif
break;
- case SIOCSIFMTU:
- if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu)
- error = EINVAL;
- else if (ifp->if_mtu != ifr->ifr_mtu)
- ifp->if_mtu = ifr->ifr_mtu;
- break;
-
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING &&
@@ -1385,22 +1378,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
sc->axe_if_flags = ifp->if_flags;
break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = (cmd == SIOCADDMULTI) ?
- ether_addmulti(ifr, &sc->arpcom) :
- ether_delmulti(ifr, &sc->arpcom);
-
- if (error == ENETRESET) {
- /*
- * Multicast list has changed; set the hardware
- * filter accordingly.
- */
- if (ifp->if_flags & IFF_RUNNING)
- axe_setmulti(sc);
- error = 0;
- }
- break;
+
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
mii = GET_MII(sc);
@@ -1411,6 +1389,12 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ether_ioctl(ifp, &sc->arpcom, cmd, data);
}
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING)
+ axe_setmulti(sc);
+ error = 0;
+ }
+
splx(s);
return(error);
}