Commit fa25dbfd authored by Justin Hibbits's avatar Justin Hibbits
Browse files

ifnet API: Change if_init() to take context argument

Some drivers, like iflib drivers, take a 'context' argument instead of a
ifnet argument, as a single interface may have multiple contexts.
Follow this scheme by passing the context argument down.  Most drivers
will likely pass 'ifp' as the context.

Reviewed by:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38102
parent 2e6a8c1a
......@@ -4622,9 +4622,9 @@ if_vlantrunkinuse(if_t ifp)
}
int
if_init(if_t ifp)
if_init(if_t ifp, void *ctx)
{
(*((struct ifnet *)ifp)->if_init)((struct ifnet *)ifp);
(*((struct ifnet *)ifp)->if_init)(ctx);
return (0);
}
......
......@@ -784,7 +784,7 @@ void if_bpfmtap(if_t ifp, struct mbuf *m);
void if_etherbpfmtap(if_t ifp, struct mbuf *m);
void if_vlancap(if_t ifp);
int if_transmit(if_t ifp, struct mbuf *m);
int if_init(if_t ifp);
int if_init(if_t ifp, void *ctx);
/*
* Traversing through interface address lists.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment