From owner-svn-src-all@FreeBSD.ORG Tue Oct 25 23:24:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56CEF106564A; Tue, 25 Oct 2011 23:24:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B9B18FC13; Tue, 25 Oct 2011 23:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9PNO6Ea021469; Tue, 25 Oct 2011 23:24:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9PNO6ru021467; Tue, 25 Oct 2011 23:24:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110252324.p9PNO6ru021467@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Oct 2011 23:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226764 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2011 23:24:06 -0000 Author: adrian Date: Tue Oct 25 23:24:05 2011 New Revision: 226764 URL: http://svn.freebsd.org/changeset/base/226764 Log: Add some fixes to the 11n aggregation HAL calls: * preserve AR_TxIntrReq on every descriptor in an aggregate chain, not just the first descriptor; * always blank out the descriptor in ar5416ChainTxDesc() when forming aggregates - the way I'm using this in the 11n branch is to first chain aggregates together, then use the other HAL calls to fill in the details. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue Oct 25 23:19:57 2011 (r226763) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue Oct 25 23:24:05 2011 (r226764) @@ -295,12 +295,14 @@ ar5416FillTxDesc(struct ath_hal *ah, str * copy the multi-rate transmit parameters from * the first frame for processing on completion. */ - ads->ds_ctl0 = 0; ads->ds_ctl1 = segLen; #ifdef AH_NEED_DESC_SWAP + ads->ds_ctl0 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl0) + & AR_TxIntrReq; ads->ds_ctl2 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl2); ads->ds_ctl3 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl3); #else + ads->ds_ctl0 = AR5416DESC_CONST(ds0)->ds_ctl0 & AR_TxIntrReq; ads->ds_ctl2 = AR5416DESC_CONST(ds0)->ds_ctl2; ads->ds_ctl3 = AR5416DESC_CONST(ds0)->ds_ctl3; #endif @@ -308,7 +310,12 @@ ar5416FillTxDesc(struct ath_hal *ah, str /* * Intermediate descriptor in a multi-descriptor frame. */ - ads->ds_ctl0 = 0; +#ifdef AH_NEED_DESC_SWAP + ads->ds_ctl0 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl0) + & AR_TxIntrReq; +#else + ads->ds_ctl0 = AR5416DESC_CONST(ds0)->ds_ctl0 & AR_TxIntrReq; +#endif ads->ds_ctl1 = segLen | AR_TxMore; ads->ds_ctl2 = 0; ads->ds_ctl3 = 0; @@ -318,6 +325,9 @@ ar5416FillTxDesc(struct ath_hal *ah, str return AH_TRUE; } +/* + * NB: cipher is no longer used, it's calculated. + */ HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int pktLen, @@ -347,10 +357,20 @@ ar5416ChainTxDesc(struct ath_hal *ah, st isaggr = 1; } - if (!firstSeg) { - OS_MEMZERO(ds->ds_hw, AR5416_DESC_TX_CTL_SZ); - } + /* + * Since this function is called before any of the other + * descriptor setup functions (at least in this particular + * 802.11n aggregation implementation), always bzero() the + * descriptor. Previously this would be done for all but + * the first segment. + * XXX TODO: figure out why; perhaps I'm using this slightly + * XXX incorrectly. + */ + OS_MEMZERO(ds->ds_hw, AR5416_DESC_TX_CTL_SZ); + /* + * Note: VEOL should only be for the last descriptor in the chain. + */ ads->ds_ctl0 = (pktLen & AR_FrameLen); ads->ds_ctl1 = (type << AR_FrameType_S) | (isaggr ? (AR_IsAggr | AR_MoreAggr) : 0); @@ -362,7 +382,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st ads->ds_ctl0 |= AR_DestIdxValid; } - ads->ds_ctl6 = SM(ahp->ah_keytype[cipher], AR_EncrType); + ads->ds_ctl6 |= SM(ahp->ah_keytype[keyIx], AR_EncrType); if (isaggr) { ads->ds_ctl6 |= SM(delims, AR_PadDelim); }