From owner-svn-src-user@FreeBSD.ORG Thu Sep 8 12:19:58 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE497106566B; Thu, 8 Sep 2011 12:19:58 +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 93A198FC1D; Thu, 8 Sep 2011 12:19:58 +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 p88CJw4N090488; Thu, 8 Sep 2011 12:19:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p88CJw6Z090486; Thu, 8 Sep 2011 12:19:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109081219.p88CJw6Z090486@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Sep 2011 12:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225447 - user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2011 12:19:58 -0000 Author: adrian Date: Thu Sep 8 12:19:58 2011 New Revision: 225447 URL: http://svn.freebsd.org/changeset/base/225447 Log: Add txq stop debugging; always memzero the 11n descriptors before chaining. * To help me trace down some ath txq device timeout issues, print out some TXQ state before the TXQ is halted. * Always memzero the descriptor in ar5416ChainTxDesc(). It was being called for the non-first descriptor in a (sub) frame. Problem is, I'm calling this function first, and THEN setting up the first descriptor, because of the way that ar5416ChainTxDesc() overwrites some fields that ar5416SetupFirstTxDesc() sets up. It's quite possible that ar5416SetupFirstTxDesc() should be called first; and ar5416ChainTxDesc() should be modified to merge in these changes rather than overwrite them. If I decide this, I'll revert this part of the patch. 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 Thu Sep 8 09:33:49 2011 (r225446) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Sep 8 12:19:58 2011 (r225447) @@ -41,6 +41,14 @@ ar5416StopTxDma(struct ath_hal *ah, u_in HALASSERT(AH5212(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE); + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: Q(%d) QTXDP: 0x%.8x, QSTS: 0x%.8x, TXE: 0x%.8x, TXD: 0x%.8x\n", + __func__, q, + OS_REG_READ(ah, AR_QTXDP(q)), + OS_REG_READ(ah, AR_QSTS(q)), + OS_REG_READ(ah, AR_Q_TXE), + OS_REG_READ(ah, AR_Q_TXD)); + OS_REG_WRITE(ah, AR_Q_TXD, 1 << q); for (i = STOP_DMA_TIMEOUT/STOP_DMA_ITER; i != 0; i--) { if (ar5212NumTxPending(ah, q) == 0) @@ -350,9 +358,16 @@ 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); ads->ds_ctl0 = (pktLen & AR_FrameLen); ads->ds_ctl1 = (type << AR_FrameType_S)