Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 May 2011 07:21:09 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221620 - head/sys/dev/ath/ath_hal/ar5416
Message-ID:  <201105080721.p487L9LG034115@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105080721.p487L9LG034115>