summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-04-08 00:40:16 +0000
committeradrian <adrian@FreeBSD.org>2012-04-08 00:40:16 +0000
commite793af405d6f199b36653928e63ece418fd3521e (patch)
tree85f5349d3781eb1923f5f973c57456f5c211a03d
parenteba865fe0d4c26f56f99254c8c4ec4eb98eb8f82 (diff)
downloadFreeBSD-src-e793af405d6f199b36653928e63ece418fd3521e.zip
FreeBSD-src-e793af405d6f199b36653928e63ece418fd3521e.tar.gz
After reviewing the mcast/sleep station code a little, undo some brain
damage which I committed when I had less clue about such things. Don't ever put normal data frames on the mcast software queue. Just put mcast frames there if needed. Pass the txq decision into ath_tx_normal_setup(), as we've already made the decision. Don't re-do it. Whilst i'm here, add another random debugging statement.
-rw-r--r--sys/dev/ath/if_ath_tx.c43
1 files changed, 13 insertions, 30 deletions
diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c
index d27df07..c1c4979 100644
--- a/sys/dev/ath/if_ath_tx.c
+++ b/sys/dev/ath/if_ath_tx.c
@@ -205,6 +205,8 @@ ath_txfrag_setup(struct ath_softc *sc, ath_bufhead *frags,
for (m = m0->m_nextpkt; m != NULL; m = m->m_nextpkt) {
bf = _ath_getbuf_locked(sc);
if (bf == NULL) { /* out of buffers, cleanup */
+ device_printf(sc->sc_dev, "%s: no buffer?\n",
+ __func__);
ath_txfrag_cleanup(sc, frags, ni);
break;
}
@@ -1150,10 +1152,9 @@ ath_tx_xmit_normal(struct ath_softc *sc, struct ath_txq *txq,
static int
ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni,
- struct ath_buf *bf, struct mbuf *m0)
+ struct ath_buf *bf, struct mbuf *m0, struct ath_txq *txq)
{
struct ieee80211vap *vap = ni->ni_vap;
- struct ath_vap *avp = ATH_VAP(vap);
struct ath_hal *ah = sc->sc_ah;
struct ifnet *ifp = sc->sc_ifp;
struct ieee80211com *ic = ifp->if_l2com;
@@ -1162,7 +1163,6 @@ ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni,
int keyix, hdrlen, pktlen, try0 = 0;
u_int8_t rix = 0, txrate = 0;
struct ath_desc *ds;
- struct ath_txq *txq;
struct ieee80211_frame *wh;
u_int subtype, flags;
HAL_PKT_TYPE atype;
@@ -1297,21 +1297,6 @@ ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni,
ath_freetx(m0);
return EIO;
}
- txq = sc->sc_ac2q[pri];
-
- /*
- * When servicing one or more stations in power-save mode
- * (or) if there is some mcast data waiting on the mcast
- * queue (to prevent out of order delivery) multicast
- * frames must be buffered until after the beacon.
- *
- * XXX This likely means that if there's a station in power
- * save mode, we won't be doing any kind of aggregation towards
- * anyone. This is likely a very suboptimal way of dealing
- * with things.
- */
- if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth))
- txq = &avp->av_mcastq;
/*
* Calculate miscellaneous flags.
@@ -1445,8 +1430,8 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
/*
* Determine the target hardware queue.
*
- * For multicast frames, the txq gets overridden to be the
- * software TXQ and it's done via direct-dispatch.
+ * For multicast frames, the txq gets overridden appropriately
+ * depending upon the state of PS.
*
* For any other frame, we do a TID/QoS lookup inside the frame
* to see what the TID should be. If it's a non-QoS frame, the
@@ -1495,17 +1480,15 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
"%s: bf=%p, tid=%d, ac=%d, is_ampdu=%d\n",
__func__, bf, tid, pri, is_ampdu);
- /* Multicast frames go onto the software multicast queue */
- if (ismcast)
- txq = &avp->av_mcastq;
-
/*
- * XXX This likely means that if there's a station in power
- * save mode, we won't be doing any kind of aggregation towards
- * anyone. This is likely a very suboptimal way of dealing
- * with things.
+ * When servicing one or more stations in power-save mode
+ * (or) if there is some mcast data waiting on the mcast
+ * queue (to prevent out of order delivery) multicast frames
+ * must be bufferd until after the beacon.
+ *
+ * TODO: we should lock the mcastq before we check the length.
*/
- if ((! is_ampdu) && (vap->iv_ps_sta || avp->av_mcastq.axq_depth))
+ if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth))
txq = &avp->av_mcastq;
/* Do the generic frame setup */
@@ -1555,7 +1538,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
__func__, tid, M_SEQNO_GET(m0));
/* This also sets up the DMA map */
- r = ath_tx_normal_setup(sc, ni, bf, m0);
+ r = ath_tx_normal_setup(sc, ni, bf, m0, txq);
if (r != 0)
return r;
OpenPOWER on IntegriCloud