svn commit: r191553 - head/sys/net80211

Sam Leffler sam at FreeBSD.org
Sun Apr 26 23:02:18 UTC 2009


Author: sam
Date: Sun Apr 26 23:02:17 2009
New Revision: 191553
URL: http://svn.freebsd.org/changeset/base/191553

Log:
  hoist ampdu tx aggregation setup from ieee80211_encap to ieee80211_start
  where it was meant all along (the code was in encap because ampdu was
  implemented pre vaps)

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Sun Apr 26 22:54:51 2009	(r191552)
+++ head/sys/net80211/ieee80211_output.c	Sun Apr 26 23:02:17 2009	(r191553)
@@ -251,8 +251,43 @@ ieee80211_start(struct ifnet *ifp)
 
 		BPF_MTAP(ifp, m);		/* 802.3 tx */
  
+		/*
+		 * Check if A-MPDU tx aggregation is setup or if we
+		 * should try to enable it.  The sta must be associated
+		 * with HT and A-MPDU enabled for use.  When the policy
+		 * routine decides we should enable A-MPDU we issue an
+		 * ADDBA request and wait for a reply.  The frame being
+		 * encapsulated will go out w/o using A-MPDU, or possibly
+		 * it might be collected by the driver and held/retransmit.
+		 * The default ic_ampdu_enable routine handles staggering
+		 * ADDBA requests in case the receiver NAK's us or we are
+		 * otherwise unable to establish a BA stream.
+		 */
+		if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) &&
+		    (vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_TX) &&
+		    (m->m_flags & M_EAPOL) == 0) {
+			const int ac = M_WME_GETAC(m);
+			struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac];
+
+			ieee80211_txampdu_count_packet(tap);
+			if (IEEE80211_AMPDU_RUNNING(tap)) {
+				/*
+				 * Operational, mark frame for aggregation.
+				 *
+				 * XXX do tx aggregation here
+				 */
+				m->m_flags |= M_AMPDU_MPDU;
+			} else if (!IEEE80211_AMPDU_REQUESTED(tap) &&
+			    ic->ic_ampdu_enable(ni, tap)) {
+				/*
+				 * Not negotiated yet, request service.
+				 */
+				ieee80211_ampdu_request(ni, tap);
+				/* XXX hold frame for reply? */
+			}
+		}
 #ifdef IEEE80211_SUPPORT_SUPERG
-		if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) {
+		else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) {
 			m = ieee80211_ff_check(ni, m);
 			if (m == NULL) {
 				/* NB: any ni ref held on stageq */
@@ -1042,42 +1077,6 @@ ieee80211_encap(struct ieee80211vap *vap
 		/* map from access class/queue to 11e header priorty value */
 		tid = WME_AC_TO_TID(ac);
 		qos[0] = tid & IEEE80211_QOS_TID;
-		/*
-		 * Check if A-MPDU tx aggregation is setup or if we
-		 * should try to enable it.  The sta must be associated
-		 * with HT and A-MPDU enabled for use.  When the policy
-		 * routine decides we should enable A-MPDU we issue an
-		 * ADDBA request and wait for a reply.  The frame being
-		 * encapsulated will go out w/o using A-MPDU, or possibly
-		 * it might be collected by the driver and held/retransmit.
-		 * The default ic_ampdu_enable routine handles staggering
-		 * ADDBA requests in case the receiver NAK's us or we are
-		 * otherwise unable to establish a BA stream.
-		 */
-		if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) &&
-		    (vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_TX)) {
-			struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac];
-
-			ieee80211_txampdu_count_packet(tap);
-			if (IEEE80211_AMPDU_RUNNING(tap)) {
-				/*
-				 * Operational, mark frame for aggregation.
-				 *
-				 * NB: We support only immediate BA's for
-				 * AMPDU which means we set the QoS control
-				 * field to "normal ack" (0) to get "implicit
-				 * block ack" behaviour.
-				 */
-				m->m_flags |= M_AMPDU_MPDU;
-			} else if (!IEEE80211_AMPDU_REQUESTED(tap) &&
-			    ic->ic_ampdu_enable(ni, tap)) {
-				/*
-				 * Not negotiated yet, request service.
-				 */
-				ieee80211_ampdu_request(ni, tap);
-			}
-		}
-		/* XXX works even when BA marked above */
 		if (ic->ic_wme.wme_wmeChanParams.cap_wmeParams[ac].wmep_noackPolicy)
 			qos[0] |= IEEE80211_QOS_ACKPOLICY_NOACK;
 		qos[1] = 0;


More information about the svn-src-head mailing list