From owner-svn-src-user@FreeBSD.ORG Wed Aug 17 09:52:35 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 550311065674; Wed, 17 Aug 2011 09:52:35 +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 45B9A8FC28; Wed, 17 Aug 2011 09:52:35 +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 p7H9qYLj096901; Wed, 17 Aug 2011 09:52:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7H9qYEO096899; Wed, 17 Aug 2011 09:52:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108170952.p7H9qYEO096899@svn.freebsd.org> From: Adrian Chadd Date: Wed, 17 Aug 2011 09:52:34 +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: r224934 - 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, 17 Aug 2011 09:52:35 -0000 Author: adrian Date: Wed Aug 17 09:52:34 2011 New Revision: 224934 URL: http://svn.freebsd.org/changeset/base/224934 Log: Flesh out the aggregate cleanup function. Again, untested. Fix the aggregate single-packet cleanup function - call the completion handler before potentially kicking the queue. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 17 09:44:15 2011 (r224933) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 17 09:52:34 2011 (r224934) @@ -2023,6 +2023,8 @@ ath_tx_comp_cleanup_unaggr(struct ath_so DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: TID %d: incomp=%d\n", __func__, tid, atid->incomp); + ath_tx_default_comp(sc, bf, 0); + atid->incomp--; if (atid->incomp == 0) { DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, @@ -2032,7 +2034,6 @@ ath_tx_comp_cleanup_unaggr(struct ath_so ath_tx_tid_resume(sc, atid); } - ath_tx_default_comp(sc, bf, 0); } /* @@ -2330,9 +2331,31 @@ ath_tx_comp_aggr_error(struct ath_softc * Handle clean-up of packets from an aggregate list. */ static void -ath_tx_comp_cleanup_aggr(struct ath_softc *sc, struct ath_buf *bf) +ath_tx_comp_cleanup_aggr(struct ath_softc *sc, struct ath_buf *bf_first) { - /* XXX TODO */ + struct ath_buf *bf, *bf_next; + struct ieee80211_node *ni = bf_first->bf_node; + struct ath_node *an = ATH_NODE(ni); + int tid = bf_first->bf_state.bfs_tid; + struct ath_tid *atid = &an->an_tid[tid]; + + bf = bf_first; + + while (bf) { + atid->incomp--; + bf_next = bf->bf_next; + ath_tx_default_comp(sc, bf, -1); + bf = bf_next; + } + + if (atid->incomp == 0) { + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: TID %d: cleaned up! resume!\n", + __func__, tid); + atid->cleanup_inprogress = 0; + ath_tx_tid_resume(sc, atid); + } + } /*