From owner-svn-src-user@FreeBSD.ORG Thu Apr 25 08:36:43 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C2F3278; Thu, 25 Apr 2013 08:36:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F2C3E15DA; Thu, 25 Apr 2013 08:36:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3P8aguV071826; Thu, 25 Apr 2013 08:36:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P8age4071822; Thu, 25 Apr 2013 08:36:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304250836.r3P8age4071822@svn.freebsd.org> From: Adrian Chadd Date: Thu, 25 Apr 2013 08:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r249888 - user/adrian/net80211_tx/sys/dev/ath X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 25 Apr 2013 08:36:43 -0000 Author: adrian Date: Thu Apr 25 08:36:42 2013 New Revision: 249888 URL: http://svnweb.freebsd.org/changeset/base/249888 Log: Break out the PUTPENDING handling code into a separate function. Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.h Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c Thu Apr 25 08:33:54 2013 (r249887) +++ user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.c Thu Apr 25 08:36:42 2013 (r249888) @@ -723,6 +723,43 @@ ath_tx_handoff_mcast(struct ath_softc *s ATH_TXQ_UNLOCK(txq); } +void +ath_tx_push_pending(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + + /* + * The q was busy when we previously tried + * to write the address of the first buffer + * in the chain. Since it's not busy now + * handle this chore. We are certain the + * buffer at the front is the right one since + * axq_link is NULL only when the buffer list + * is/was empty. + */ + bf = TAILQ_FIRST(&txq->axq_q); + if (bf == NULL) { + device_printf(sc->sc_dev, + "%s: TXQ %d: called, but no buf?\n", + __func__, + txq->axq_qnum); + return; + } + ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + txq->axq_flags &= ~ATH_TXQ_PUTPENDING; + DPRINTF(sc, ATH_DEBUG_TDMA | ATH_DEBUG_XMIT, + "%s: Q%u restarted\n", __func__, + txq->axq_qnum); + ATH_KTR(sc, ATH_KTR_TX, 4, + "ath_tx_handoff: txq[%d] restarted, bf=%p " + "daddr=%p ds=%p", + txq->axq_qnum, + bf, + (caddr_t)bf->bf_daddr, + bf->bf_desc); +} + /* * Hand-off packet to a hardware queue. */ @@ -836,29 +873,12 @@ ath_tx_handoff_hw(struct ath_softc *sc, (caddr_t)bf->bf_daddr, bf->bf_desc, bf->bf_lastds); + /* + * If the queue is no longer busy yet there's a + * pending push, make sure it's done. + */ if ((txq->axq_flags & ATH_TXQ_PUTPENDING) && !qbusy) { - /* - * The q was busy when we previously tried - * to write the address of the first buffer - * in the chain. Since it's not busy now - * handle this chore. We are certain the - * buffer at the front is the right one since - * axq_link is NULL only when the buffer list - * is/was empty. - */ - ath_hal_puttxbuf(ah, txq->axq_qnum, - TAILQ_FIRST(&txq->axq_q)->bf_daddr); - txq->axq_flags &= ~ATH_TXQ_PUTPENDING; - DPRINTF(sc, ATH_DEBUG_TDMA | ATH_DEBUG_XMIT, - "%s: Q%u restarted\n", __func__, - txq->axq_qnum); - ATH_KTR(sc, ATH_KTR_TX, 4, - "ath_tx_handoff: txq[%d] restarted, bf=%p " - "daddr=%p ds=%p", - txq->axq_qnum, - bf, - (caddr_t)bf->bf_daddr, - bf->bf_desc); + ath_tx_push_pending(sc, txq); } } #else Modified: user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.h Thu Apr 25 08:33:54 2013 (r249887) +++ user/adrian/net80211_tx/sys/dev/ath/if_ath_tx.h Thu Apr 25 08:36:42 2013 (r249888) @@ -138,6 +138,11 @@ extern int ath_tx_node_is_asleep(struct extern void ath_tx_node_reassoc(struct ath_softc *sc, struct ath_node *an); /* + * Hardware queue stuff + */ +extern void ath_tx_push_pending(struct ath_softc *sc, struct ath_txq *txq); + +/* * Misc debugging stuff */ #ifdef ATH_DEBUG_ALQ