Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Nov 2012 02:41:18 +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: r243472 - head/sys/dev/ath/ath_hal/ar5416
Message-ID:  <201211240241.qAO2fIBn047896@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 {



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