Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2008 23:32:09 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 149295 for review
Message-ID:  <200809052332.m85NW9hm015129@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149295

Change 149295 by sam@sam_ebb on 2008/09/05 23:31:33

	Reuse now free M_PROTO1 flag to mark frames as encapsulted with
	an 802.11 header (M_ENCAP); this is going to be used shortly.
	
	Also fixed some straggler mis-merges (not critical except for
	fixing send of 4-address null data frames).

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#33 edit
.. //depot/projects/vap/sys/net80211/ieee80211_output.c#55 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#33 (text+ko) ====

@@ -239,7 +239,7 @@
 struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
 
 /* tx path usage */
-#define	M_LINK0		M_PROTO1		/* WEP requested */
+#define	M_ENCAP		M_PROTO1		/* 802.11 encap done */
 #define	M_WDS		M_PROTO2		/* WDS frame */
 #define	M_EAPOL		M_PROTO3		/* PAE/EAPOL frame */
 #define	M_PWR_SAV	M_PROTO4		/* bypass PS handling */
@@ -248,7 +248,7 @@
 #define	M_TXCB		M_PROTO7		/* do tx complete callback */
 #define	M_AMPDU_MPDU	M_PROTO8		/* ok for A-MPDU aggregation */
 #define	M_80211_TX \
-	(M_LINK0|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU)
+	(M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU)
 
 /* rx path usage */
 #define	M_AMPDU		M_PROTO1		/* A-MPDU subframe */

==== //depot/projects/vap/sys/net80211/ieee80211_output.c#55 (text+ko) ====

@@ -515,6 +515,7 @@
 		    "encrypting frame (%s)", __func__);
 		wh->i_fc[1] |= IEEE80211_FC1_WEP;
 	}
+	m->m_flags |= M_ENCAP;		/* mark encapsulated */
 
 	KASSERT(type != IEEE80211_FC0_SUBTYPE_PROBE_RESP, ("probe response?"));
 	M_WME_SETAC(m, params->ibp_pri);
@@ -593,9 +594,10 @@
 		if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) &&
 		    vap->iv_opmode != IEEE80211_M_HOSTAP)
 			wh->i_fc[1] |= IEEE80211_FC1_PWR_MGT;
-		m->m_len = m->m_pkthdr.len = sizeof(struct ieee80211_frame);
 	}
 	m->m_len = m->m_pkthdr.len = hdrlen;
+	m->m_flags |= M_ENCAP;		/* mark encapsulated */
+
 	M_WME_SETAC(m, WME_AC_BE);
 
 	IEEE80211_NODE_STAT(ni, tx_data);
@@ -1127,6 +1129,8 @@
 	    key != NULL ? key->wk_cipher->ic_header : 0, vap->iv_fragthreshold))
 		goto bad;
 
+	m->m_flags |= M_ENCAP;		/* mark encapsulated */
+
 	IEEE80211_NODE_STAT(ni, tx_data);
 	if (IEEE80211_IS_MULTICAST(wh->i_addr1))
 		IEEE80211_NODE_STAT(ni, tx_mcast);
@@ -1735,14 +1739,18 @@
 	KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ieee80211_frame),
 	    ("leading space %d", M_LEADINGSPACE(m)));
 	M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT);
-	if (m == NULL)
+	if (m == NULL) {
+		/* NB: cannot happen */
+		ieee80211_free_node(ni);
 		return ENOMEM;
+	}
 
 	wh = mtod(m, struct ieee80211_frame *);
 	ieee80211_send_setup(ni, wh,
 		IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ,
 		sa, da, bssid);
 	/* XXX power management? */
+	m->m_flags |= M_ENCAP;		/* mark encapsulated */
 
 	M_WME_SETAC(m, WME_AC_BE);
 
@@ -2332,6 +2340,7 @@
 		IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP,
 		vap->iv_myaddr, da, bss->ni_bssid);
 	/* XXX power management? */
+	m->m_flags |= M_ENCAP;		/* mark encapsulated */
 
 	M_WME_SETAC(m, WME_AC_BE);
 



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