Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2011 00:19:12 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r224954 - user/adrian/if_ath_tx/sys/dev/ath
Message-ID:  <201108180019.p7I0JCmn028896@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Aug 18 00:19:12 2011
New Revision: 224954
URL: http://svn.freebsd.org/changeset/base/224954

Log:
  In preparation for forming aggregates, push the descriptor setup and
  descriptor chain code into the software queue routine, and leave setting
  the rate control stuff until the packet is actually queued to the hardware.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Thu Aug 18 00:05:09 2011	(r224953)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Thu Aug 18 00:19:12 2011	(r224954)
@@ -1397,10 +1397,10 @@ ath_tx_raw_start(struct ath_softc *sc, s
 	 */
 
 	if (do_override) {
-		ATH_TXQ_LOCK(sc->sc_ac2q[pri]);
 		ath_tx_setds(sc, bf);
 		ath_tx_set_ratectrl(sc, ni, bf);
 		ath_tx_chaindesclist(sc, bf);
+		ATH_TXQ_LOCK(sc->sc_ac2q[pri]);
 		ath_tx_handoff(sc, sc->sc_ac2q[pri], bf);
 		ATH_TXQ_UNLOCK(sc->sc_ac2q[pri]);
 	}
@@ -1792,6 +1792,16 @@ ath_tx_swq(struct ath_softc *sc, struct 
 	bf->bf_state.bfs_aggr = 0;
 	bf->bf_state.bfs_aggrburst = 0;
 
+	/*
+	 * Program first and chain the descriptors together.
+	 *
+	 * These fields (along with the DMA map setup) are needed
+	 * by the aggregate forming code, which only overrides
+	 * the rate control setup and the aggregation fields.
+	 */
+	ath_tx_setds(sc, bf);
+	ath_tx_chaindesclist(sc, bf);
+
 	/* Queue frame to the tail of the software queue */
 	ATH_TXQ_LOCK(atid);
 	ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
@@ -2636,10 +2646,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 		if (bf->bf_state.bfs_tid == IEEE80211_NONQOS_TID)
 			device_printf(sc->sc_dev, "%s: TID=16?\n", __func__);
 
-		/* Program descriptor */
-		ath_tx_setds(sc, bf);
+		/* Program rate control */
 		ath_tx_set_ratectrl(sc, ni, bf);
-		ath_tx_chaindesclist(sc, bf);
 
 		/* Punt to hardware or software txq */
 		ATH_TXQ_LOCK(txq);
@@ -2700,10 +2708,8 @@ ath_tx_tid_hw_queue_norm(struct ath_soft
 		/* Normal completion handler */
 		bf->bf_comp = ath_tx_normal_comp;
 
-		/* Program descriptor */
-		ath_tx_setds(sc, bf);
+		/* Program rate control*/
 		ath_tx_set_ratectrl(sc, ni, bf);
-		ath_tx_chaindesclist(sc, bf);
 
 		/* Punt to hardware or software txq */
 		ATH_TXQ_LOCK(txq);



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