diff options
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_freebsd.h | 21 | ||||
-rw-r--r-- | sys/net80211/ieee80211_hostap.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_input.c | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index 34e66d0..711bac3 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -234,9 +234,22 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen); #define M_FF M_PROTO6 /* fast frame */ #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ + +/* + * FreeBSD-HEAD from 1000046 retired M_*FRAG* flags and turned them + * into header flags instead. So, we use the new protocol-specific + * flags. + * + * Earlier FreeBSD versions overload M_FRAG, M_FIRSTFRAG and M_LASTFRAG. + * + * XXX TODO: rename these fields so there are no namespace clashes! + */ +#if __FreeBSD_version >= 1000046 #define M_FRAG M_PROTO9 /* frame fragmentation */ #define M_FIRSTFRAG M_PROTO10 /* first frame fragment */ #define M_LASTFRAG M_PROTO11 /* last frame fragment */ +#endif + #define M_80211_TX \ (M_ENCAP|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB| \ M_AMPDU_MPDU|M_FRAG|M_FIRSTFRAG|M_LASTFRAG) @@ -249,10 +262,18 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen); #endif #define M_80211_RX (M_AMPDU|M_WEP|M_AMPDU_MPDU) +#if __FreeBSD_version >= 1000046 #define IEEE80211_MBUF_TX_FLAG_BITS \ M_FLAG_BITS \ "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \ "\24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG" +#else +/* There aren't any flag bits available for versions before this */ +/* XXX TODO: implement M_FLAG_BITS for this! */ +#define IEEE80211_MBUF_TX_FLAG_BITS \ + "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \ + "\24M_AMPDU_MPDU" +#endif #define IEEE80211_MBUF_RX_FLAG_BITS \ M_FLAG_BITS \ diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 5839e7d..93a9b27 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -355,8 +355,12 @@ hostap_deliver_data(struct ieee80211vap *vap, struct ifnet *ifp = vap->iv_ifp; /* clear driver/net80211 flags before passing up */ +#if __FreeBSD_version >= 1000046 m->m_flags &= ~(M_MCAST | M_BCAST); m_clrprotoflags(m); +#else + m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); +#endif KASSERT(vap->iv_opmode == IEEE80211_M_HOSTAP, ("gack, opmode %d", vap->iv_opmode)); diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index a32ef18..5e95646 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -251,7 +251,9 @@ ieee80211_deliver_data(struct ieee80211vap *vap, /* clear driver/net80211 flags before passing up */ m->m_flags &= ~(M_MCAST | M_BCAST); +#if __FreeBSD_version >= 1000046 m_clrprotoflags(m); +#endif /* NB: see hostap_deliver_data, this path doesn't handle hostap */ KASSERT(vap->iv_opmode != IEEE80211_M_HOSTAP, ("gack, hostap")); |