From owner-svn-src-head@FreeBSD.ORG Sun May 8 07:21:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DA7C1065670; Sun, 8 May 2011 07:21:09 +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 75A9C8FC08; Sun, 8 May 2011 07:21:09 +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 p487L9oC034117; Sun, 8 May 2011 07:21:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p487L9LG034115; Sun, 8 May 2011 07:21:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105080721.p487L9LG034115@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 07:21:09 +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: r221620 - head/sys/dev/ath/ath_hal/ar5416 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: Sun, 08 May 2011 07:21:09 -0000 Author: adrian Date: Sun May 8 07:21:09 2011 New Revision: 221620 URL: http://svn.freebsd.org/changeset/base/221620 Log: Fiddle with the PLL initialisation order to match ath9k/Atheros HAL. This seems to make the AR9160 behave better during heavy scanning, where before it'd hang and require a hard reset to recover. Obtained From: Linux ath9k, Atheros 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 Sun May 8 06:25:50 2011 (r221619) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 07:21:09 2011 (r221620) @@ -521,7 +521,6 @@ ar5416InitBB(struct ath_hal *ah, const s /* Turn on PLL on 5416 */ HALDEBUG(ah, HAL_DEBUG_RESET, "%s %s channel\n", __func__, IEEE80211_IS_CHAN_5GHZ(chan) ? "5GHz" : "2GHz"); - AH5416(ah)->ah_initPLL(ah, chan); /* Activate the PHY (includes baseband activate and synthesizer on) */ OS_REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN); @@ -674,6 +673,10 @@ ar5416ChipReset(struct ath_hal *ah, cons if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; +#ifdef notyet + ahp->ah_chipFullSleep = AH_FALSE; +#endif + AH5416(ah)->ah_initPLL(ah, chan); /* @@ -682,8 +685,7 @@ ar5416ChipReset(struct ath_hal *ah, cons * with an active radio can result in corrupted shifts to the * radio device. */ - if (chan != AH_NULL) - ar5416SetRfMode(ah, chan); + ar5416SetRfMode(ah, chan); return AH_TRUE; } @@ -1103,7 +1105,11 @@ ar5416Disable(struct ath_hal *ah) { if (!ar5212SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; - return ar5416SetResetReg(ah, HAL_RESET_COLD); + if (! ar5416SetResetReg(ah, HAL_RESET_COLD)) + return AH_FALSE; + + AH5416(ah)->ah_initPLL(ah, AH_NULL); + return AH_TRUE; } /* @@ -1115,7 +1121,11 @@ ar5416Disable(struct ath_hal *ah) HAL_BOOL ar5416PhyDisable(struct ath_hal *ah) { - return ar5416SetResetReg(ah, HAL_RESET_WARM); + if (! ar5416SetResetReg(ah, HAL_RESET_WARM)) + return AH_FALSE; + + AH5416(ah)->ah_initPLL(ah, AH_NULL); + return AH_TRUE; } /* @@ -1278,8 +1288,6 @@ ar5416SetReset(struct ath_hal *ah, int t } } - AH5416(ah)->ah_initPLL(ah, AH_NULL); - return AH_TRUE; }