Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af2db444 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville
Browse files

ath9k_hw: fix tx gain table index for AR953x



Fix tx gain table index on fast channel change for AR953x.

Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ddbbd9e8
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1552,13 +1552,15 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
				      u8 *ini_reloaded)
				      u8 *ini_reloaded)
{
{
	unsigned int regWrites = 0;
	unsigned int regWrites = 0;
	u32 modesIndex;
	u32 modesIndex, txgain_index;


	if (IS_CHAN_5GHZ(chan))
	if (IS_CHAN_5GHZ(chan))
		modesIndex = IS_CHAN_HT40(chan) ? 2 : 1;
		modesIndex = IS_CHAN_HT40(chan) ? 2 : 1;
	else
	else
		modesIndex = IS_CHAN_HT40(chan) ? 3 : 4;
		modesIndex = IS_CHAN_HT40(chan) ? 3 : 4;


	txgain_index = AR_SREV_9531(ah) ? 1 : modesIndex;

	if (modesIndex == ah->modes_index) {
	if (modesIndex == ah->modes_index) {
		*ini_reloaded = false;
		*ini_reloaded = false;
		goto set_rfmode;
		goto set_rfmode;
@@ -1573,7 +1575,7 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
		ar9003_hw_prog_ini(ah, &ah->ini_radio_post_sys2ant,
		ar9003_hw_prog_ini(ah, &ah->ini_radio_post_sys2ant,
				   modesIndex);
				   modesIndex);


	REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites);
	REG_WRITE_ARRAY(&ah->iniModesTxGain, txgain_index, regWrites);


	if (AR_SREV_9462_20_OR_LATER(ah)) {
	if (AR_SREV_9462_20_OR_LATER(ah)) {
		/*
		/*