From owner-svn-src-projects@FreeBSD.ORG Thu Feb 10 00:01:50 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7165106564A; Thu, 10 Feb 2011 00:01:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B85C8FC08; Thu, 10 Feb 2011 00:01:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1A01oEs002284; Thu, 10 Feb 2011 00:01:50 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1A01oK1002282; Thu, 10 Feb 2011 00:01:50 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201102100001.p1A01oK1002282@svn.freebsd.org> From: Jeff Roberson Date: Thu, 10 Feb 2011 00:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218500 - projects/ofed/head/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2011 00:01:50 -0000 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;