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.
This commit is contained in:
Adrian Chadd 2011-05-08 15:55:52 +00:00
parent aa66982300
commit c9cd76313b
2 changed files with 22 additions and 4 deletions

View File

@ -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(uint8_t pwrMin, uint8_t pwrMax,
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_ */

View File

@ -787,8 +787,14 @@ ar9280FillCapabilityInfo(struct ath_hal *ah)
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;