Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2013 01:40:13 +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: r251090 - head/sys/dev/ath
Message-ID:  <201305290140.r4T1eErx040928@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed May 29 01:40:13 2013
New Revision: 251090
URL: http://svnweb.freebsd.org/changeset/base/251090

Log:
  Shuffle around the cleanup unpause calls a bit.

Modified:
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Wed May 29 00:32:49 2013	(r251089)
+++ head/sys/dev/ath/if_ath_tx.c	Wed May 29 01:40:13 2013	(r251090)
@@ -4156,7 +4156,9 @@ ath_tx_comp_cleanup_unaggr(struct ath_so
  * - Count the number of unacked frames, and let transmit completion
  *   handle it later.
  *
- * The caller is responsible for pausing the TID.
+ * The caller is responsible for pausing the TID and unpausing the
+ * TID if no cleanup was required. Otherwise the cleanup path will
+ * unpause the TID once the last hardware queued frame is completed.
  */
 static void
 ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid,
@@ -4214,12 +4216,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc,
 		bf = TAILQ_NEXT(bf, bf_list);
 	}
 
-	/* The caller is required to pause the TID */
-#if 0
-	/* Pause the TID */
-	ath_tx_tid_pause(sc, atid);
-#endif
-
 	/*
 	 * Calculate what hardware-queued frames exist based
 	 * on the current BAW size. Ie, what frames have been
@@ -4238,14 +4234,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc,
 		INCR(tap->txa_start, IEEE80211_SEQ_RANGE);
 	}
 
-	/*
-	 * If cleanup is required, defer TID scheduling
-	 * until all the HW queued packets have been
-	 * sent.
-	 */
-	if (! atid->cleanup_inprogress)
-		ath_tx_tid_resume(sc, atid);
-
 	if (atid->cleanup_inprogress)
 		DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
 		    "%s: TID %d: cleanup needed: %d packets\n",
@@ -5789,6 +5777,11 @@ ath_addba_stop(struct ieee80211_node *ni
 	TAILQ_INIT(&bf_cq);
 	ATH_TX_LOCK(sc);
 	ath_tx_tid_cleanup(sc, an, tid, &bf_cq);
+	/*
+	 * Unpause the TID if no cleanup is required.
+	 */
+	if (! atid->cleanup_inprogress)
+		ath_tx_tid_resume(sc, atid);
 	ATH_TX_UNLOCK(sc);
 
 	/* Handle completing frames and fail them */
@@ -5830,6 +5823,11 @@ ath_tx_node_reassoc(struct ath_softc *sc
 		    ":",
 		    i);
 		ath_tx_tid_cleanup(sc, an, i, &bf_cq);
+		/*
+		 * Unpause the TID if no cleanup is required.
+		 */
+		if (! tid->cleanup_inprogress)
+			ath_tx_tid_resume(sc, tid);
 	}
 	ATH_TX_UNLOCK(sc);
 



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