Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2011 03:04:56 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r225278 - user/adrian/if_ath_tx/sys/dev/ath
Message-ID:  <201108310304.p7V34uV3078101@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Aug 31 03:04:56 2011
New Revision: 225278
URL: http://svn.freebsd.org/changeset/base/225278

Log:
  Break out the common code which sends a non-aggregate packet to the hardware
  into a new function, ath_tx_xmit_normal().

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

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 02:47:18 2011	(r225277)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Wed Aug 31 03:04:56 2011	(r225278)
@@ -867,6 +867,29 @@ ath_tx_set_ratectrl(struct ath_softc *sc
 	}
 }
 
+/*
+ * Transmit the given frame to the hardware.
+ *
+ * The frame must already be setup; rate control must already have
+ * been done.
+ */
+static void
+ath_tx_xmit_normal(struct ath_softc *sc, struct ath_txq *txq,
+    struct ath_buf *bf)
+{
+	/* Setup the descriptor before handoff */
+	ath_tx_set_rtscts(sc, bf);
+	ath_tx_setds(sc, bf);
+	ath_tx_set_ratectrl(sc, bf->bf_node, bf);
+	ath_tx_chaindesclist(sc, bf);
+
+	ATH_TXQ_LOCK(txq);
+	ath_tx_handoff(sc, txq, bf);
+	ATH_TXQ_UNLOCK(txq);
+}
+
+
+
 static int
 ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni,
     struct ath_buf *bf, struct mbuf *m0)
@@ -1350,15 +1373,7 @@ ath_tx_start(struct ath_softc *sc, struc
 	 * queuing it, as the TID will now be paused.
 	 */
 	if (txq == &avp->av_mcastq) {
-		/* Setup the descriptor before handoff */
-		ath_tx_set_rtscts(sc, bf);
-		ath_tx_setds(sc, bf);
-		ath_tx_set_ratectrl(sc, ni, bf);
-		ath_tx_chaindesclist(sc, bf);
-
-		ATH_TXQ_LOCK(txq);
-		ath_tx_handoff(sc, txq, bf);
-		ATH_TXQ_UNLOCK(txq);
+		ath_tx_xmit_normal(sc, txq, bf);
 	} else if (type == IEEE80211_FC0_TYPE_CTL &&
 		    subtype == IEEE80211_FC0_SUBTYPE_BAR) {
 		/*
@@ -1375,16 +1390,7 @@ ath_tx_start(struct ath_softc *sc, struc
 		 */
 		DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
 		    "%s: BAR: TX'ing direct\n", __func__);
-
-		/* Setup the descriptor before handoff */
-		ath_tx_set_rtscts(sc, bf);
-		ath_tx_setds(sc, bf);
-		ath_tx_set_ratectrl(sc, ni, bf);
-		ath_tx_chaindesclist(sc, bf);
-
-		ATH_TXQ_LOCK(txq);
-		ath_tx_handoff(sc, txq, bf);
-		ATH_TXQ_UNLOCK(txq);
+		ath_tx_xmit_normal(sc, txq, bf);
 	} else {
 		/* add to software queue */
 		ath_tx_swq(sc, ni, txq, bf);
@@ -1394,16 +1400,7 @@ ath_tx_start(struct ath_softc *sc, struc
 	 * For now, since there's no software queue,
 	 * direct-dispatch to the hardware.
 	 */
-
-	/* Setup the descriptor before handoff */
-	ath_tx_set_rtscts(sc, bf);
-	ath_tx_setds(sc, bf);
-	ath_tx_set_ratectrl(sc, ni, bf);
-	ath_tx_chaindesclist(sc, bf);
-
-	ATH_TXQ_LOCK(txq);
-	ath_tx_handoff(sc, txq, bf);
-	ATH_TXQ_UNLOCK(txq);
+	ath_tx_xmit_normal(sc, txq, bf);
 #endif
 
 	return 0;
@@ -1606,15 +1603,8 @@ ath_tx_raw_start(struct ath_softc *sc, s
 	DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: dooverride=%d\n",
 	    __func__, do_override);
 
-	if (do_override) {
-		ath_tx_set_rtscts(sc, bf);
-		ath_tx_setds(sc, bf);
-		ath_tx_set_ratectrl(sc, ni, bf);
-		ath_tx_chaindesclist(sc, bf);
-		ATH_TXQ_LOCK(sc->sc_ac2q[pri]);
-		ath_tx_handoff(sc, sc->sc_ac2q[pri], bf);
-		ATH_TXQ_UNLOCK(sc->sc_ac2q[pri]);
-	}
+	if (do_override)
+		ath_tx_xmit_normal(sc, sc->sc_ac2q[pri], bf);
 	else {
 		/* Queue to software queue */
 		ath_tx_swq(sc, ni, sc->sc_ac2q[pri], bf);



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