* 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
This commit is contained in:
Adrian Chadd 2012-11-27 11:30:39 +00:00
parent b0c9d4d70e
commit 821311ea59
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243614

View File

@ -328,6 +328,16 @@ ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap)
* 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 *ni,
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);
}