From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 05:52:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE33BA7F; Fri, 23 Nov 2012 05:52:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B899D8FC0C; Fri, 23 Nov 2012 05:52:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN5qMds048599; Fri, 23 Nov 2012 05:52:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN5qM9k048598; Fri, 23 Nov 2012 05:52:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211230552.qAN5qM9k048598@svn.freebsd.org> From: Adrian Chadd Date: Fri, 23 Nov 2012 05:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243427 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 05:52:23 -0000 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 */