summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-11-23 05:52:22 +0000
committeradrian <adrian@FreeBSD.org>2012-11-23 05:52:22 +0000
commitf994c71b65a6802dbd04483200ea216be9425adc (patch)
tree3cf6653ff3b84e12a5629c5a8386bed5547be216
parent428f085c8364bd3322981fc294cdb50b2e61da0a (diff)
downloadFreeBSD-src-f994c71b65a6802dbd04483200ea216be9425adc.zip
FreeBSD-src-f994c71b65a6802dbd04483200ea216be9425adc.tar.gz
Use a 64 bit TSF write to update the TSF adjust, rather than a 32 bit
TSF write. The TSF_L32 update is fine for the AR5413 (and later, I guess) 11abg NICs however on the 11n NICs this didn't work. The TSF writes were causing a much larger time to be skipped, leading to the timing to never converge. I've tested this 64 bit TSF read, adjust and write on both the 11n NICs and the AR5413 NIC I've been using for testing. It works fine on each. This patch allows the AR5416/AR9280 to be used as a TDMA member. I don't yet know why the AR9280 is ~7uS accurate rather than ~3uS; I'll look into it soon. Tested: * AR5413, TDMA slave (~ 3us accuracy) * AR5416, TDMA slave (~ 3us accuracy) * AR9280, TDMA slave (~ 7us accuracy)
-rw-r--r--sys/dev/ath/if_ath_tdma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/ath/if_ath_tdma.c b/sys/dev/ath/if_ath_tdma.c
index 6ebdcbc..e3f732c 100644
--- a/sys/dev/ath/if_ath_tdma.c
+++ b/sys/dev/ath/if_ath_tdma.c
@@ -406,7 +406,11 @@ ath_tdma_update(struct ieee80211_node *ni,
sc->sc_stats.ast_tdma_timers++;
}
if (tsfdelta > 0) {
- ath_hal_adjusttsf(ah, tsfdelta);
+ uint64_t tsf;
+
+ /* XXX should just teach ath_hal_adjusttsf() to do this */
+ tsf = ath_hal_gettsf64(ah);
+ ath_hal_settsf64(ah, tsf + tsfdelta);
sc->sc_stats.ast_tdma_tsf++;
}
ath_tdma_beacon_send(sc, vap); /* prepare response */
OpenPOWER on IntegriCloud