Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2012 11:30:39 +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: r243614 - head/sys/dev/ath
Message-ID:  <201211271130.qARBUdGm054209@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Tue Nov 27 11:30:39 2012
New Revision: 243614
URL: http://svnweb.freebsd.org/changeset/base/243614

Log:
  * Fix another culprit of my "committed from the wrong directory" nonsense;
    now this works for non-debug and debug builds.
  
  * Add a comment reminding me (or someone) to audit all of the relevant
    math to ensure there's no weird wrapping issues still lurking about.
  
  But yes, this does seem to be mostly working.
  
  Pointy-hat-to:	adrian, yet again

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

Modified: head/sys/dev/ath/if_ath_tdma.c
==============================================================================
--- head/sys/dev/ath/if_ath_tdma.c	Tue Nov 27 10:38:11 2012	(r243613)
+++ head/sys/dev/ath/if_ath_tdma.c	Tue Nov 27 11:30:39 2012	(r243614)
@@ -328,6 +328,16 @@ ath_tdma_config(struct ath_softc *sc, st
  * beacon timers so we follow their schedule.  Note that
  * by using the rx timestamp we implicitly include the
  * propagation delay in our schedule.
+ *
+ * XXX TODO: since the changes for the AR5416 and later chips
+ * involved changing the TSF/TU calculations, we need to make
+ * sure that various calculations wrap consistently.
+ *
+ * A lot of the problems stemmed from the calculations wrapping
+ * at 65,535 TU.  Since a lot of the math is still being done in
+ * TU, please audit it to ensure that when the TU values programmed
+ * into the timers wrap at (2^31)-1 TSF, all the various terms
+ * wrap consistently.
  */
 void
 ath_tdma_update(struct ieee80211_node *ni,
@@ -541,8 +551,8 @@ ath_tdma_update(struct ieee80211_node *n
 			struct if_ath_alq_tdma_tsf_adjust t;
 
 			t.tsfdelta = htobe32(tsfdelta);
-			t.tsf64_old = htobe64(tsf_1);
-			t.tsf64_new = htobe64(tsf_1 + tsfdelta);
+			t.tsf64_old = htobe64(tsf);
+			t.tsf64_new = htobe64(tsf + tsfdelta);
 			if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_TSF_ADJUST,
 			    sizeof(t), (char *) &t);
 		}



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