Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2011 02:00:52 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r225500 - user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
Message-ID:  <201109120200.p8C20q8k005331@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Sep 12 02:00:52 2011
New Revision: 225500
URL: http://svn.freebsd.org/changeset/base/225500

Log:
  .. and add the last missing piece from last night's commit:
  
  * Actually follow through on setting up those flags. unfortunately ctl0 was
    being 0'ed and I didn't pick up on it. This correctly sets CLRDMASK, VEOL and
    INTREQ.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c	Mon Sep 12 01:38:24 2011	(r225499)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c	Mon Sep 12 02:00:52 2011	(r225500)
@@ -378,14 +378,9 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
 	OS_MEMZERO(ds->ds_hw, AR5416_DESC_TX_CTL_SZ);
 
 	/*
-	 * XXX VEOL should only be for the last descriptor in the chain.
-	 * XXX I'm not sure if clrdestmask is ok in intermediary descs or
-	 * XXX   required at the end of a sub-frame.
-	 */
-	ads->ds_ctl0 = (pktLen & AR_FrameLen)
-//		| (flags & HAL_TXDESC_VEOL ? AR_VEOL : 0)
-//		| (flags & HAL_TXDESC_CLRDMASK ? AR_ClrDestMask : 0)
-		| (flags & HAL_TXDESC_INTREQ ? AR_TxIntrReq : 0);
+	 * Note: VEOL should only be for the last descriptor in the chain.
+	 */
+	ads->ds_ctl0 = 0;	/* XXX TODO: optimise uncached descriptor writes */
 	ads->ds_ctl1 = (type << AR_FrameType_S)
 			| (isaggr ? (AR_IsAggr | AR_MoreAggr) : 0);
 	ads->ds_ctl2 = 0;
@@ -402,15 +397,24 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
 	}
 
 	if (firstSeg) {
+		ads->ds_ctl0 |= (pktLen & AR_FrameLen)
+		    | (flags & HAL_TXDESC_CLRDMASK ? AR_ClrDestMask : 0)
+		    | (flags & HAL_TXDESC_INTREQ ? AR_TxIntrReq : 0)
+		    ;
 		ads->ds_ctl1 |= segLen | (lastSeg ? 0 : AR_TxMore);
 	} else if (lastSeg) {           /* !firstSeg && lastSeg */
-		ads->ds_ctl0 = 0;
+		ads->ds_ctl0 = 0
+		    | (flags & HAL_TXDESC_VEOL ? AR_VEOL : 0)
+		    | (flags & HAL_TXDESC_INTREQ ? AR_TxIntrReq : 0)
+		    ;
 		ads->ds_ctl1 |= segLen;
 	} else {                        /* !firstSeg && !lastSeg */
 		/*
 		 * Intermediate descriptor in a multi-descriptor frame.
 		 */
-		ads->ds_ctl0 = 0;
+		ads->ds_ctl0 = 0
+		    | (flags & HAL_TXDESC_INTREQ ? AR_TxIntrReq : 0)
+		    ;
 		ads->ds_ctl1 |= segLen | AR_TxMore;
 	}
 	ds_txstatus[0] = ds_txstatus[1] = 0;



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