linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, mcgrof@qca.qualcomm.com, stable@vger.kernel.org
Subject: [PATCH 3.8 2/3] ath9k_hw: fix chain swap setting when setting rx chainmask to 5
Date: Sun, 20 Jan 2013 21:55:21 +0100	[thread overview]
Message-ID: <1358715322-46447-2-git-send-email-nbd@openwrt.org> (raw)
In-Reply-To: <1358715322-46447-1-git-send-email-nbd@openwrt.org>

Chain swapping should only be enabled when the EEPROM chainmask is set to 5,
regardless of what the runtime chainmask is.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ar9003_phy.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 8290edd..3afc24b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -588,30 +588,17 @@ static void ar9003_hw_init_bb(struct ath_hw *ah,
 
 void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx)
 {
-	switch (rx) {
-	case 0x5:
+	if (ah->caps.tx_chainmask == 5 || ah->caps.rx_chainmask == 5)
 		REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
 			    AR_PHY_SWAP_ALT_CHAIN);
-	case 0x3:
-	case 0x1:
-	case 0x2:
-	case 0x7:
-		REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx);
-		REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx);
-		break;
-	default:
-		break;
-	}
+
+	REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx);
+	REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx);
 
 	if ((ah->caps.hw_caps & ATH9K_HW_CAP_APM) && (tx == 0x7))
-		REG_WRITE(ah, AR_SELFGEN_MASK, 0x3);
-	else
-		REG_WRITE(ah, AR_SELFGEN_MASK, tx);
+		tx = 3;
 
-	if (tx == 0x5) {
-		REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
-			    AR_PHY_SWAP_ALT_CHAIN);
-	}
+	REG_WRITE(ah, AR_SELFGEN_MASK, tx);
 }
 
 /*
-- 
1.8.0.2


  reply	other threads:[~2013-01-20 20:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 20:55 [PATCH 3.8 1/3] ath9k_hw: fix calibration issues on chainmask that don't include chain 0 Felix Fietkau
2013-01-20 20:55 ` Felix Fietkau [this message]
2013-01-20 20:55   ` [PATCH 3.8 3/3] ath9k: allow setting arbitrary antenna masks on AR9003+ Felix Fietkau
2013-01-20 22:05   ` [PATCH 3.8 2/3] ath9k_hw: fix chain swap setting when setting rx chainmask to 5 Adrian Chadd
2013-01-20 22:31     ` Felix Fietkau
2013-03-07 14:31 ` [PATCH 3.8 1/3] ath9k_hw: fix calibration issues on chainmask that don't include chain 0 Wojciech Dubowik
2013-03-07 14:59   ` Felix Fietkau
2013-03-07 15:46     ` Wojciech Dubowik
2013-03-08  7:44       ` Wojciech Dubowik
2013-03-08  9:46         ` Wojciech Dubowik
2013-03-08 12:42           ` Felix Fietkau
2013-03-11  6:25             ` Wojciech Dubowik
2013-03-11  9:43               ` Wojciech Dubowik
2013-03-15  0:01                 ` Felix Fietkau
2013-03-15  1:32                   ` Felix Fietkau
2013-03-15  7:06                     ` Wojciech Dubowik
2013-03-08 20:34       ` John W. Linville
2013-03-11  6:29         ` Wojciech Dubowik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358715322-46447-2-git-send-email-nbd@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@qca.qualcomm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).