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 */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to