summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_nge.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_nge.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_nge.c')
-rw-r--r--sys/dev/pci/if_nge.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index 7da2a2d5ea5..9427b44cf43 100644
--- a/sys/dev/pci/if_nge.c
+++ b/sys/dev/pci/if_nge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nge.c,v 1.66 2008/11/09 15:08:26 naddy Exp $ */
+/* $OpenBSD: if_nge.c,v 1.67 2008/11/28 02:44:18 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -2061,20 +2061,14 @@ nge_ioctl(ifp, command, data)
caddr_t data;
{
struct nge_softc *sc = ifp->if_softc;
+ struct ifaddr *ifa = (struct ifaddr *) data;
struct ifreq *ifr = (struct ifreq *) data;
- struct ifaddr *ifa = (struct ifaddr *)data;
struct mii_data *mii;
int s, error = 0;
s = splnet();
switch(command) {
- 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 SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
switch (ifa->ifa_addr->sa_family) {
@@ -2089,6 +2083,7 @@ nge_ioctl(ifp, command, data)
break;
}
break;
+
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING &&
@@ -2116,18 +2111,7 @@ nge_ioctl(ifp, command, data)
sc->nge_if_flags = ifp->if_flags;
error = 0;
break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = (command == SIOCADDMULTI)
- ? ether_addmulti(ifr, &sc->arpcom)
- : ether_delmulti(ifr, &sc->arpcom);
- if (error == ENETRESET) {
- if (ifp->if_flags & IFF_RUNNING)
- nge_setmulti(sc);
- error = 0;
- }
- break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
if (sc->nge_tbi) {
@@ -2139,10 +2123,17 @@ nge_ioctl(ifp, command, data)
command);
}
break;
+
default:
error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING)
+ nge_setmulti(sc);
+ error = 0;
+ }
+
splx(s);
return(error);
}