Date: Fri, 30 Mar 2018 20:24:29 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331829 - in head/sys/dev: ex ixgb nxge vxge Message-ID: <201803302024.w2UKOTvH036277@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Fri Mar 30 20:24:29 2018 New Revision: 331829 URL: https://svnweb.freebsd.org/changeset/base/331829 Log: 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 Modified: head/sys/dev/ex/if_ex.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/nxge/if_nxge.c head/sys/dev/vxge/vxge.c Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Fri Mar 30 20:11:12 2018 (r331828) +++ head/sys/dev/ex/if_ex.c Fri Mar 30 20:24:29 2018 (r331829) @@ -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);); Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Fri Mar 30 20:11:12 2018 (r331828) +++ head/sys/dev/ixgb/if_ixgb.c Fri Mar 30 20:24:29 2018 (r331829) @@ -525,11 +525,6 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, 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, } break; default: - IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%X)\n", (int)command); - error = EINVAL; + error = ether_ioctl(ifp, command, data); + break; } out: Modified: head/sys/dev/nxge/if_nxge.c ============================================================================== --- head/sys/dev/nxge/if_nxge.c Fri Mar 30 20:11:12 2018 (r331828) +++ head/sys/dev/nxge/if_nxge.c Fri Mar 30 20:24:29 2018 (r331829) @@ -1623,12 +1623,6 @@ xge_ioctl(struct ifnet *ifnetp, unsigned long command, } 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, break; default: - retValue = EINVAL; + retValue = ether_ioctl(ifnetp, command, data); break; } return retValue; Modified: head/sys/dev/vxge/vxge.c ============================================================================== --- head/sys/dev/vxge/vxge.c Fri Mar 30 20:11:12 2018 (r331828) +++ head/sys/dev/vxge/vxge.c Fri Mar 30 20:24:29 2018 (r331829) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803302024.w2UKOTvH036277>