Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 2015 21:24:12 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280111 - head/sys/dev/wpi
Message-ID:  <201503152124.t2FLOCNi090327@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Mar 15 21:24:11 2015
New Revision: 280111
URL: https://svnweb.freebsd.org/changeset/base/280111

Log:
  Regroup ring state checks in wpi_tx_done().
  
  PR:		kern/197143
  Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Sun Mar 15 21:23:45 2015	(r280110)
+++ head/sys/dev/wpi/if_wpi.c	Sun Mar 15 21:24:11 2015	(r280111)
@@ -1971,22 +1971,23 @@ wpi_tx_done(struct wpi_softc *sc, struct
 	WPI_LOCK(sc);
 
 	ring->queued -= 1;
-	if (ring->queued > 0)
+	if (ring->queued > 0) {
 		callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc);
-	else
-		callout_stop(&sc->tx_timeout);
 
-	if (ring->queued < WPI_TX_RING_LOMARK) {
-		sc->qfullmsk &= ~(1 << ring->qid);
-		IF_LOCK(&ifp->if_snd);
-		if (sc->qfullmsk == 0 &&
-		    (ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
-			ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-			IF_UNLOCK(&ifp->if_snd);
-			ieee80211_runtask(ic, &sc->sc_start_task);
-		} else
-			IF_UNLOCK(&ifp->if_snd);
-	}
+		if (sc->qfullmsk != 0 &&
+		    ring->queued < WPI_TX_RING_LOMARK) {
+			sc->qfullmsk &= ~(1 << ring->qid);
+			IF_LOCK(&ifp->if_snd);
+			if (sc->qfullmsk == 0 &&
+			    (ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
+				ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+				IF_UNLOCK(&ifp->if_snd);
+				ieee80211_runtask(ic, &sc->sc_start_task);
+			} else
+				IF_UNLOCK(&ifp->if_snd);
+		}
+	} else
+		callout_stop(&sc->tx_timeout);
 
 	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503152124.t2FLOCNi090327>