summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_et.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/pci/if_et.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/pci/if_et.c')
-rw-r--r--sys/dev/pci/if_et.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c
index ef2c020da00..463e9e89e2e 100644
--- a/sys/dev/pci/if_et.c
+++ b/sys/dev/pci/if_et.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_et.c,v 1.15 2008/11/04 19:20:22 chl Exp $ */
+/* $OpenBSD: if_et.c,v 1.16 2008/11/28 02:44:17 brad Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
*
@@ -1030,8 +1030,8 @@ int
et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct et_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *)data;
struct ifaddr *ifa = (struct ifaddr *)data;
+ struct ifreq *ifr = (struct ifreq *)data;
int s, error = 0;
s = splnet();
@@ -1046,12 +1046,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
arp_ifinit(&sc->sc_arpcom, ifa);
#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) {
/*
@@ -1073,26 +1068,22 @@ et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
sc->sc_if_flags = ifp->if_flags;
break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = (cmd == SIOCADDMULTI) ?
- ether_addmulti(ifr, &sc->sc_arpcom) :
- ether_delmulti(ifr, &sc->sc_arpcom);
- if (error == ENETRESET) {
- if (ifp->if_flags & IFF_RUNNING)
- et_setmulti(sc);
- error = 0;
- }
- break;
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
error = ifmedia_ioctl(ifp, ifr, &sc->sc_miibus.mii_media, cmd);
break;
+
default:
error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING)
+ et_setmulti(sc);
+ error = 0;
+ }
+
splx(s);
return error;
}