summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ixgb.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/if_ixgb.c')
-rw-r--r--sys/dev/pci/if_ixgb.c43
1 files changed, 16 insertions, 27 deletions
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c
index baac695eca5..a2d5e58c370 100644
--- a/sys/dev/pci/if_ixgb.c
+++ b/sys/dev/pci/if_ixgb.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.51 2008/11/09 15:08:26 naddy Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.52 2008/11/28 02:44:18 brad Exp $ */
#include <dev/pci/if_ixgb.h>
@@ -364,10 +364,10 @@ ixgb_start(struct ifnet *ifp)
int
ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
- int s, error = 0;
- struct ifreq *ifr = (struct ifreq *) data;
- struct ifaddr *ifa = (struct ifaddr *)data;
struct ixgb_softc *sc = ifp->if_softc;
+ struct ifaddr *ifa = (struct ifaddr *) data;
+ struct ifreq *ifr = (struct ifreq *) data;
+ int s, error = 0;
s = splnet();
@@ -383,13 +383,7 @@ ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
arp_ifinit(&sc->interface_data, ifa);
#endif /* INET */
break;
- case SIOCSIFMTU:
- IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)");
- 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:
IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFFLAGS (Set Interface Flags)");
if (ifp->if_flags & IFF_UP) {
@@ -412,31 +406,26 @@ ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
}
sc->if_flags = ifp->if_flags;
break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- IOCTL_DEBUGOUT("ioctl rcv'd: SIOC(ADD|DEL)MULTI");
- error = (command == SIOCADDMULTI)
- ? ether_addmulti(ifr, &sc->interface_data)
- : ether_delmulti(ifr, &sc->interface_data);
-
- if (error == ENETRESET) {
- if (ifp->if_flags & IFF_RUNNING) {
- ixgb_disable_intr(sc);
- ixgb_set_multi(sc);
- ixgb_enable_intr(sc);
- }
- error = 0;
- }
- break;
+
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
IOCTL_DEBUGOUT("ioctl rcv'd: SIOCxIFMEDIA (Get/Set Interface Media)");
error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
break;
+
default:
error = ether_ioctl(ifp, &sc->interface_data, command, data);
}
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING) {
+ ixgb_disable_intr(sc);
+ ixgb_set_multi(sc);
+ ixgb_enable_intr(sc);
+ }
+ error = 0;
+ }
+
splx(s);
return (error);
}