Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2011 00:01:50 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r218500 - projects/ofed/head/sys/net
Message-ID:  <201102100001.p1A01oK1002282@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Thu Feb 10 00:01:50 2011
New Revision: 218500
URL: http://svn.freebsd.org/changeset/base/218500

Log:
   - Add some comments for the new functions and code introduced to
     support non ethernet devices and the IB stack.

Modified:
  projects/ofed/head/sys/net/if_vlan.c

Modified: projects/ofed/head/sys/net/if_vlan.c
==============================================================================
--- projects/ofed/head/sys/net/if_vlan.c	Thu Feb 10 00:01:10 2011	(r218499)
+++ projects/ofed/head/sys/net/if_vlan.c	Thu Feb 10 00:01:50 2011	(r218500)
@@ -595,6 +595,9 @@ restart:
 	VLAN_UNLOCK();
 }
 
+/*
+ * Return the trunk device for a virtual interface.
+ */
 static struct ifnet  *
 vlan_trunkdev(struct ifnet *ifp)
 {
@@ -611,6 +614,9 @@ vlan_trunkdev(struct ifnet *ifp)
 	return (ifp);
 }
 
+/*
+ * Return the 16bit vlan tag for this interface.
+ */
 static int
 vlan_tag(struct ifnet *ifp, uint16_t *tagp)
 {
@@ -623,6 +629,10 @@ vlan_tag(struct ifnet *ifp, uint16_t *ta
 	return (0);
 }
 
+/*
+ * Return a driver specific cookie for this interface.  Synchronization
+ * with setcookie must be provided by the driver. 
+ */
 static void *
 vlan_cookie(struct ifnet *ifp)
 {
@@ -634,6 +644,10 @@ vlan_cookie(struct ifnet *ifp)
 	return (ifv->ifv_cookie);
 }
 
+/*
+ * Store a cookie in our softc that drivers can use to store driver
+ * private per-instance data in.
+ */
 static int
 vlan_setcookie(struct ifnet *ifp, void *cookie)
 {
@@ -646,6 +660,9 @@ vlan_setcookie(struct ifnet *ifp, void *
 	return (0);
 }
 
+/*
+ * Return the vlan device present at the specific tag.
+ */
 static struct ifnet *
 vlan_devat(struct ifnet *ifp, uint16_t tag)
 {
@@ -1226,7 +1243,9 @@ exists:
 	ifv->ifv_trunk = trunk;
 	ifp = ifv->ifv_ifp;
 	/*
-	 * Initialize fields from our parent.
+	 * Initialize fields from our parent.  This duplicates some
+	 * work with ether_ifattach() but allows for non-ethernet
+	 * interfaces to also work.
 	 */
 	ifp->if_mtu = p->if_mtu - ifv->ifv_mtufudge;
 	ifp->if_baudrate = p->if_baudrate;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102100001.p1A01oK1002282>