Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Nov 2012 05:52:22 +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: r243427 - head/sys/dev/ath
Message-ID:  <201211230552.qAN5qM9k048598@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Fri Nov 23 05:52:22 2012
New Revision: 243427
URL: http://svnweb.freebsd.org/changeset/base/243427

Log:
  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)

Modified:
  head/sys/dev/ath/if_ath_tdma.c

Modified: head/sys/dev/ath/if_ath_tdma.c
==============================================================================
--- head/sys/dev/ath/if_ath_tdma.c	Fri Nov 23 05:38:38 2012	(r243426)
+++ head/sys/dev/ath/if_ath_tdma.c	Fri Nov 23 05:52:22 2012	(r243427)
@@ -406,7 +406,11 @@ ath_tdma_update(struct ieee80211_node *n
 		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 */



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