Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jan 2011 08:52:06 +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: r218061 - in head/sys/dev/ath/ath_hal: ar5416 ar9002
Message-ID:  <201101290852.p0T8q6fF024533@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat Jan 29 08:52:06 2011
New Revision: 218061
URL: http://svn.freebsd.org/changeset/base/218061

Log:
  Add a check for the AR9285E; I have no idea what this is.
  
  The only other changes in ath9k for the AR9285E revolve around sleep modes
  which are not fully implemented here yet.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Sat Jan 29 08:14:47 2011	(r218060)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Sat Jan 29 08:52:06 2011	(r218061)
@@ -634,4 +634,8 @@
 #define	AR_SREV_KITE_12_OR_LATER(_ah) \
 	(AR_SREV_KITE_12(_ah) || \
 	 AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12)
+#define	AR_SREV_9285E_20(_ah) \
+	(AR_SREV_KITE_12_OR_LATER(_ah) && \
+	((OS_REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
+
 #endif /* _DEV_ATH_AR5416REG_H */

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Sat Jan 29 08:14:47 2011	(r218060)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Sat Jan 29 08:52:06 2011	(r218061)
@@ -221,15 +221,27 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
 
 	HAL_INI_INIT(&ahp9285->ah_ini_rxgain, ar9280Modes_original_rxgain_v2,
 	    6);
+
+	if (AR_SREV_9285E_20(ah))
+		ath_hal_printf(ah, "[ath] AR9285E_20 detected; using XE TX gain tables\n");
+
 	/* setup txgain table */
 	switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) {
 	case AR5416_EEP_TXGAIN_HIGH_POWER:
-		HAL_INI_INIT(&ahp9285->ah_ini_txgain,
-		    ar9285Modes_high_power_tx_gain_v2, 6);
+		if (AR_SREV_9285E_20(ah))
+			HAL_INI_INIT(&ahp9285->ah_ini_txgain,
+			    ar9285Modes_XE2_0_high_power, 6);
+		else
+			HAL_INI_INIT(&ahp9285->ah_ini_txgain,
+			    ar9285Modes_high_power_tx_gain_v2, 6);
 		break;
 	case AR5416_EEP_TXGAIN_ORIG:
-		HAL_INI_INIT(&ahp9285->ah_ini_txgain,
-		    ar9285Modes_original_tx_gain_v2, 6);
+		if (AR_SREV_9285E_20(ah))
+			HAL_INI_INIT(&ahp9285->ah_ini_txgain,
+			    ar9285Modes_XE2_0_normal_power, 6);
+		else
+			HAL_INI_INIT(&ahp9285->ah_ini_txgain,
+			    ar9285Modes_original_tx_gain_v2, 6);
 		break;
 	default:
 		HALASSERT(AH_FALSE);



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