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

Adrian Chadd adrian at FreeBSD.org
Wed Oct 26 13:33:41 UTC 2011


Author: adrian
Date: Wed Oct 26 13:33:41 2011
New Revision: 226788
URL: http://svn.freebsd.org/changeset/base/226788

Log:
  Begin breaking out the "mark not-busy" ath_buf code so it can be
  eventually called from the aggregate completion code.
  
  The TDMA code currently fails because the assumption that one
  frame at a time is being handled in ath_tx_processq() is now
  broken when doing aggregation and software retransmit.
  
  The actual fix to this will come soon.

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

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Wed Oct 26 08:41:41 2011	(r226787)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Wed Oct 26 13:33:41 2011	(r226788)
@@ -4478,6 +4478,37 @@ ath_tx_update_ratectrl(struct ath_softc 
 }
 
 /*
+ * Update the busy status of the last frame on the free list.
+ * When doing TDMA, the busy flag tracks whether the hardware
+ * currently points to this buffer or not, and thus gated DMA
+ * may restart by re-reading the last descriptor in this
+ * buffer.
+ *
+ * This should be called in the completion function once one
+ * of the buffers has been used.
+ */
+void
+ath_tx_update_busy(struct ath_softc *sc, struct ath_txq *txq)
+{
+	struct ath_buf *last;
+
+	/*
+	 * Since the last frame may still be marked
+	 * as ATH_BUF_BUSY, unmark it here before
+	 * finishing the frame processing.
+	 * Since we've completed a frame (aggregate
+	 * or otherwise), the hardware has moved on
+	 * and is no longer referencing the previous
+	 * descriptor.
+	 */
+	ATH_TXBUF_LOCK(sc);
+	last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s);
+	if (last != NULL)
+		last->bf_flags &= ~ATH_BUF_BUSY;
+	ATH_TXBUF_UNLOCK(sc);
+}
+
+/*
  * Process completed xmit descriptors from the specified queue.
  * Kick the packet scheduler if needed. This can occur from this
  * particular task.
@@ -4486,7 +4517,7 @@ static int
 ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched)
 {
 	struct ath_hal *ah = sc->sc_ah;
-	struct ath_buf *bf, *last;
+	struct ath_buf *bf;
 	struct ath_desc *ds;
 	struct ath_tx_status *ts;
 	struct ieee80211_node *ni;
@@ -4563,19 +4594,11 @@ ath_tx_processq(struct ath_softc *sc, st
 		}
 
 		/*
-		 * Since the last frame may still be marked
-		 * as ATH_BUF_BUSY, unmark it here before
-		 * finishing the frame processing.
-		 * Since we've completed a frame (aggregate
-		 * or otherwise), the hardware has moved on
-		 * and is no longer referencing the previous
-		 * descriptor.
-		 */
-		ATH_TXBUF_LOCK(sc);
-		last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s);
-		if (last != NULL)
-			last->bf_flags &= ~ATH_BUF_BUSY;
-		ATH_TXBUF_UNLOCK(sc);
+		 * Mark the last frame on the buffer list as
+		 * not busy, as the hardware has now moved past
+		 * that "free" entry and onto the next one.
+		 */
+		ath_tx_update_busy(sc, txq);
 
 		/*
 		 * Call the completion handler.

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h	Wed Oct 26 08:41:41 2011	(r226787)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h	Wed Oct 26 13:33:41 2011	(r226788)
@@ -63,6 +63,7 @@ extern void ath_tx_default_comp(struct a
 extern void ath_tx_update_ratectrl(struct ath_softc *sc,
 	    struct ieee80211_node *ni, struct ath_rc_series *rc,
 	    struct ath_tx_status *ts, int frmlen, int nframes, int nbad);
+extern void ath_tx_update_busy(struct ath_softc *sc, struct ath_txq *txq);
 
 extern void ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf,
     int status);


More information about the svn-src-user mailing list