svn commit: r239205 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Sun Aug 12 00:46:16 UTC 2012


Author: adrian
Date: Sun Aug 12 00:46:15 2012
New Revision: 239205
URL: http://svn.freebsd.org/changeset/base/239205

Log:
  Revert the ath_tx_draintxq() method, and instead teach it the minimum
  necessary to "do" EDMA.
  
  It was just using the TX completion status for logging information about
  the descriptor completion.  Since with EDMA we don't know this without
  checking the TX completion FIFO, we can't provide this information.
  So don't.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx.h
  head/sys/dev/ath/if_ath_tx_edma.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Sun Aug 12 00:37:29 2012	(r239204)
+++ head/sys/dev/ath/if_ath.c	Sun Aug 12 00:46:15 2012	(r239205)
@@ -3987,7 +3987,7 @@ ath_tx_freebuf(struct ath_softc *sc, str
 }
 
 void
-ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
+ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
 {
 #ifdef ATH_DEBUG
 	struct ath_hal *ah = sc->sc_ah;
@@ -4013,6 +4013,17 @@ ath_legacy_tx_draintxq(struct ath_softc 
 		bf = TAILQ_FIRST(&txq->axq_q);
 		if (bf == NULL) {
 			txq->axq_link = NULL;
+			/*
+			 * There's currently no flag that indicates
+			 * a buffer is on the FIFO.  So until that
+			 * occurs, just clear the FIFO counter here.
+			 *
+			 * Yes, this means that if something in parallel
+			 * is pushing things onto this TXQ and pushing
+			 * _that_ into the hardware, things will get
+			 * very fruity very quickly.
+			 */
+			txq->axq_fifo_depth = 0;
 			ATH_TXQ_UNLOCK(txq);
 			break;
 		}
@@ -4022,10 +4033,20 @@ ath_legacy_tx_draintxq(struct ath_softc 
 #ifdef ATH_DEBUG
 		if (sc->sc_debug & ATH_DEBUG_RESET) {
 			struct ieee80211com *ic = sc->sc_ifp->if_l2com;
+			int status = 0;
 
-			ath_printtxbuf(sc, bf, txq->axq_qnum, ix,
-				ath_hal_txprocdesc(ah, bf->bf_lastds,
+			/*
+			 * EDMA operation has a TX completion FIFO
+			 * separate from the TX descriptor, so this
+			 * method of checking the "completion" status
+			 * is wrong.
+			 */
+			if (! sc->sc_isedma) {
+				status = (ath_hal_txprocdesc(ah,
+				    bf->bf_lastds,
 				    &bf->bf_status.ds_txstat) == HAL_OK);
+			}
+			ath_printtxbuf(sc, bf, txq->axq_qnum, ix, status);
 			ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *),
 			    bf->bf_m->m_len, 0, -1);
 		}

Modified: head/sys/dev/ath/if_ath_misc.h
==============================================================================
--- head/sys/dev/ath/if_ath_misc.h	Sun Aug 12 00:37:29 2012	(r239204)
+++ head/sys/dev/ath/if_ath_misc.h	Sun Aug 12 00:46:15 2012	(r239205)
@@ -97,7 +97,8 @@ extern	void ath_descdma_cleanup(struct a
 
 extern	void ath_legacy_attach_comp_func(struct ath_softc *sc);
 
-extern	void ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq);
+extern	void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq);
+
 extern	void ath_legacy_tx_drain(struct ath_softc *sc,
 	    ATH_RESET_TYPE reset_type);
 

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Sun Aug 12 00:37:29 2012	(r239204)
+++ head/sys/dev/ath/if_ath_tx.c	Sun Aug 12 00:46:15 2012	(r239205)
@@ -4572,6 +4572,5 @@ ath_xmit_setup_legacy(struct ath_softc *
 	sc->sc_tx.xmit_dma_restart = ath_legacy_tx_dma_restart;
 	sc->sc_tx.xmit_handoff = ath_legacy_xmit_handoff;
 
-	sc->sc_tx.xmit_drainq = ath_legacy_tx_draintxq;
 	sc->sc_tx.xmit_drain = ath_legacy_tx_drain;
 }

Modified: head/sys/dev/ath/if_ath_tx.h
==============================================================================
--- head/sys/dev/ath/if_ath_tx.h	Sun Aug 12 00:37:29 2012	(r239204)
+++ head/sys/dev/ath/if_ath_tx.h	Sun Aug 12 00:46:15 2012	(r239205)
@@ -134,9 +134,6 @@ extern	void ath_addba_response_timeout(s
 	(_sc)->sc_tx.xmit_dma_restart((_sc), (_txq))
 #define	ath_tx_handoff(_sc, _txq, _bf)		\
 	(_sc)->sc_tx.xmit_handoff((_sc), (_txq), (_bf))
-
-#define	ath_tx_draintxq(_sc, _txq)		\
-	(_sc)->sc_tx.xmit_drainq((_sc), (_txq))
 #define	ath_draintxq(_sc, _rtype)		\
 	(_sc)->sc_tx.xmit_drain((_sc), (_rtype))
 

Modified: head/sys/dev/ath/if_ath_tx_edma.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_edma.c	Sun Aug 12 00:37:29 2012	(r239204)
+++ head/sys/dev/ath/if_ath_tx_edma.c	Sun Aug 12 00:46:15 2012	(r239205)
@@ -360,19 +360,6 @@ ath_edma_tx_drain(struct ath_softc *sc, 
 }
 
 /*
- * Completely drain the TXQ, completing frames that were completed.
- *
- * This is only called to _explictly_ drain the frames from a queue
- * without caring if they were completed or not.
- */
-static void
-ath_edma_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
-{
-
-	device_printf(sc->sc_dev, "%s: called\n", __func__);
-}
-
-/*
  * Process the TX status queue.
  */
 static void
@@ -441,6 +428,5 @@ ath_xmit_setup_edma(struct ath_softc *sc
 
 	sc->sc_tx.xmit_dma_restart = ath_edma_dma_restart;
 	sc->sc_tx.xmit_handoff = ath_edma_xmit_handoff;
-	sc->sc_tx.xmit_drainq = ath_edma_tx_draintxq;
 	sc->sc_tx.xmit_drain = ath_edma_tx_drain;
 }

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Sun Aug 12 00:37:29 2012	(r239204)
+++ head/sys/dev/ath/if_athvar.h	Sun Aug 12 00:46:15 2012	(r239205)
@@ -416,14 +416,6 @@ struct ath_tx_methods {
 			    struct ath_txq *txq);
 	void		(*xmit_handoff)(struct ath_softc *sc,
 			    struct ath_txq *txq, struct ath_buf *bf);
-
-	/*
-	 * This is only required by the CABQ code as well as
-	 * xmit_drain().
-	 */
-	void		(*xmit_drainq)(struct ath_softc *sc,
-			    struct ath_txq *txq);
-
 	void		(*xmit_drain)(struct ath_softc *sc,
 			    ATH_RESET_TYPE reset_type);
 };


More information about the svn-src-all mailing list