svn commit: r243472 - head/sys/dev/ath/ath_hal/ar5416
Adrian Chadd
adrian at FreeBSD.org
Sat Nov 24 02:41:18 UTC 2012
Author: adrian
Date: Sat Nov 24 02:41:18 2012
New Revision: 243472
URL: http://svnweb.freebsd.org/changeset/base/243472
Log:
Add a comment which covers what's going on with the 64 bit TSF write.
After chatting with the MAC team, the TSF writes (at least on the 11n
MACs, I don't know about pre-11n MACs) are done as 64 bit writes that
can take some time. So, doing a 32 bit TSF write is definitely not
supported. Leave a comment here which explains that.
Whilst here, add a comment which outlines that after a reset or TSF
write, the TSF write may take a while (up to 50uS) to update.
A write or reset shouldn't be done whilst the previous one is in
flight. Also (and this isn't currently done) a read shouldn't
occur until the SLEEP32_TSF_WRITE_STAT is clear. Right now we're
not doing that, mostly because we haven't been doing lots of TSF
resets/writes until recently.
Modified:
head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Nov 24 02:13:18 2012 (r243471)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Nov 24 02:41:18 2012 (r243472)
@@ -128,6 +128,18 @@ ar5416GetTsf64(struct ath_hal *ah)
return (((uint64_t) u32) << 32) | ((uint64_t) low2);
}
+/*
+ * Update the TSF.
+ *
+ * The full TSF is only updated once the upper 32 bits have
+ * been written. Writing only the lower 32 bits of the TSF
+ * will not actually correctly update the TSF.
+ *
+ * The #if 0'ed code is to check whether the previous TSF
+ * reset or write has completed before writing to the
+ * TSF. Strictly speaking, it should be also checked before
+ * reading the TSF as the write/reset may not have completed.
+ */
void
ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64)
{
More information about the svn-src-all
mailing list