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
This commit is contained in:
parent
2e6a8c1ae3
commit
fa25dbfd98
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user