Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2013 05:53:47 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254640 - head/sys/net80211
Message-ID:  <201308220553.r7M5rlbG069416@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Aug 22 05:53:47 2013
New Revision: 254640
URL: http://svnweb.freebsd.org/changeset/base/254640

Log:
  Add in some backwards compatability hacks to make -HEAD net80211 compile
  on -9.

Modified:
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_input.c

Modified: head/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.h	Thu Aug 22 05:07:50 2013	(r254639)
+++ head/sys/net80211/ieee80211_freebsd.h	Thu Aug 22 05:53:47 2013	(r254640)
@@ -234,9 +234,22 @@ struct mbuf *ieee80211_getmgtframe(uint8
 #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
 #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 \

Modified: head/sys/net80211/ieee80211_hostap.c
==============================================================================
--- head/sys/net80211/ieee80211_hostap.c	Thu Aug 22 05:07:50 2013	(r254639)
+++ head/sys/net80211/ieee80211_hostap.c	Thu Aug 22 05:53:47 2013	(r254640)
@@ -355,8 +355,12 @@ hostap_deliver_data(struct ieee80211vap 
 	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));

Modified: head/sys/net80211/ieee80211_input.c
==============================================================================
--- head/sys/net80211/ieee80211_input.c	Thu Aug 22 05:07:50 2013	(r254639)
+++ head/sys/net80211/ieee80211_input.c	Thu Aug 22 05:53:47 2013	(r254640)
@@ -251,7 +251,9 @@ ieee80211_deliver_data(struct ieee80211v
 
 	/* 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"));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308220553.r7M5rlbG069416>