svn commit: r277066 - in projects/ifnet/sys: dev/virtio/network net

Gleb Smirnoff glebius at FreeBSD.org
Mon Jan 12 12:34:25 UTC 2015


Author: glebius
Date: Mon Jan 12 12:34:22 2015
New Revision: 277066
URL: https://svnweb.freebsd.org/changeset/base/277066

Log:
  Rename ifdrv_dname to ifdrv_name, to reduce tautology.

Modified:
  projects/ifnet/sys/dev/virtio/network/if_vtnet.c
  projects/ifnet/sys/net/if.c
  projects/ifnet/sys/net/if.h
  projects/ifnet/sys/net/if_clone.c
  projects/ifnet/sys/net/if_loop.c
  projects/ifnet/sys/net/if_mib.c

Modified: projects/ifnet/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- projects/ifnet/sys/dev/virtio/network/if_vtnet.c	Mon Jan 12 11:25:04 2015	(r277065)
+++ projects/ifnet/sys/dev/virtio/network/if_vtnet.c	Mon Jan 12 12:34:22 2015	(r277066)
@@ -304,7 +304,7 @@ static struct ifdriver vtnet_ifdrv = {
 		.ifop_transmit = vtnet_txq_mq_start,
 		.ifop_qflush = vtnet_qflush,
 	},
-	.ifdrv_dname = "vtnet",
+	.ifdrv_name = "vtnet",
 	.ifdrv_type = IFT_ETHER,
 	.ifdrv_hdrlen = sizeof(struct ether_vlan_header),
 };

Modified: projects/ifnet/sys/net/if.c
==============================================================================
--- projects/ifnet/sys/net/if.c	Mon Jan 12 11:25:04 2015	(r277065)
+++ projects/ifnet/sys/net/if.c	Mon Jan 12 12:34:22 2015	(r277066)
@@ -473,7 +473,7 @@ ifdriver_bless(struct ifdriver *ifdrv, s
 		KASSERT(ifdrv->ifdrv_tsomax->tsomax_bytes == 0 ||
 		    ifdrv->ifdrv_tsomax->tsomax_bytes >= (IP_MAXPACKET / 8),
 		    ("%s: tsomax_bytes is outside of range",
-		    ifdrv->ifdrv_dname));
+		    ifdrv->ifdrv_name));
 #endif
 
 	ifdrv->ifdrv_flags |= IFDRV_BLESSED;
@@ -535,7 +535,7 @@ if_attach(struct if_attach_args *ifat)
 		KASSERT(ifat->ifat_tsomax->tsomax_bytes == 0 ||
 		    ifat->ifat_tsomax->tsomax_bytes >= (IP_MAXPACKET / 8),
 		    ("%s: tsomax_bytes is outside of range",
-		    ifdrv->ifdrv_dname));
+		    ifdrv->ifdrv_name));
 		ifp->if_tsomax = malloc(sizeof(struct iftsomax), M_IFNET,
 		    M_WAITOK);
 		bcopy(ifat->ifat_tsomax, ifp->if_tsomax,
@@ -554,9 +554,9 @@ if_attach(struct if_attach_args *ifat)
 	ifp->if_dunit = ifat->ifat_dunit;
 	if (ifat->ifat_dunit != IF_DUNIT_NONE)
 		snprintf(ifp->if_xname, IFNAMSIZ, "%s%d",
-		    ifdrv->ifdrv_dname, ifat->ifat_dunit);
+		    ifdrv->ifdrv_name, ifat->ifat_dunit);
 	else
-		strlcpy(ifp->if_xname, ifdrv->ifdrv_dname, IFNAMSIZ);
+		strlcpy(ifp->if_xname, ifdrv->ifdrv_name, IFNAMSIZ);
 
 	ifq_init(&ifp->if_snd, ifp); /* XXXGL */
 
@@ -738,7 +738,7 @@ if_tsomax_update(if_t ifp, const struct 
 
 	KASSERT(ifp->if_tsomax != ifp->if_drv->ifdrv_tsomax,
 	    ("%s: interface %s (driver %s) has static if_tsomax", __func__,
-	    ifp->if_xname, ifp->if_drv->ifdrv_dname));
+	    ifp->if_xname, ifp->if_drv->ifdrv_name));
 
 	if (ifp->if_tsomax->tsomax_bytes != new->tsomax_bytes) {
 		ifp->if_tsomax->tsomax_bytes = new->tsomax_bytes;

Modified: projects/ifnet/sys/net/if.h
==============================================================================
--- projects/ifnet/sys/net/if.h	Mon Jan 12 11:25:04 2015	(r277065)
+++ projects/ifnet/sys/net/if.h	Mon Jan 12 12:34:22 2015	(r277066)
@@ -638,12 +638,12 @@ struct ifdriver {
 	struct ifops		ifdrv_ops;
 	struct iftsomax		*ifdrv_tsomax;
 	/*
-	 * The ifdrv_dname must be a pointer to storage which will last as
+	 * The ifdrv_name must be a pointer to storage which will last as
 	 * long as any interface does.  For physical devices, the result of
 	 * device_get_name(dev) is a good choice and for pseudo-devices a
 	 * static string works well.
 	 */
-	const char *	ifdrv_dname;
+	const char *	ifdrv_name;
 	ifType		ifdrv_type;	/* from if_types.h */
 	uint8_t		ifdrv_hdrlen;	/* media header length */
 	uint8_t		ifdrv_addrlen;	/* media address length */

Modified: projects/ifnet/sys/net/if_clone.c
==============================================================================
--- projects/ifnet/sys/net/if_clone.c	Mon Jan 12 11:25:04 2015	(r277065)
+++ projects/ifnet/sys/net/if_clone.c	Mon Jan 12 12:34:22 2015	(r277066)
@@ -257,7 +257,7 @@ if_clone_destroy(const char *name)
 	/* Find the cloner for this interface */
 	IF_CLONERS_LOCK();
 	LIST_FOREACH(ifc, &V_if_cloners, ifc_list) {
-		if (strcmp(ifc->ifc_name, ifp->if_drv->ifdrv_dname) == 0) {
+		if (strcmp(ifc->ifc_name, ifp->if_drv->ifdrv_name) == 0) {
 			break;
 		}
 	}

Modified: projects/ifnet/sys/net/if_loop.c
==============================================================================
--- projects/ifnet/sys/net/if_loop.c	Mon Jan 12 11:25:04 2015	(r277065)
+++ projects/ifnet/sys/net/if_loop.c	Mon Jan 12 12:34:22 2015	(r277066)
@@ -107,7 +107,7 @@ static struct ifdriver lo_ifdrv = {
 		.ifop_ioctl = loioctl,
 		.ifop_output = looutput,
 	},
-	.ifdrv_dname = loname,
+	.ifdrv_name = loname,
 	.ifdrv_type = IFT_LOOP,
 	.ifdrv_dlt = DLT_NULL,
 	.ifdrv_dlt_hdrlen = sizeof(uint32_t),

Modified: projects/ifnet/sys/net/if_mib.c
==============================================================================
--- projects/ifnet/sys/net/if_mib.c	Mon Jan 12 11:25:04 2015	(r277065)
+++ projects/ifnet/sys/net/if_mib.c	Mon Jan 12 12:34:22 2015	(r277066)
@@ -124,15 +124,15 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX
 
 	case IFDATA_DRIVERNAME:
 		/* 20 is enough for 64bit ints */
-		dlen = strlen(ifp->if_drv->ifdrv_dname) + 20 + 1;
+		dlen = strlen(ifp->if_drv->ifdrv_name) + 20 + 1;
 		if ((dbuf = malloc(dlen, M_TEMP, M_NOWAIT)) == NULL) {
 			error = ENOMEM;
 			goto out;
 		}
 		if (ifp->if_dunit == IF_DUNIT_NONE)
-			strcpy(dbuf, ifp->if_drv->ifdrv_dname);
+			strcpy(dbuf, ifp->if_drv->ifdrv_name);
 		else
-			sprintf(dbuf, "%s%d", ifp->if_drv->ifdrv_dname,
+			sprintf(dbuf, "%s%d", ifp->if_drv->ifdrv_name,
 			    ifp->if_dunit);
 
 		error = SYSCTL_OUT(req, dbuf, strlen(dbuf) + 1);


More information about the svn-src-projects mailing list