Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Aug 2012 11:24:21 +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: r239053 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416
Message-ID:  <201208051124.q75BOLtZ077503@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Aug  5 11:24:21 2012
New Revision: 239053
URL: http://svn.freebsd.org/changeset/base/239053

Log:
  Migrate the 802.11n ath_hal_chaintxdesc() API to use a buffer/segment
  array, similar to what filltxdesc() uses.
  
  This removes the last reference to ds_data in the TX path outside of
  debugging statements.  These need to be adjusted/fixed.
  
  Tested:
  
  * AR9280 STA/AP with iperf TCP traffic

Modified:
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h	Sun Aug  5 10:47:18 2012	(r239052)
+++ head/sys/dev/ath/ath_hal/ah.h	Sun Aug  5 11:24:21 2012	(r239053)
@@ -1227,8 +1227,11 @@ struct ath_hal {
 
 	/* 802.11n Functions */
 	HAL_BOOL  __ahdecl(*ah_chainTxDesc)(struct ath_hal *,
-				struct ath_desc *, u_int, u_int, HAL_PKT_TYPE,
-				u_int, HAL_CIPHER, uint8_t, u_int, HAL_BOOL,
+				struct ath_desc *,
+				HAL_DMA_ADDR *bufAddrList,
+				uint32_t *segLenList,
+				u_int, u_int, HAL_PKT_TYPE,
+				u_int, HAL_CIPHER, uint8_t, HAL_BOOL,
 				HAL_BOOL, HAL_BOOL);
 	HAL_BOOL  __ahdecl(*ah_setupFirstTxDesc)(struct ath_hal *,
 				struct ath_desc *, u_int, u_int, u_int,

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Sun Aug  5 10:47:18 2012	(r239052)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Sun Aug  5 11:24:21 2012	(r239053)
@@ -373,8 +373,9 @@ extern	int ar5416SetupTxQueue(struct ath
 	        const HAL_TXQ_INFO *qInfo);
 
 extern	HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
+		HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList,
 		u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int keyIx,
-		HAL_CIPHER cipher, uint8_t delims, u_int segLen,
+		HAL_CIPHER cipher, uint8_t delims,
 		HAL_BOOL firstSeg, HAL_BOOL lastSeg, HAL_BOOL lastAggr);
 extern	HAL_BOOL ar5416SetupFirstTxDesc(struct ath_hal *ah, struct ath_desc *ds,
 		u_int aggrLen, u_int flags, u_int txPower, u_int txRate0, u_int txTries0,

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c	Sun Aug  5 10:47:18 2012	(r239052)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c	Sun Aug  5 11:24:21 2012	(r239053)
@@ -335,13 +335,14 @@ ar5416FillTxDesc(struct ath_hal *ah, str
  */
 HAL_BOOL
 ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
+	HAL_DMA_ADDR *bufAddrList,
+	uint32_t *segLenList,
 	u_int pktLen,
 	u_int hdrLen,
 	HAL_PKT_TYPE type,
 	u_int keyIx,
 	HAL_CIPHER cipher,
 	uint8_t delims,
-	u_int segLen,
 	HAL_BOOL firstSeg,
 	HAL_BOOL lastSeg,
 	HAL_BOOL lastAggr)
@@ -349,6 +350,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
 	struct ar5416_desc *ads = AR5416DESC(ds);
 	uint32_t *ds_txstatus = AR5416_DS_TXSTATUS(ah,ads);
 	struct ath_hal_5416 *ahp = AH5416(ah);
+	u_int segLen = segLenList[0];
 
 	int isaggr = 0;
 	uint32_t last_aggr = 0;
@@ -357,6 +359,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
 	(void) ah;
 
 	HALASSERT((segLen &~ AR_BufLen) == 0);
+	ds->ds_data = bufAddrList[0];
 
 	HALASSERT(isValidPktType(type));
 	if (type == HAL_PKT_TYPE_AMPDU) {

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Sun Aug  5 10:47:18 2012	(r239052)
+++ head/sys/dev/ath/if_ath_tx.c	Sun Aug  5 11:24:21 2012	(r239053)
@@ -365,6 +365,9 @@ ath_tx_chaindesclist_subframe(struct ath
 	struct ath_hal *ah = sc->sc_ah;
 	struct ath_desc *ds, *ds0;
 	int i;
+	HAL_DMA_ADDR bufAddrList[4];
+	uint32_t segLenList[4];
+
 	/*
 	 * XXX There's txdma and txdma_mgmt; the descriptor
 	 * sizes must match.
@@ -378,25 +381,30 @@ ath_tx_chaindesclist_subframe(struct ath
 	 * That's only going to occur for the first frame in an aggregate.
 	 */
 	for (i = 0; i < bf->bf_nseg; i++, ds++) {
-		ds->ds_data = bf->bf_segs[i].ds_addr;
+		bzero(bufAddrList, sizeof(bufAddrList));
+		bzero(segLenList, sizeof(segLenList));
 		if (i == bf->bf_nseg - 1)
 			ath_hal_settxdesclink(ah, ds, 0);
 		else
 			ath_hal_settxdesclink(ah, ds,
 			    bf->bf_daddr + dd->dd_descsize * (i + 1));
 
+		bufAddrList[0] = bf->bf_segs[i].ds_addr;
+		segLenList[0] = bf->bf_segs[i].ds_len;
+
 		/*
 		 * This performs the setup for an aggregate frame.
 		 * This includes enabling the aggregate flags if needed.
 		 */
 		ath_hal_chaintxdesc(ah, ds,
+		    bufAddrList,
+		    segLenList,
 		    bf->bf_state.bfs_pktlen,
 		    bf->bf_state.bfs_hdrlen,
 		    HAL_PKT_TYPE_AMPDU,	/* forces aggregate bits to be set */
 		    bf->bf_state.bfs_keyix,
 		    0,			/* cipher, calculated from keyix */
 		    bf->bf_state.bfs_ndelim,
-		    bf->bf_segs[i].ds_len,	/* segment length */
 		    i == 0,		/* first segment */
 		    i == bf->bf_nseg - 1,	/* last segment */
 		    bf->bf_next == NULL		/* last sub-frame in aggr */

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Sun Aug  5 10:47:18 2012	(r239052)
+++ head/sys/dev/ath/if_athvar.h	Sun Aug  5 11:24:21 2012	(r239053)
@@ -1130,10 +1130,10 @@ void	ath_intr(void *);
 		_txr0, _txtr0, _antm, _rcr, _rcd) \
 	((*(_ah)->ah_setupFirstTxDesc)((_ah), (_ds), (_aggrlen), (_flags), \
 	(_txpower), (_txr0), (_txtr0), (_antm), (_rcr), (_rcd)))
-#define	ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \
-	_cipher, _delims, _seglen, _first, _last, _lastaggr) \
-	((*(_ah)->ah_chainTxDesc)((_ah), (_ds), (_pktlen), (_hdrlen), \
-	(_type), (_keyix), (_cipher), (_delims), (_seglen), \
+#define	ath_hal_chaintxdesc(_ah, _ds, _bl, _sl, _pktlen, _hdrlen, _type, \
+	_keyix, _cipher, _delims, _first, _last, _lastaggr) \
+	((*(_ah)->ah_chainTxDesc)((_ah), (_ds), (_bl), (_sl), \
+	(_pktlen), (_hdrlen), (_type), (_keyix), (_cipher), (_delims), \
 	(_first), (_last), (_lastaggr)))
 #define	ath_hal_setuplasttxdesc(_ah, _ds, _ds0) \
 	((*(_ah)->ah_setupLastTxDesc)((_ah), (_ds), (_ds0)))



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