From owner-svn-src-user@FreeBSD.ORG Wed Oct 26 13:33:41 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 BFCC7106566C; Wed, 26 Oct 2011 13:33:41 +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 A53908FC17; Wed, 26 Oct 2011 13:33:41 +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 p9QDXfLw052043; Wed, 26 Oct 2011 13:33:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9QDXf7A052040; Wed, 26 Oct 2011 13:33:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110261333.p9QDXf7A052040@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Oct 2011 13:33:41 +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: r226788 - user/adrian/if_ath_tx/sys/dev/ath 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: Wed, 26 Oct 2011 13:33:41 -0000 Author: adrian Date: Wed Oct 26 13:33:41 2011 New Revision: 226788 URL: http://svn.freebsd.org/changeset/base/226788 Log: Begin breaking out the "mark not-busy" ath_buf code so it can be eventually called from the aggregate completion code. The TDMA code currently fails because the assumption that one frame at a time is being handled in ath_tx_processq() is now broken when doing aggregation and software retransmit. The actual fix to this will come soon. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Oct 26 08:41:41 2011 (r226787) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Oct 26 13:33:41 2011 (r226788) @@ -4478,6 +4478,37 @@ ath_tx_update_ratectrl(struct ath_softc } /* + * Update the busy status of the last frame on the free list. + * When doing TDMA, the busy flag tracks whether the hardware + * currently points to this buffer or not, and thus gated DMA + * may restart by re-reading the last descriptor in this + * buffer. + * + * This should be called in the completion function once one + * of the buffers has been used. + */ +void +ath_tx_update_busy(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_buf *last; + + /* + * Since the last frame may still be marked + * as ATH_BUF_BUSY, unmark it here before + * finishing the frame processing. + * Since we've completed a frame (aggregate + * or otherwise), the hardware has moved on + * and is no longer referencing the previous + * descriptor. + */ + ATH_TXBUF_LOCK(sc); + last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s); + if (last != NULL) + last->bf_flags &= ~ATH_BUF_BUSY; + ATH_TXBUF_UNLOCK(sc); +} + +/* * Process completed xmit descriptors from the specified queue. * Kick the packet scheduler if needed. This can occur from this * particular task. @@ -4486,7 +4517,7 @@ static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) { struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf, *last; + struct ath_buf *bf; struct ath_desc *ds; struct ath_tx_status *ts; struct ieee80211_node *ni; @@ -4563,19 +4594,11 @@ ath_tx_processq(struct ath_softc *sc, st } /* - * Since the last frame may still be marked - * as ATH_BUF_BUSY, unmark it here before - * finishing the frame processing. - * Since we've completed a frame (aggregate - * or otherwise), the hardware has moved on - * and is no longer referencing the previous - * descriptor. - */ - ATH_TXBUF_LOCK(sc); - last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s); - if (last != NULL) - last->bf_flags &= ~ATH_BUF_BUSY; - ATH_TXBUF_UNLOCK(sc); + * Mark the last frame on the buffer list as + * not busy, as the hardware has now moved past + * that "free" entry and onto the next one. + */ + ath_tx_update_busy(sc, txq); /* * Call the completion handler. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h Wed Oct 26 08:41:41 2011 (r226787) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h Wed Oct 26 13:33:41 2011 (r226788) @@ -63,6 +63,7 @@ extern void ath_tx_default_comp(struct a extern void ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_rc_series *rc, struct ath_tx_status *ts, int frmlen, int nframes, int nbad); +extern void ath_tx_update_busy(struct ath_softc *sc, struct ath_txq *txq); extern void ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf, int status);