Break out the chainmask init code into a new function - ar5416InitChainMasks() .
ath9k does a few different things here during config - if it's an early AR5416 with two chains, it enables all three chains for calibration and then restores the chainmask to the original values after initial calibration has completed. The reason behind this commit is to begin breaking out the chainmask configuration for this specific reason; follow-up commits will add the chainmask restore in the ar5416Reset() routine.
This commit is contained in:
parent
d82a9b5939
commit
09011c696c
@ -201,7 +201,7 @@ extern void ar5416GetTargetPowersLeg(struct ath_hal *ah,
|
||||
CAL_TARGET_POWER_LEG *powInfo,
|
||||
uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower,
|
||||
uint16_t numRates, HAL_BOOL isExtTarget);
|
||||
|
||||
extern void ar5416InitChainMasks(struct ath_hal *ah);
|
||||
|
||||
extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q);
|
||||
extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
|
@ -209,13 +209,11 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (AH5416(ah)->ah_rx_chainmask == 0x5 ||
|
||||
AH5416(ah)->ah_tx_chainmask == 0x5)
|
||||
OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN);
|
||||
/* Setup Chain Masks */
|
||||
OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask);
|
||||
OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask);
|
||||
OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask);
|
||||
/*
|
||||
* This routine swaps the analog chains - it should be done
|
||||
* before any radio register twiddling is done.
|
||||
*/
|
||||
ar5416InitChainMasks(ah);
|
||||
|
||||
/* Setup the transmit power values. */
|
||||
if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) {
|
||||
@ -1114,6 +1112,18 @@ ar5416SetReset(struct ath_hal *ah, int type)
|
||||
return AH_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
ar5416InitChainMasks(struct ath_hal *ah)
|
||||
{
|
||||
if (AH5416(ah)->ah_rx_chainmask == 0x5 ||
|
||||
AH5416(ah)->ah_tx_chainmask == 0x5)
|
||||
OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN);
|
||||
/* Setup Chain Masks */
|
||||
OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask);
|
||||
OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask);
|
||||
OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask);
|
||||
}
|
||||
|
||||
#ifndef IS_5GHZ_FAST_CLOCK_EN
|
||||
#define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user