diff options
author | adrian <adrian@FreeBSD.org> | 2012-11-27 11:30:39 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-11-27 11:30:39 +0000 |
commit | bf7f01057efb7bb7f7733fd85d9ff573a1551467 (patch) | |
tree | 526c29d3fbc43928f655d05b59f54c6c28c08cc6 | |
parent | e4de9f38a2347467d9d4f2c158d49b3c226031c7 (diff) | |
download | FreeBSD-src-bf7f01057efb7bb7f7733fd85d9ff573a1551467.zip FreeBSD-src-bf7f01057efb7bb7f7733fd85d9ff573a1551467.tar.gz |
* 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
-rw-r--r-- | sys/dev/ath/if_ath_tdma.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath_tdma.c b/sys/dev/ath/if_ath_tdma.c index 92e5e51..5b82069 100644 --- a/sys/dev/ath/if_ath_tdma.c +++ b/sys/dev/ath/if_ath_tdma.c @@ -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); } |