Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2012 03:22:11 +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: r233970 - head/sys/dev/ath
Message-ID:  <201204070322.q373MBH5039514@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat Apr  7 03:22:11 2012
New Revision: 233970
URL: http://svn.freebsd.org/changeset/base/233970

Log:
  Enforce the RTS aggregation limit if RTS/CTS protection is enabled;
  if any subframes in an aggregate have different protection from the
  first frame in the formed aggregate, don't add that frame to the
  aggregate.
  
  This is likely a suboptimal method (I think we'll mostly be OK marking
  frames that have seqno's with the same protection as normal data frames)
  but I'll just be cautious for now.

Modified:
  head/sys/dev/ath/if_ath_tx_ht.c

Modified: head/sys/dev/ath/if_ath_tx_ht.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_ht.c	Sat Apr  7 03:20:14 2012	(r233969)
+++ head/sys/dev/ath/if_ath_tx_ht.c	Sat Apr  7 03:22:11 2012	(r233970)
@@ -707,14 +707,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s
 		 */
 
 		/*
-		 * XXX TODO: AR5416 has an 8K aggregation size limit
-		 * when RTS is enabled, and RTS is required for dual-stream
-		 * rates.
-		 *
-		 * For now, limit all aggregates for the AR5416 to be 8K.
-		 */
-
-		/*
 		 * do not exceed aggregation limit
 		 */
 		al_delta = ATH_AGGR_DELIM_SZ + bf->bf_state.bfs_pktlen;
@@ -725,6 +717,20 @@ ath_tx_form_aggr(struct ath_softc *sc, s
 		}
 
 		/*
+		 * If RTS/CTS is set on the first frame, enforce
+		 * the RTS aggregate limit.
+		 */
+		if (bf_first->bf_state.bfs_txflags &
+		    (HAL_TXDESC_CTSENA | HAL_TXDESC_RTSENA)) {
+			if (nframes &&
+			   (sc->sc_rts_aggr_limit <
+			     (al + bpad + al_delta + prev_al))) {
+				status = ATH_AGGR_8K_LIMITED;
+				break;
+			}
+		}
+
+		/*
 		 * Do not exceed subframe limit.
 		 */
 		if ((nframes + prev_frames) >= MIN((h_baw),
@@ -734,7 +740,24 @@ ath_tx_form_aggr(struct ath_softc *sc, s
 		}
 
 		/*
-		 * TODO: If it's _before_ the BAW left edge, complain very loudly.
+		 * If the current frame has an RTS/CTS configuration
+		 * that differs from the first frame, don't include
+		 * this in the aggregate.  It's possible that the
+		 * "right" thing to do here is enforce the aggregate
+		 * configuration.
+		 */
+		if ((bf_first->bf_state.bfs_txflags &
+		    (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) !=
+		   (bf->bf_state.bfs_txflags &
+		    (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))) {
+			status = ATH_AGGR_NONAGGR;
+			break;
+		}
+
+		/*
+		 * TODO: If it's _before_ the BAW left edge, complain very
+		 * loudly.
+		 *
 		 * This means something (else) has slid the left edge along
 		 * before we got a chance to be TXed.
 		 */
@@ -814,11 +837,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s
 		bf->bf_state.bfs_addedbaw = 1;
 
 		/*
-		 * XXX TODO: If any frame in the aggregate requires RTS/CTS,
-		 * set the first frame.
-		 */
-
-		/*
 		 * XXX enforce ACK for aggregate frames (this needs to be
 		 * XXX handled more gracefully?
 		 */



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