diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1901,7 +1901,7 @@ for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { - TOEDEV(vi->ifp) = &td->tod; + SETTOEDEV(vi->ifp, &td->tod); } } diff --git a/sys/net/if.c b/sys/net/if.c --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4827,6 +4827,18 @@ return (ifp->if_type); } +void * +if_getllsoftc(if_t ifp) +{ + return (ifp->if_llsoftc); +} + +void +if_setllsoftc(if_t ifp, void *llsoftc) +{ + ifp->if_llsoftc = llsoftc; +}; + #ifdef DDB static void if_show_ifnet(struct ifnet *ifp) diff --git a/sys/net/if_var.h b/sys/net/if_var.h --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -412,7 +412,8 @@ #define IF_MINMTU 72 #define IF_MAXMTU 65535 -#define TOEDEV(ifp) ((ifp)->if_llsoftc) +#define TOEDEV(ifp) if_getllsoftc(ifp) +#define SETTOEDEV(ifp, sc) if_setllsoftc((ifp), (sc)) /* * The ifaddr structure contains information about one address @@ -597,6 +598,8 @@ int if_setsoftc(if_t ifp, void *softc); void *if_getsoftc(if_t ifp); int if_setflags(if_t ifp, int flags); +void if_setllsoftc(if_t ifp, void *softc); +void *if_getllsoftc(if_t ifp); int if_gethwaddr(const if_t ifp, struct ifreq *); int if_setmtu(if_t ifp, int mtu); int if_getmtu(const if_t ifp); diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1922,7 +1922,7 @@ if (p->if_capabilities & IFCAP_VLAN_TOE) cap |= p->if_capabilities & IFCAP_TOE; if (p->if_capenable & IFCAP_VLAN_TOE) { - TOEDEV(ifp) = TOEDEV(p); + SETTOEDEV(ifp, TOEDEV(p)); ena |= mena & IFCAP_TOE; }