From owner-svn-src-all@FreeBSD.ORG Tue Mar 22 00:52:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59D1E106567A; Tue, 22 Mar 2011 00:52:45 +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 312B08FC0A; Tue, 22 Mar 2011 00:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2M0qjgJ033418; Tue, 22 Mar 2011 00:52:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2M0qjvd033416; Tue, 22 Mar 2011 00:52:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103220052.p2M0qjvd033416@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 Mar 2011 00:52:45 +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: r219855 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 22 Mar 2011 00:52:45 -0000 Author: adrian Date: Tue Mar 22 00:52:44 2011 New Revision: 219855 URL: http://svn.freebsd.org/changeset/base/219855 Log: Break out the RF mode setup into ar5416SetRfMode(), mirroring what ath9k does. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 00:43:58 2011 (r219854) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 00:52:44 2011 (r219855) @@ -598,6 +598,29 @@ ar5416InitUserSettings(struct ath_hal *a #endif } +static void +ar5416SetRfMode(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + uint32_t rfMode; + + if (chan == AH_NULL) + return; + + /* treat channel B as channel G , no B mode suport in owl */ + rfMode = IEEE80211_IS_CHAN_CCK(chan) ? + AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; + + if (AR_SREV_MERLIN_20(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) { + /* phy mode bits for 5GHz channels require Fast Clock */ + rfMode |= AR_PHY_MODE_DYNAMIC + | AR_PHY_MODE_DYN_CCK_DISABLE; + } else if (!AR_SREV_MERLIN_10_OR_LATER(ah)) { + rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ? + AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; + } + OS_REG_WRITE(ah, AR_PHY_MODE, rfMode); +} + /* * Places the hardware into reset and then pulls it out of reset */ @@ -629,22 +652,9 @@ ar5416ChipReset(struct ath_hal *ah, cons * with an active radio can result in corrupted shifts to the * radio device. */ - if (chan != AH_NULL) { - uint32_t rfMode; + if (chan != AH_NULL) + ar5416SetRfMode(ah, chan); - /* treat channel B as channel G , no B mode suport in owl */ - rfMode = IEEE80211_IS_CHAN_CCK(chan) ? - AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; - if (AR_SREV_MERLIN_20(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) { - /* phy mode bits for 5GHz channels require Fast Clock */ - rfMode |= AR_PHY_MODE_DYNAMIC - | AR_PHY_MODE_DYN_CCK_DISABLE; - } else if (!AR_SREV_MERLIN_10_OR_LATER(ah)) { - rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ? - AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; - } - OS_REG_WRITE(ah, AR_PHY_MODE, rfMode); - } return AH_TRUE; }