From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 07:56:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49EEE106566C; Sat, 14 Jul 2012 07:56:48 +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 1C4008FC08; Sat, 14 Jul 2012 07:56:48 +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 q6E7ulMF017062; Sat, 14 Jul 2012 07:56:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E7ulb2017060; Sat, 14 Jul 2012 07:56:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140756.q6E7ulb2017060@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 07:56:47 +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: r238445 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 07:56:48 -0000 Author: adrian Date: Sat Jul 14 07:56:47 2012 New Revision: 238445 URL: http://svn.freebsd.org/changeset/base/238445 Log: Merge in some other features from the legacy RX path: * wrap the RX proc calls in the RX refcount; * call the DFS checking, fast frames staging and TX rescheduling if required. TODO: * figure out if I can just make "do TX rescheduling" mean "schedule TX taskqueue" ? Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 06:17:17 2012 (r238444) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 07:56:47 2012 (r238445) @@ -284,8 +284,16 @@ ath_edma_recv_flush(struct ath_softc *sc device_printf(sc->sc_dev, "%s: called\n", __func__); + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt++; + ATH_PCU_UNLOCK(sc); + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 0); ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 0); + + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt--; + ATH_PCU_UNLOCK(sc); } /* @@ -312,7 +320,7 @@ ath_edma_recv_proc_queue(struct ath_soft struct ath_hal *ah = sc->sc_ah; uint64_t tsf; int16_t nf; - int ngood = 0; + int ngood = 0, npkts = 0; ath_bufhead rxlist; struct ath_buf *next; @@ -362,6 +370,7 @@ ath_edma_recv_proc_queue(struct ath_soft */ DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: completed!\n", __func__, qtype); + npkts++; /* * Remove the FIFO entry and place it on the completion @@ -407,6 +416,14 @@ ath_edma_recv_proc_queue(struct ath_soft } ATH_RX_UNLOCK(sc); + /* rx signal state monitoring */ + ath_hal_rxmonitor(ah, &sc->sc_halstats, sc->sc_curchan); + if (ngood) + sc->sc_lastrx = tsf; + + CTR2(ATH_KTR_INTR, "ath edma rx proc: npkts=%d, ngood=%d", + npkts, ngood); + /* Handle resched and kickpcu appropriately */ ATH_PCU_LOCK(sc); if (dosched && sc->sc_kickpcu) { @@ -429,6 +446,8 @@ static void ath_edma_recv_tasklet(void *arg, int npending) { struct ath_softc *sc = (struct ath_softc *) arg; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; npending=%d\n", __func__, @@ -441,10 +460,26 @@ ath_edma_recv_tasklet(void *arg, int npe ATH_PCU_UNLOCK(sc); return; } + sc->sc_rxproc_cnt++; ATH_PCU_UNLOCK(sc); ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 1); ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 1); + + /* XXX inside IF_LOCK ? */ + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { +#ifdef IEEE80211_SUPPORT_SUPERG + ieee80211_ff_age_all(ic, 100); +#endif + if (! IFQ_IS_EMPTY(&ifp->if_snd)) + ath_tx_kick(sc); + } + if (ath_dfs_tasklet_needed(sc, sc->sc_curchan)) + taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); + + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt--; + ATH_PCU_UNLOCK(sc); } /*