IfAPI: Add l2com accessor for firewire.

Summary:
Firewire is the only device driver that accesses the l2com member, all
other accesses are handled within the netstack itself.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38203
This commit is contained in:
Justin Hibbits 2023-01-25 14:45:53 -05:00
parent 0d2684e15e
commit 31cfaf191b
3 changed files with 8 additions and 1 deletions

View File

@ -131,7 +131,7 @@ struct fw_com {
uint16_t fc_node; /* our nodeid */
struct fw_reass_list fc_frags; /* partial datagrams */
};
#define IFP2FWC(ifp) ((struct fw_com *)(ifp)->if_l2com)
#define IFP2FWC(ifp) ((struct fw_com *)if_getl2com(ifp))
extern void firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src);
extern void firewire_ifattach(struct ifnet *, struct fw_hwaddr *);

View File

@ -4941,6 +4941,12 @@ if_getpcp(if_t ifp)
return (ifp->if_pcp);
}
void *
if_getl2com(if_t ifp)
{
return (ifp->if_l2com);
}
#ifdef DDB
static void
if_show_ifnet(struct ifnet *ifp)

View File

@ -644,6 +644,7 @@ struct label *if_getmaclabel(if_t ifp);
void if_setmaclabel(if_t ifp, struct label *label);
struct bpf_if *if_getbpf(if_t ifp);
uint8_t if_getpcp(if_t ifp);
void *if_getl2com(if_t ifp);
struct ifvlantrunk *if_getvlantrunk(if_t ifp);
void *if_getafdata(if_t ifp, int);