summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-10-02 20:21:16 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-10-02 20:21:16 +0000
commit8d3b73e0ab70c1110b5b479b02809b80891945cc (patch)
tree6f9f4aecd17358436877da1307c753e5db774045 /sys/dev/pci
parent6d6833da157e83635382235a3f52b938de757cc4 (diff)
First step towards cleaning up the Ethernet driver ioctl handling.
Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_bce.c10
-rw-r--r--sys/dev/pci/if_bge.c11
-rw-r--r--sys/dev/pci/if_bnx.c11
-rw-r--r--sys/dev/pci/if_cas.c11
-rw-r--r--sys/dev/pci/if_de.c10
-rw-r--r--sys/dev/pci/if_em.c10
-rw-r--r--sys/dev/pci/if_et.c10
-rw-r--r--sys/dev/pci/if_ix.c11
-rw-r--r--sys/dev/pci/if_ixgb.c10
-rw-r--r--sys/dev/pci/if_jme.c10
-rw-r--r--sys/dev/pci/if_lii.c14
-rw-r--r--sys/dev/pci/if_msk.c11
-rw-r--r--sys/dev/pci/if_myx.c9
-rw-r--r--sys/dev/pci/if_nfe.c10
-rw-r--r--sys/dev/pci/if_nge.c11
-rw-r--r--sys/dev/pci/if_nxe.c12
-rw-r--r--sys/dev/pci/if_pcn.c12
-rw-r--r--sys/dev/pci/if_sis.c11
-rw-r--r--sys/dev/pci/if_sk.c11
-rw-r--r--sys/dev/pci/if_ste.c11
-rw-r--r--sys/dev/pci/if_stge.c14
-rw-r--r--sys/dev/pci/if_tht.c12
-rw-r--r--sys/dev/pci/if_ti.c10
-rw-r--r--sys/dev/pci/if_tl.c11
-rw-r--r--sys/dev/pci/if_txp.c11
-rw-r--r--sys/dev/pci/if_vge.c10
-rw-r--r--sys/dev/pci/if_vic.c11
-rw-r--r--sys/dev/pci/if_vr.c11
-rw-r--r--sys/dev/pci/if_wb.c11
-rw-r--r--sys/dev/pci/if_xge.c10
30 files changed, 65 insertions, 262 deletions
diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c
index 4878cb58a5d..eae61660a28 100644
--- a/sys/dev/pci/if_bce.c
+++ b/sys/dev/pci/if_bce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bce.c,v 1.25 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_bce.c,v 1.26 2008/10/02 20:21:13 brad Exp $ */
/* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */
/*
@@ -440,11 +440,6 @@ bce_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->bce_ac, cmd, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -498,8 +493,7 @@ bce_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->bce_mii.mii_media, cmd);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->bce_ac, cmd, data);
}
if (error == 0) {
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index ece8c2fca30..539479badda 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.245 2008/09/23 00:27:18 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.246 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -3274,11 +3274,6 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -3351,12 +3346,10 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
}
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return (error);
}
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index 55b5617337b..aea799bddb6 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.65 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.66 2008/10/02 20:21:14 brad Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -4606,11 +4606,6 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -4668,12 +4663,10 @@ bnx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return (error);
}
diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c
index 7172f60b739..a6cfd556c05 100644
--- a/sys/dev/pci/if_cas.c
+++ b/sys/dev/pci/if_cas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cas.c,v 1.21 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_cas.c,v 1.22 2008/10/02 20:21:14 brad Exp $ */
/*
*
@@ -1689,13 +1689,7 @@ cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (cmd) {
-
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
if ((ifp->if_flags & IFF_RUNNING) == 0)
@@ -1758,8 +1752,7 @@ cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
splx(s);
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c
index 4958a4a33af..6bc9a6b689e 100644
--- a/sys/dev/pci/if_de.c
+++ b/sys/dev/pci/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.99 2008/03/04 19:43:18 miod Exp $ */
+/* $OpenBSD: if_de.c,v 1.100 2008/10/02 20:21:14 brad Exp $ */
/* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */
/*-
@@ -4152,11 +4152,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->tulip_ac, cmd, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (cmd) {
case SIOCSIFADDR: {
ifp->if_flags |= IFF_UP;
@@ -4218,8 +4213,7 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t data)
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->tulip_ac, cmd, data);
}
splx(s);
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 90048c260f5..85042fc2691 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.189 2008/09/30 17:59:22 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.190 2008/10/02 20:21:14 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -535,11 +535,6 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->interface_data, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (command) {
case SIOCSIFADDR:
IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFADDR (Set Interface "
@@ -612,8 +607,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
break;
default:
- IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%x)", (int)command);
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->interface_data, command, data);
}
splx(s);
diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c
index f80a5a004c8..8330c518b8f 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.13 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_et.c,v 1.14 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
*
@@ -1038,11 +1038,6 @@ et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return error;
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1097,11 +1092,10 @@ et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_miibus.mii_media, cmd);
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
splx(s);
-
return error;
}
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index f49899d9e14..a32f50555e2 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.8 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_ix.c,v 1.9 2008/10/02 20:21:14 brad Exp $ */
/******************************************************************************
@@ -434,11 +434,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (command) {
case SIOCSIFADDR:
IOCTL_DEBUGOUT("ioctl: SIOCxIFADDR (Get/Set Interface Addr)");
@@ -499,9 +494,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
break;
default:
- IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command);
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c
index 8faabde5d53..2e919761e78 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.47 2008/09/30 17:59:22 brad Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.48 2008/10/02 20:21:14 brad Exp $ */
#include <dev/pci/if_ixgb.h>
@@ -370,11 +370,6 @@ ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->interface_data, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (command) {
case SIOCSIFADDR:
IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFADDR (Set Interface "
@@ -438,8 +433,7 @@ ixgb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
break;
default:
- IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%X)\n", (int)command);
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->interface_data, command, data);
}
splx(s);
diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c
index 1403a69b9b2..660db35f37d 100644
--- a/sys/dev/pci/if_jme.c
+++ b/sys/dev/pci/if_jme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_jme.c,v 1.3 2008/09/29 22:43:45 deraadt Exp $ */
+/* $OpenBSD: if_jme.c,v 1.4 2008/10/02 20:21:14 brad Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
@@ -1320,11 +1320,6 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return error;
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1401,8 +1396,7 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
splx(s);
diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c
index 960c76fa457..a6f3d1e45dd 100644
--- a/sys/dev/pci/if_lii.c
+++ b/sys/dev/pci/if_lii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lii.c,v 1.18 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_lii.c,v 1.19 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation.
@@ -1049,14 +1049,10 @@ lii_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
struct lii_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)addr;
struct ifaddr *ifa;
- int s, error;
+ int s, error = 0;
s = splnet();
- error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr);
- if (error > 0)
- goto err;
-
switch(cmd) {
case SIOCSIFADDR:
SET(ifp->if_flags, IFF_UP);
@@ -1090,18 +1086,16 @@ lii_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr);
}
-err:
if (error == ENETRESET) {
if (ifp->if_flags & IFF_RUNNING)
lii_iff(sc);
error = 0;
}
- splx(s);
+ splx(s);
return error;
}
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c
index f7f4a8526b2..489ef5e9b96 100644
--- a/sys/dev/pci/if_msk.c
+++ b/sys/dev/pci/if_msk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_msk.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_msk.c,v 1.66 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -734,11 +734,6 @@ msk_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc_if->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -794,12 +789,10 @@ msk_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc_if->arpcom, command, data);
}
splx(s);
-
return (error);
}
diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c
index 2096cf0d59e..27ff873b5c3 100644
--- a/sys/dev/pci/if_myx.c
+++ b/sys/dev/pci/if_myx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_myx.c,v 1.8 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_myx.c,v 1.9 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -822,10 +822,6 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
int s, error = 0;
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_ac, cmd, data)) > 0) {
- splx(s);
- return (error);
- }
switch (cmd) {
case SIOCSIFADDR:
@@ -868,7 +864,7 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->sc_ac, cmd, data);
}
if (error == ENETRESET) {
@@ -879,7 +875,6 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
splx(s);
-
return (error);
}
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c
index 43bb11763c6..79d09748713 100644
--- a/sys/dev/pci/if_nfe.c
+++ b/sys/dev/pci/if_nfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfe.c,v 1.81 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.82 2008/10/02 20:21:14 brad Exp $ */
/*-
* Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr>
@@ -527,11 +527,6 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return error;
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -586,11 +581,10 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
splx(s);
-
return error;
}
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index bf9a030f957..ef1703a53a9 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.58 2008/05/23 08:49:27 brad Exp $ */
+/* $OpenBSD: if_nge.c,v 1.59 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -2046,11 +2046,6 @@ nge_ioctl(ifp, command, data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch(command) {
case SIOCSIFMTU:
if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu)
@@ -2123,12 +2118,10 @@ nge_ioctl(ifp, command, data)
}
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c
index ce105f74562..788a17e88d4 100644
--- a/sys/dev/pci/if_nxe.c
+++ b/sys/dev/pci/if_nxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nxe.c,v 1.55 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.56 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -1020,16 +1020,12 @@ nxe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
struct nxe_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)addr;
struct ifaddr *ifa;
- int error;
+ int error = 0;
int s;
rw_enter_write(&sc->sc_lock);
s = splnet();
- error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr);
- if (error > 0)
- goto err;
-
timeout_del(&sc->sc_tick);
switch (cmd) {
@@ -1066,8 +1062,7 @@ nxe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr);
}
if (error == ENETRESET) {
@@ -1081,7 +1076,6 @@ nxe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
nxe_tick(sc);
-err:
splx(s);
rw_exit_write(&sc->sc_lock);
return (error);
diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c
index 1d23e361ed5..58d5339d6c9 100644
--- a/sys/dev/pci/if_pcn.c
+++ b/sys/dev/pci/if_pcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pcn.c,v 1.19 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_pcn.c,v 1.20 2008/10/02 20:21:14 brad Exp $ */
/* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */
/*
@@ -1088,14 +1088,6 @@ pcn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- /* Try to get more packets going. */
- pcn_start(ifp);
-
- splx(s);
- return (error);
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1157,7 +1149,7 @@ pcn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
/* Try to get more packets going. */
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index b83130f53db..34fd7dac425 100644
--- a/sys/dev/pci/if_sis.c
+++ b/sys/dev/pci/if_sis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.81 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_sis.c,v 1.82 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1895,11 +1895,6 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return error;
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1959,12 +1954,10 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index cf48c0597b8..13c3b8b0e4c 100644
--- a/sys/dev/pci/if_sk.c
+++ b/sys/dev/pci/if_sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sk.c,v 1.147 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_sk.c,v 1.148 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -866,11 +866,6 @@ sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc_if->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -926,12 +921,10 @@ sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc_if->arpcom, command, data);
}
splx(s);
-
return (error);
}
diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c
index c2f1b3fe9bd..f817717a6b5 100644
--- a/sys/dev/pci/if_ste.c
+++ b/sys/dev/pci/if_ste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ste.c,v 1.41 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_ste.c,v 1.42 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1282,11 +1282,6 @@ ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return error;
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1349,12 +1344,10 @@ ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c
index c9a8273968a..d9e75e8e1d1 100644
--- a/sys/dev/pci/if_stge.c
+++ b/sys/dev/pci/if_stge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stge.c,v 1.40 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_stge.c,v 1.41 2008/10/02 20:21:14 brad Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
@@ -690,18 +690,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct stge_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)data;
struct ifaddr *ifa = (struct ifaddr *)data;
- int s, error;
+ int s, error = 0;
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- /* Try to get more packets going. */
- stge_start(ifp);
-
- splx(s);
- return (error);
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -761,7 +753,7 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
/* Try to get more packets going. */
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c
index 0f1eaf41b17..f20a2597307 100644
--- a/sys/dev/pci/if_tht.c
+++ b/sys/dev/pci/if_tht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tht.c,v 1.118 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_tht.c,v 1.119 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -866,16 +866,12 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
struct tht_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)addr;
struct ifaddr *ifa;
- int error;
+ int error = 0;
int s;
rw_enter_write(&sc->sc_lock);
s = splnet();
- error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr);
- if (error > 0)
- goto err;
-
switch (cmd) {
case SIOCSIFADDR:
ifa = (struct ifaddr *)addr;
@@ -919,8 +915,7 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_ac, cmd, addr);
}
if (error == ENETRESET) {
@@ -929,7 +924,6 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
error = 0;
}
-err:
splx(s);
rw_exit_write(&sc->sc_lock);
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c
index d78a80f617a..a0045948c75 100644
--- a/sys/dev/pci/if_ti.c
+++ b/sys/dev/pci/if_ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ti.c,v 1.87 2008/09/24 19:12:59 chl Exp $ */
+/* $OpenBSD: if_ti.c,v 1.88 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -2478,11 +2478,6 @@ ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -2546,8 +2541,7 @@ ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c
index bf42496923d..ac7a9dda767 100644
--- a/sys/dev/pci/if_tl.c
+++ b/sys/dev/pci/if_tl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tl.c,v 1.44 2008/09/10 14:01:23 blambert Exp $ */
+/* $OpenBSD: if_tl.c,v 1.45 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1788,11 +1788,6 @@ int tl_ioctl(ifp, command, data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return error;
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1854,12 +1849,10 @@ int tl_ioctl(ifp, command, data)
&sc->sc_mii.mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c
index 7642e8a1183..ba6043f8172 100644
--- a/sys/dev/pci/if_txp.c
+++ b/sys/dev/pci/if_txp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txp.c,v 1.94 2008/09/18 15:16:30 naddy Exp $ */
+/* $OpenBSD: if_txp.c,v 1.95 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2001
@@ -1213,11 +1213,6 @@ txp_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, command, data)) > 0) {
- splx(s);
- return error;
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1262,12 +1257,10 @@ txp_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c
index 24a0c1200ee..8259c41a1bf 100644
--- a/sys/dev/pci/if_vge.c
+++ b/sys/dev/pci/if_vge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vge.c,v 1.38 2008/09/10 14:01:23 blambert Exp $ */
+/* $OpenBSD: if_vge.c,v 1.39 2008/10/02 20:21:14 brad Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
@@ -1707,11 +1707,6 @@ vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1772,8 +1767,7 @@ vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c
index 15dedb3ef91..7c52bbbd4a1 100644
--- a/sys/dev/pci/if_vic.c
+++ b/sys/dev/pci/if_vic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vic.c,v 1.54 2008/09/10 14:01:23 blambert Exp $ */
+/* $OpenBSD: if_vic.c,v 1.55 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -1181,11 +1181,6 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_ac, cmd, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifa = (struct ifaddr *)data;
@@ -1234,8 +1229,7 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->sc_ac, cmd, data);
}
if (error == ENETRESET) {
@@ -1246,7 +1240,6 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
splx(s);
-
return (error);
}
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index 27115075d12..e4def20edf5 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vr.c,v 1.77 2008/09/24 08:41:29 mpf Exp $ */
+/* $OpenBSD: if_vr.c,v 1.78 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1333,11 +1333,6 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return error;
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1402,12 +1397,10 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c
index b869ec8322b..e94485747a7 100644
--- a/sys/dev/pci/if_wb.c
+++ b/sys/dev/pci/if_wb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wb.c,v 1.39 2008/09/10 14:01:23 blambert Exp $ */
+/* $OpenBSD: if_wb.c,v 1.40 2008/10/02 20:21:14 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1619,11 +1619,6 @@ int wb_ioctl(ifp, command, data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1668,12 +1663,10 @@ int wb_ioctl(ifp, command, data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, command);
break;
default:
- error = ENOTTY;
- break;
+ error = ether_ioctl(ifp, &sc->arpcom, command, data);
}
splx(s);
-
return(error);
}
diff --git a/sys/dev/pci/if_xge.c b/sys/dev/pci/if_xge.c
index 8636c04ea33..53db5138991 100644
--- a/sys/dev/pci/if_xge.c
+++ b/sys/dev/pci/if_xge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xge.c,v 1.44 2008/09/24 19:12:59 chl Exp $ */
+/* $OpenBSD: if_xge.c,v 1.45 2008/10/02 20:21:14 brad Exp $ */
/* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */
/*
@@ -964,11 +964,6 @@ xge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return (error);
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -1018,11 +1013,10 @@ xge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->xena_media, cmd);
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data);
}
splx(s);
-
return (error);
}