svn commit: r277605 - in projects/ifnet/sys: dev/msk dev/virtio/network net netgraph

Gleb Smirnoff glebius at FreeBSD.org
Fri Jan 23 19:43:59 UTC 2015


Author: glebius
Date: Fri Jan 23 19:43:57 2015
New Revision: 277605
URL: https://svnweb.freebsd.org/changeset/base/277605

Log:
  While not too late, change order of arguments to if_drvioctl(),
  making it more "natural:
  - ifp is the first argument
  - ioctl cmd and argument go together

Modified:
  projects/ifnet/sys/dev/msk/if_msk.c
  projects/ifnet/sys/dev/virtio/network/if_vtnet.c
  projects/ifnet/sys/net/if.c
  projects/ifnet/sys/net/if.h
  projects/ifnet/sys/netgraph/ng_iface.c

Modified: projects/ifnet/sys/dev/msk/if_msk.c
==============================================================================
--- projects/ifnet/sys/dev/msk/if_msk.c	Fri Jan 23 19:33:46 2015	(r277604)
+++ projects/ifnet/sys/dev/msk/if_msk.c	Fri Jan 23 19:43:57 2015	(r277605)
@@ -1097,10 +1097,10 @@ msk_ioctl(if_t ifp, u_long command, void
 				struct ifreq tmp;
 
 				MSK_IF_UNLOCK(sc_if);
-				if_drvioctl(SIOCGIFCAP, ifp, &tmp, td);
+				if_drvioctl(ifp, SIOCGIFCAP, &tmp, td);
 				tmp.ifr_reqcap = tmp.ifr_curcap &
 				    ~(MSK_CSUM_FEATURES | CSUM_TSO);
-				if_drvioctl(SIOCSIFCAP, ifp, &tmp, td);
+				if_drvioctl(ifp, SIOCSIFCAP, &tmp, td);
 				MSK_IF_LOCK(sc_if);
 			}
 		}

Modified: projects/ifnet/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- projects/ifnet/sys/dev/virtio/network/if_vtnet.c	Fri Jan 23 19:33:46 2015	(r277604)
+++ projects/ifnet/sys/dev/virtio/network/if_vtnet.c	Fri Jan 23 19:43:57 2015	(r277605)
@@ -3071,13 +3071,13 @@ vtnet_attach_disable_promisc(struct vtne
 
 	VTNET_CORE_LOCK(sc);
 	if ((sc->vtnet_flags & VTNET_FLAG_CTRL_RX) == 0) {
-		(void )if_drvioctl(SIOCGIFFLAGS, ifp, &ifr, curthread);
+		(void )if_drvioctl(ifp, SIOCGIFFLAGS, &ifr, curthread);
 		ifr.ifr_flags |= IFF_PROMISC;
-		(void )if_drvioctl(SIOCSIFFLAGS, ifp, &ifr, curthread);
+		(void )if_drvioctl(ifp, SIOCSIFFLAGS, &ifr, curthread);
 	} else if (vtnet_set_promisc(sc, 0) != 0) {
-		(void )if_drvioctl(SIOCGIFFLAGS, ifp, &ifr, curthread);
+		(void )if_drvioctl(ifp, SIOCGIFFLAGS, &ifr, curthread);
 		ifr.ifr_flags |= IFF_PROMISC;
-		(void )if_drvioctl(SIOCSIFFLAGS, ifp, &ifr, curthread);
+		(void )if_drvioctl(ifp, SIOCSIFFLAGS, &ifr, curthread);
 		device_printf(sc->vtnet_dev,
 		    "cannot disable default promiscuous mode\n");
 	}

Modified: projects/ifnet/sys/net/if.c
==============================================================================
--- projects/ifnet/sys/net/if.c	Fri Jan 23 19:33:46 2015	(r277604)
+++ projects/ifnet/sys/net/if.c	Fri Jan 23 19:43:57 2015	(r277605)
@@ -2283,7 +2283,7 @@ ifunit(const char *name)
  * Hardware specific interface ioctls.
  */
 int
-if_drvioctl(u_long cmd, struct ifnet *ifp, void *data, struct thread *td)
+if_drvioctl(struct ifnet *ifp, u_long cmd, void *data, struct thread *td)
 {
 	struct ifreq *ifr;
 	size_t namelen, onamelen;
@@ -2793,7 +2793,7 @@ ifioctl(struct socket *so, u_long cmd, c
 		return (ENXIO);
 	}
 
-	error = if_drvioctl(cmd, ifp, data, td);
+	error = if_drvioctl(ifp, cmd, data, td);
 	if (error != ENOIOCTL) {
 		if_rele(ifp);
 		CURVNET_RESTORE();

Modified: projects/ifnet/sys/net/if.h
==============================================================================
--- projects/ifnet/sys/net/if.h	Fri Jan 23 19:33:46 2015	(r277604)
+++ projects/ifnet/sys/net/if.h	Fri Jan 23 19:43:57 2015	(r277605)
@@ -716,7 +716,7 @@ void	if_setbaudrate(if_t, uint64_t);
 void	if_link_state_change(if_t, int);
 void *	if_getsoftc(if_t, ift_feature);
 int	if_printf(if_t, const char *, ...) __printflike(2, 3);
-int	if_drvioctl(u_long, struct ifnet *, void *, struct thread *);
+int	if_drvioctl(if_t, u_long, void *, struct thread *);
 uint64_t if_get_counter_default(if_t, ift_counter);
 
 /*

Modified: projects/ifnet/sys/netgraph/ng_iface.c
==============================================================================
--- projects/ifnet/sys/netgraph/ng_iface.c	Fri Jan 23 19:33:46 2015	(r277604)
+++ projects/ifnet/sys/netgraph/ng_iface.c	Fri Jan 23 19:43:57 2015	(r277605)
@@ -569,7 +569,7 @@ ng_iface_rcvmsg(node_p node, item_p item
 				error = ENOMEM;
 				break;
 			}
-			if_drvioctl(SIOCGIFINDEX, ifp, &ifr, curthread);
+			if_drvioctl(ifp, SIOCGIFINDEX, &ifr, curthread);
 			*((uint32_t *)resp->data) = ifr.ifr_index;
 			break;
 		    }


More information about the svn-src-projects mailing list