diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2018-03-30 20:24:29 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2018-03-30 20:24:29 +0000 |
commit | 6361c24b8a009b0ce245d22ee62797adb01b152d (patch) | |
tree | e9393685f635b56c5a10a7eacac42f158c667743 /sys/dev | |
parent | 4b706099413af29d3eb006c6423815dae576b310 (diff) | |
download | src-6361c24b8a009b0ce245d22ee62797adb01b152d.tar.gz src-6361c24b8a009b0ce245d22ee62797adb01b152d.zip |
Fall back to ether_ioctl() by default.
The common pratice in ethernet device drivers is to fall back to
ether_ioctl() to implement generic ioctls not implemented by the driver
and to fail if no handler exists.
Convert these drivers to follow that practice rather than calling
ether_ioctl() for specific cases.
vxge(4) aready had the default case, but it was only called on failure
to match.
Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14895
Notes
Notes:
svn path=/head/; revision=331829
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ex/if_ex.c | 10 | ||||
-rw-r--r-- | sys/dev/ixgb/if_ixgb.c | 9 | ||||
-rw-r--r-- | sys/dev/nxge/if_nxge.c | 8 | ||||
-rw-r--r-- | sys/dev/vxge/vxge.c | 6 |
4 files changed, 5 insertions, 28 deletions
diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 863e61b73424..f8686878a6b8 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -823,12 +823,6 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) DODEBUG(Start_End, printf("%s: ex_ioctl: start ", ifp->if_xname);); switch(cmd) { - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: - error = ether_ioctl(ifp, cmd, data); - break; - case SIOCSIFFLAGS: DODEBUG(Start_End, printf("SIOCSIFFLAGS");); EX_LOCK(sc); @@ -850,8 +844,8 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, cmd); break; default: - DODEBUG(Start_End, printf("unknown");); - error = EINVAL; + error = ether_ioctl(ifp, cmd, data); + break; } DODEBUG(Start_End, printf("\n%s: ex_ioctl: finish\n", ifp->if_xname);); diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index 4aaa8dcaabc9..9e9ff89bd7bc 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -525,11 +525,6 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, caddr_t data) goto out; switch (command) { - case SIOCSIFADDR: - case SIOCGIFADDR: - IOCTL_DEBUGOUT("ioctl rcv'd: SIOCxIFADDR (Get/Set Interface Addr)"); - ether_ioctl(ifp, command, data); - break; case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); if (ifr->ifr_mtu > IXGB_MAX_JUMBO_FRAME_SIZE - ETHER_HDR_LEN) { @@ -610,8 +605,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, caddr_t data) } break; default: - IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%X)\n", (int)command); - error = EINVAL; + error = ether_ioctl(ifp, command, data); + break; } out: diff --git a/sys/dev/nxge/if_nxge.c b/sys/dev/nxge/if_nxge.c index 3c3591f38284..7380fa13f1eb 100644 --- a/sys/dev/nxge/if_nxge.c +++ b/sys/dev/nxge/if_nxge.c @@ -1623,12 +1623,6 @@ xge_ioctl(struct ifnet *ifnetp, unsigned long command, caddr_t data) } switch(command) { - /* Set/Get ifnet address */ - case SIOCSIFADDR: - case SIOCGIFADDR: - ether_ioctl(ifnetp, command, data); - break; - /* Set ifnet MTU */ case SIOCSIFMTU: retValue = xge_change_mtu(lldev, ifreqp->ifr_mtu); @@ -1713,7 +1707,7 @@ xge_ioctl(struct ifnet *ifnetp, unsigned long command, caddr_t data) break; default: - retValue = EINVAL; + retValue = ether_ioctl(ifnetp, command, data); break; } return retValue; diff --git a/sys/dev/vxge/vxge.c b/sys/dev/vxge/vxge.c index ebc5b8a35088..850311de4133 100644 --- a/sys/dev/vxge/vxge.c +++ b/sys/dev/vxge/vxge.c @@ -3573,12 +3573,6 @@ vxge_ioctl(ifnet_t ifp, u_long command, caddr_t data) return (EBUSY); switch (command) { - /* Set/Get ifnet address */ - case SIOCSIFADDR: - case SIOCGIFADDR: - ether_ioctl(ifp, command, data); - break; - /* Set Interface MTU */ case SIOCSIFMTU: err = vxge_change_mtu(vdev, (unsigned long)ifr->ifr_mtu); |