svn commit: r184617 - user/kmacy/HEAD_multi_tx/sys/net
Kip Macy
kmacy at FreeBSD.org
Mon Nov 3 22:27:48 PST 2008
Author: kmacy
Date: Tue Nov 4 06:27:48 2008
New Revision: 184617
URL: http://svn.freebsd.org/changeset/base/184617
Log:
add if_start_mbuf interface to ifnet
add initialization in if_attach using default function which does the same as IFQ_HANDOFF
Modified:
user/kmacy/HEAD_multi_tx/sys/net/if.c
user/kmacy/HEAD_multi_tx/sys/net/if_var.h
Modified: user/kmacy/HEAD_multi_tx/sys/net/if.c
==============================================================================
--- user/kmacy/HEAD_multi_tx/sys/net/if.c Tue Nov 4 06:25:32 2008 (r184616)
+++ user/kmacy/HEAD_multi_tx/sys/net/if.c Tue Nov 4 06:27:48 2008 (r184617)
@@ -125,6 +125,8 @@ static void if_start_deferred(void *cont
static void do_link_state_change(void *, int);
static int if_getgroup(struct ifgroupreq *, struct ifnet *);
static int if_getgroupmembers(struct ifgroupreq *);
+static int if_start_mbuf(struct ifnet *ifp, struct mbuf *m);
+
#ifdef INET6
/*
* XXX: declare here to avoid to include many inet6 related files..
@@ -518,7 +520,7 @@ if_attach(struct ifnet *ifp)
getmicrotime(&ifp->if_lastchange);
ifp->if_data.ifi_epoch = time_uptime;
ifp->if_data.ifi_datalen = sizeof(struct if_data);
-
+ ifp->if_start_mbuf = if_start_mbuf;
#ifdef MAC
mac_ifnet_init(ifp);
mac_ifnet_create(ifp);
@@ -2797,6 +2799,19 @@ if_start_deferred(void *context, int pen
(ifp->if_start)(ifp);
}
+/*
+ * Backwards compatibility interface for drivers
+ * that have not implemented it
+ */
+static int
+if_start_mbuf(struct ifnet *ifp, struct mbuf *m)
+{
+ int error;
+
+ IFQ_HANDOFF(ifp, m, error);
+ return (error);
+}
+
int
if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust)
{
Modified: user/kmacy/HEAD_multi_tx/sys/net/if_var.h
==============================================================================
--- user/kmacy/HEAD_multi_tx/sys/net/if_var.h Tue Nov 4 06:25:32 2008 (r184616)
+++ user/kmacy/HEAD_multi_tx/sys/net/if_var.h Tue Nov 4 06:27:48 2008 (r184617)
@@ -186,7 +186,9 @@ struct ifnet {
/* protected by if_addr_mtx */
void *if_pf_kif;
void *if_lagg; /* lagg glue */
- void *if_pspare[10]; /* multiq/TOE 3; vimage 3; general use 4 */
+ void *if_pspare[9]; /* multiq/TOE 3; vimage 3; general use 4 */
+ int (*if_start_mbuf) /* initiate output routine */
+ (struct ifnet *, struct mbuf *);
int if_ispare[2]; /* general use 2 */
};
More information about the svn-src-user
mailing list