From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 21:06:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD9AA1065672; Tue, 8 Nov 2011 21:06:36 +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 AD8F28FC12; Tue, 8 Nov 2011 21:06:36 +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 pA8L6ais048859; Tue, 8 Nov 2011 21:06:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8L6asA048857; Tue, 8 Nov 2011 21:06:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082106.pA8L6asA048857@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 21:06:36 +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: r227358 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:06:36 -0000 Author: adrian Date: Tue Nov 8 21:06:36 2011 New Revision: 227358 URL: http://svn.freebsd.org/changeset/base/227358 Log: Break out the TX DMA stop code into a separate function. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 19:25:52 2011 (r227357) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:06:36 2011 (r227358) @@ -4539,17 +4539,16 @@ ath_tx_stopdma(struct ath_softc *sc, str (void) ath_hal_stoptxdma(ah, txq->axq_qnum); } -/* - * Drain the transmit queues and reclaim resources. - */ -static void -ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type) +static int +ath_stoptxdma(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = sc->sc_ifp; int i; /* XXX return value */ + if (sc->sc_invalid) + return 0; + if (!sc->sc_invalid) { /* don't touch the hardware if marked invalid */ DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n", @@ -4561,6 +4560,24 @@ ath_draintxq(struct ath_softc *sc, ATH_R if (ATH_TXQ_SETUP(sc, i)) ath_tx_stopdma(sc, &sc->sc_txq[i]); } + + return 1; +} + +/* + * Drain the transmit queues and reclaim resources. + */ +static void +ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type) +{ +#ifdef ATH_DEBUG + struct ath_hal *ah = sc->sc_ah; +#endif + struct ifnet *ifp = sc->sc_ifp; + int i; + + (void) ath_stoptxdma(sc); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) if (ATH_TXQ_SETUP(sc, i)) ath_tx_draintxq(sc, &sc->sc_txq[i]);