summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bnx.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_bnx.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_bnx.c')
-rw-r--r--sys/dev/pci/if_bnx.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index 22008bcb765..4505ad8f0dd 100644
--- a/sys/dev/pci/if_bnx.c
+++ b/sys/dev/pci/if_bnx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnx.c,v 1.70 2008/11/09 15:08:26 naddy Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.71 2008/11/28 02:44:17 brad Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -4586,8 +4586,8 @@ int
bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
struct bnx_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 = &sc->bnx_mii;
int s, error = 0;
@@ -4604,13 +4604,6 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
#endif /* INET */
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) &&
@@ -4628,19 +4621,6 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
sc->bnx_if_flags = ifp->if_flags;
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)
- bnx_set_rx_mode(sc);
- error = 0;
- }
- break;
-
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
DBPRINT(sc, BNX_VERBOSE, "bnx_phy_flags = 0x%08X\n",
@@ -4653,6 +4633,12 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING)
+ bnx_set_rx_mode(sc);
+ error = 0;
+ }
+
splx(s);
return (error);
}