From owner-svn-src-head@FreeBSD.ORG Thu Sep 13 07:17:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A6B2106564A; Thu, 13 Sep 2012 07:17:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65C098FC0C; Thu, 13 Sep 2012 07:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8D7HU5x042791; Thu, 13 Sep 2012 07:17:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8D7HU1j042789; Thu, 13 Sep 2012 07:17:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209130717.q8D7HU1j042789@svn.freebsd.org> From: Adrian Chadd Date: Thu, 13 Sep 2012 07:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240444 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 07:17:30 -0000 Author: adrian Date: Thu Sep 13 07:17:29 2012 New Revision: 240444 URL: http://svn.freebsd.org/changeset/base/240444 Log: Compensate for half/quarter rate differences in MAC clock speed. This fixes the incorrect slot (and likely ACK/RTS timeout) values which I see when enabling half/quarter rate support on the AR9280. The resulting math matches the expected calculated default values. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Sep 13 06:32:52 2012 (r240443) +++ head/sys/dev/ath/ath_hal/ah.c Thu Sep 13 07:17:29 2012 (r240444) @@ -514,6 +514,13 @@ ath_hal_mac_clks(struct ath_hal *ah, u_i clks <<= 1; } else clks = usecs * CLOCK_RATE[WIRELESS_MODE_11b]; + + /* Compensate for half/quarter rate */ + if (c != AH_NULL && IEEE80211_IS_CHAN_HALF(c)) + clks = clks / 2; + else if (c != AH_NULL && IEEE80211_IS_CHAN_QUARTER(c)) + clks = clks / 4; + return clks; }