Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 May 2011 15:55:52 +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: r221667 - in head/sys/dev/ath/ath_hal: . ar9002
Message-ID:  <201105081555.p48FtqWR053018@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun May  8 15:55:52 2011
New Revision: 221667
URL: http://svn.freebsd.org/changeset/base/221667

Log:
  Fix the 5ghz fast clock logic.
  
  The macro which I incorrectly copied into ah_internal.h assumed
  that it'd be called with an AR_SREV_MERLIN_20() check to ensure
  it was only enabled for Merlin (AR9280) silicon revision 2.0 or
  later.
  
  Trouble is, the 5GHz fast clock EEPROM flag is only valid for
  EEPROM revision 16 or greater; it's assumed to be enabled
  by default for Merlin rev >= 2.0. This meant it'd be incorrectly
  set for AR5416 and AR9160 in 5GHz mode.
  
  This would have affected non-default clock timings such as SIFS,
  ACK and slot time. The incorrect slot time was very likely wrong
  for 5ghz mode.

Modified:
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h	Sun May  8 15:25:22 2011	(r221666)
+++ head/sys/dev/ath/ath_hal/ah_internal.h	Sun May  8 15:55:52 2011	(r221667)
@@ -205,7 +205,8 @@ typedef struct {
 			halMbssidAggrSupport		: 1,
 			halBssidMatchSupport		: 1,
 			hal4kbSplitTransSupport		: 1,
-			halHasRxSelfLinkedTail		: 1;
+			halHasRxSelfLinkedTail		: 1,
+			halSupportsFastClock5GHz	: 1;	/* Hardware supports 5ghz fast clock; check eeprom/channel before using */
 	uint32_t	halWirelessModes;
 	uint16_t	halTotalQueues;
 	uint16_t	halKeyCacheSize;
@@ -807,10 +808,21 @@ extern	HAL_BOOL ath_ee_FillVpdTable(uint
 extern	int16_t ath_ee_interpolate(uint16_t target, uint16_t srcLeft,
 	uint16_t srcRight, int16_t targetLeft, int16_t targetRight);
 
-/* Whether 5ghz fast clock is needed for Merlin and later */
+/* Whether 5ghz fast clock is needed */
+/*
+ * The chipset (Merlin, AR9300/later) should set the capability flag below;
+ * this flag simply says that the hardware can do it, not that the EEPROM
+ * says it can.
+ *
+ * Merlin 2.0/2.1 chips with an EEPROM version > 16 do 5ghz fast clock
+ *   if the relevant eeprom flag is set.
+ * Merlin 2.0/2.1 chips with an EEPROM version <= 16 do 5ghz fast clock
+ *   by default.
+ */
 #define	IS_5GHZ_FAST_CLOCK_EN(_ah, _c) \
 	(IEEE80211_IS_CHAN_5GHZ(_c) && \
-	ath_hal_eepromGetFlag(ah, AR_EEP_FSTCLK_5G))
+	 AH_PRIVATE((_ah))->ah_caps.halSupportsFastClock5GHz && \
+	ath_hal_eepromGetFlag((_ah), AR_EEP_FSTCLK_5G))
 
 
 #endif /* _ATH_AH_INTERAL_H_ */

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Sun May  8 15:25:22 2011	(r221666)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Sun May  8 15:55:52 2011	(r221667)
@@ -787,8 +787,14 @@ ar9280FillCapabilityInfo(struct ath_hal 
 	pCap->halMbssidAggrSupport = AH_TRUE;
 	pCap->hal4AddrAggrSupport = AH_TRUE;
 
-	if (AR_SREV_MERLIN_20_OR_LATER(ah))
+	if (AR_SREV_MERLIN_20(ah)) {
 		pCap->halPSPollBroken = AH_FALSE;
+		/*
+		 * This just enables the support; it doesn't
+		 * state 5ghz fast clock will always be used.
+		 */
+		pCap->halSupportsFastClock5GHz = AH_TRUE;
+	}
 	pCap->halRxStbcSupport = 1;
 	pCap->halTxStbcSupport = 1;
 



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