svn commit: r280075 - head/sys/dev/wpi

Adrian Chadd adrian at FreeBSD.org
Sun Mar 15 20:43:23 UTC 2015


Author: adrian
Date: Sun Mar 15 20:43:22 2015
New Revision: 280075
URL: https://svnweb.freebsd.org/changeset/base/280075

Log:
  Use ring->queued for WPI_CMD_TX_DATA only.
  
  PR:		kern/197143
  Submitted by:	Andriy Voskoboinyk <s3erios at 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 20:42:41 2015	(r280074)
+++ head/sys/dev/wpi/if_wpi.c	Sun Mar 15 20:43:22 2015	(r280075)
@@ -1965,6 +1965,8 @@ wpi_cmd_done(struct wpi_softc *sc, struc
 	if ((desc->qid & WPI_RX_DESC_QID_MSK) != WPI_CMD_QUEUE_NUM)
 		return;	/* Not a command ack. */
 
+	KASSERT(ring->queued == 0, ("ring->queued must be 0"));
+
 	data = &ring->data[desc->idx];
 
 	/* If the command was mapped in an mbuf, free it. */
@@ -2404,12 +2406,13 @@ wpi_cmd2(struct wpi_softc *sc, struct wp
 	ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT;
 	wpi_update_tx_ring(sc, ring);
 
-	/* Mark TX ring as full if we reach a certain threshold. */
-	if (++ring->queued > WPI_TX_RING_HIMARK)
-		sc->qfullmsk |= 1 << ring->qid;
+	if (ring->qid < WPI_CMD_QUEUE_NUM) {
+		/* Mark TX ring as full if we reach a certain threshold. */
+		if (++ring->queued > WPI_TX_RING_HIMARK)
+			sc->qfullmsk |= 1 << ring->qid;
 
-	if (ring->qid < WPI_CMD_QUEUE_NUM)
 		sc->sc_tx_timer = 5;
+	}
 
 	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__);
 


More information about the svn-src-head mailing list