svn commit: r225294 - user/adrian/if_ath_tx/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Wed Aug 31 13:37:29 UTC 2011


Author: adrian
Date: Wed Aug 31 13:37:28 2011
New Revision: 225294
URL: http://svn.freebsd.org/changeset/base/225294

Log:
  Add an ADDBA response timeout method which will unpause the TID.
  I've noticed that there's occasionally TX hangs (which I'll figure out
  soon enough) that cause net80211 to keep trying to queue ADDBA requests.
  This tid->paused kept being incremented and even if the addba response
  finally occured (or the interface was reset), tid->paused wouldn't be
  reset to 0.
  
  The commit to link this into if_ath.c will follow.
  
  To think about: if the interface is reset, tid->paused won't be zeroed
  out. The net80211 addba timeout callback will still occur, so we can't
  just zero it out as said callback would decrement it to < 0.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h
  user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Wed Aug 31 10:42:42 2011	(r225293)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Wed Aug 31 13:37:28 2011	(r225294)
@@ -3596,6 +3596,34 @@ ath_bar_response(struct ieee80211_node *
 	 * XXX to a non-aggregate session. So we must unpause the
 	 * XXX TID here or it'll never be done.
 	 */
-	if (status == 0 || attempts == 50)
+	if (status == 0 || attempts == 50) {
+		ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]);
 		ath_tx_tid_resume(sc, atid);
+		ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
+	}
+}
+
+/*
+ * This is called whenever the pending ADDBA request times out.
+ * Unpause and reschedule the TID.
+ */
+void
+ath_addba_response_timeout(struct ieee80211_node *ni,
+    struct ieee80211_tx_ampdu *tap)
+{
+	struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+	int tid = WME_AC_TO_TID(tap->txa_ac);
+	struct ath_node *an = ATH_NODE(ni);
+	struct ath_tid *atid = &an->an_tid[tid];
+
+	DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
+	    "%s: called; resuming\n", __func__);
+
+	/* Note: This updates the aggregate state to (again) pending */
+	sc->sc_addba_response_timeout(ni, tap);
+
+	/* Unpause the TID; which reschedules it */
+	ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]);
+	ath_tx_tid_resume(sc, atid);
+	ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
 }

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h	Wed Aug 31 10:42:42 2011	(r225293)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h	Wed Aug 31 13:37:28 2011	(r225294)
@@ -121,5 +121,7 @@ extern	void ath_addba_stop(struct ieee80
     struct ieee80211_tx_ampdu *tap);
 extern	void ath_bar_response(struct ieee80211_node *ni,
      struct ieee80211_tx_ampdu *tap, int status);
+extern	void ath_addba_response_timeout(struct ieee80211_node *ni,
+    struct ieee80211_tx_ampdu *tap);
 
 #endif

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h	Wed Aug 31 10:42:42 2011	(r225293)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h	Wed Aug 31 13:37:28 2011	(r225294)
@@ -512,6 +512,9 @@ struct ath_softc {
 				    struct ieee80211_tx_ampdu *, int, int, int);
 	void			(*sc_addba_stop)(struct ieee80211_node *,
 				    struct ieee80211_tx_ampdu *);
+	void			(*sc_addba_response_timeout)
+				    (struct ieee80211_node *,
+				    struct ieee80211_tx_ampdu *);
 	void			(*sc_bar_response)(struct ieee80211_node *ni,
 				    struct ieee80211_tx_ampdu *tap,
 				    int status);


More information about the svn-src-user mailing list