Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2013 04:52:17 +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: r248715 - head/sys/dev/ath
Message-ID:  <201303260452.r2Q4qH9H010618@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Tue Mar 26 04:52:16 2013
New Revision: 248715
URL: http://svnweb.freebsd.org/changeset/base/248715

Log:
  Convert the CABQ queue code over to use the HAL link pointer method
  instead of axq_link.
  
  This (among a bunch of uncommitted work) is required for EDMA chips
  to correctly transmit frames on the CABQ.
  
  Tested:
  
  * AR9280, hostap mode
  * AR9380/AR9580, hostap mode (staggered beacons)
  
  TODO:
  
  * This code only really gets called when burst beacons are used;
    it glues multiple CABQ queues together when sending to the hardware.
  * More thorough bursted beacon testing! (first requires some work with
    the beacon queue code for bursted beacons, as that currently uses the
    link pointer and will fail on EDMA chips.)

Modified:
  head/sys/dev/ath/if_ath_beacon.c

Modified: head/sys/dev/ath/if_ath_beacon.c
==============================================================================
--- head/sys/dev/ath/if_ath_beacon.c	Tue Mar 26 04:48:58 2013	(r248714)
+++ head/sys/dev/ath/if_ath_beacon.c	Tue Mar 26 04:52:16 2013	(r248715)
@@ -632,7 +632,7 @@ ath_beacon_generate(struct ath_softc *sc
 		/* NB: only at DTIM */
 		ATH_TXQ_LOCK(&avp->av_mcastq);
 		if (nmcastq) {
-			struct ath_buf *bfm;
+			struct ath_buf *bfm, *bfc_last;
 
 			/*
 			 * Move frames from the s/w mcast q to the h/w cab q.
@@ -645,16 +645,23 @@ ath_beacon_generate(struct ath_softc *sc
 			 * MORE data bit set on the last frame of each
 			 * intermediary VAP (ie, only clear the MORE
 			 * bit of the last frame on the last vap?)
-			 *
-			 * XXX TODO: once we append this, what happens
-			 * to cabq->axq_link? It'll point at the avp
-			 * mcastq link pointer, so things should be OK.
-			 * Just double-check this is what actually happens.
 			 */
 			bfm = TAILQ_FIRST(&avp->av_mcastq.axq_q);
 			ATH_TXQ_LOCK(cabq);
-			if (cabq->axq_link != NULL)
-				*cabq->axq_link = bfm->bf_daddr;
+
+			/*
+			 * If there's already a frame on the CABQ, we
+			 * need to link to the end of the last frame.
+			 * We can't use axq_link here because
+			 * EDMA descriptors require some recalculation
+			 * (checksum) to occur.
+			 */
+			bfc_last = ATH_TXQ_LAST(cabq, axq_q_s);
+			if (bfc_last != NULL) {
+				ath_hal_settxdesclink(sc->sc_ah,
+				    bfc_last->bf_lastds,
+				    bfm->bf_daddr);
+			}
 			ath_txqmove(cabq, &avp->av_mcastq);
 			ATH_TXQ_UNLOCK(cabq);
 			/*



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