Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 23:52:30 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241566 - head/sys/dev/ath
Message-ID:  <201210142352.q9ENqUF6068322@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Oct 14 23:52:30 2012
New Revision: 241566
URL: http://svn.freebsd.org/changeset/base/241566

Log:
  Stop abusing the ATH_TID_*() queue macros for filtered frames and give
  them their own macro set.

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

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Sun Oct 14 23:45:56 2012	(r241565)
+++ head/sys/dev/ath/if_ath_tx.c	Sun Oct 14 23:52:30 2012	(r241566)
@@ -2947,7 +2947,7 @@ ath_tx_tid_filt_addbuf(struct ath_softc 
 	ath_tx_set_retry(sc, bf);
 	sc->sc_stats.ast_tx_swfiltered++;
 
-	ATH_TID_INSERT_TAIL(&tid->filtq, bf, bf_list);
+	ATH_TID_FILT_INSERT_TAIL(tid, bf, bf_list);
 }
 
 /*
@@ -2996,8 +2996,8 @@ ath_tx_tid_filt_comp_complete(struct ath
 	tid->clrdmask = 1;
 
 	/* XXX this is really quite inefficient */
-	while ((bf = ATH_TID_LAST(&tid->filtq, ath_bufhead_s)) != NULL) {
-		ATH_TID_REMOVE(&tid->filtq, bf, bf_list);
+	while ((bf = ATH_TID_FILT_LAST(tid, ath_bufhead_s)) != NULL) {
+		ATH_TID_FILT_REMOVE(tid, bf, bf_list);
 		ATH_TID_INSERT_HEAD(tid, bf, bf_list);
 	}
 
@@ -3408,7 +3408,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s
 	/* And now, drain the filtered frame queue */
 	t = 0;
 	for (;;) {
-		bf = ATH_TID_FIRST(&tid->filtq);
+		bf = ATH_TID_FILT_FIRST(tid);
 		if (bf == NULL)
 			break;
 
@@ -3417,7 +3417,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s
 			t = 1;
 		}
 
-		ATH_TID_REMOVE(&tid->filtq, bf, bf_list);
+		ATH_TID_FILT_REMOVE(tid, bf, bf_list);
 		ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf);
 	}
 
@@ -3667,8 +3667,8 @@ ath_tx_tid_cleanup(struct ath_softc *sc,
 	 * we run off and discard/process things.
 	 */
 	/* XXX this is really quite inefficient */
-	while ((bf = ATH_TID_LAST(&atid->filtq, ath_bufhead_s)) != NULL) {
-		ATH_TID_REMOVE(&atid->filtq, bf, bf_list);
+	while ((bf = ATH_TID_FILT_LAST(atid, ath_bufhead_s)) != NULL) {
+		ATH_TID_FILT_REMOVE(atid, bf, bf_list);
 		ATH_TID_INSERT_HEAD(atid, bf, bf_list);
 	}
 

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Sun Oct 14 23:45:56 2012	(r241565)
+++ head/sys/dev/ath/if_athvar.h	Sun Oct 14 23:52:30 2012	(r241566)
@@ -374,7 +374,7 @@ struct ath_txq {
 #define	ATH_TXQ_LAST(_tq, _field)	TAILQ_LAST(&(_tq)->axq_q, _field)
 
 /*
- * These are for the TID software queue and filtered frames queues.
+ * These are for the TID software queue.
  */
 #define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \
 	TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \
@@ -391,6 +391,24 @@ struct ath_txq {
 #define	ATH_TID_FIRST(_tq)		TAILQ_FIRST(&(_tq)->tid_q)
 #define	ATH_TID_LAST(_tq, _field)	TAILQ_LAST(&(_tq)->tid_q, _field)
 
+/*
+ * These are for the TID filtered frame queue
+ */
+#define ATH_TID_FILT_INSERT_HEAD(_tq, _elm, _field) do { \
+	TAILQ_INSERT_HEAD(&(_tq)->filtq.tid_q, (_elm), _field); \
+	(_tq)->axq_depth++; \
+} while (0)
+#define ATH_TID_FILT_INSERT_TAIL(_tq, _elm, _field) do { \
+	TAILQ_INSERT_TAIL(&(_tq)->filtq.tid_q, (_elm), _field); \
+	(_tq)->axq_depth++; \
+} while (0)
+#define ATH_TID_FILT_REMOVE(_tq, _elm, _field) do { \
+	TAILQ_REMOVE(&(_tq)->filtq.tid_q, _elm, _field); \
+	(_tq)->axq_depth--; \
+} while (0)
+#define	ATH_TID_FILT_FIRST(_tq)		TAILQ_FIRST(&(_tq)->filtq.tid_q)
+#define	ATH_TID_FILT_LAST(_tq, _field)	TAILQ_LAST(&(_tq)->filtq.tid_q,_field)
+
 struct ath_vap {
 	struct ieee80211vap av_vap;	/* base class */
 	int		av_bslot;	/* beacon slot index */



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