All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hacker <hacker@epn.ru>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [OpenWrt-Devel] ath9k: Deaf QCA9558 when setting rxchainmask
Date: Tue, 12 Nov 2013 13:12:32 +0600	[thread overview]
Message-ID: <20131112071232.GB11218@infinet.ru> (raw)
In-Reply-To: <21120.58000.344447.562435@gargle.gargle.HOWL>

Thank you Sujith. Probably I understood the following patch in a wrong way.
Felix removed all chain masks checking. If the mask 5 is invalid, how about
the mask 4 and 6?
Regards,
Alex

commit 24171dd92096fc370b195f3f6bdc0798855dc3f9
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Sun Jan 20 21:55:21 2013 +0100

    ath9k_hw: fix chain swap setting when setting rx chainmask to 5
    
    Chain swapping should only be enabled when the EEPROM chainmask is set to 5,
    regardless of what the runtime chainmask is.
    
    Cc: stable at vger.kernel.org
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

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);
 }
 
 /*

WARNING: multiple messages have this Message-ID (diff)
From: Alex Hacker <hacker@epn.ru>
To: Sujith Manoharan <sujith@msujith.org>
Cc: Sven Eckelmann <sven@open-mesh.com>,
	OpenWrt Development List <openwrt-devel@lists.openwrt.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Simon Wunderlich <simon@open-mesh.com>,
	"ath9k-devel@venema.h4ckr.net" <ath9k-devel@venema.h4ckr.net>
Subject: Re: [ath9k-devel] [OpenWrt-Devel] ath9k: Deaf QCA9558 when setting rxchainmask
Date: Tue, 12 Nov 2013 13:12:32 +0600	[thread overview]
Message-ID: <20131112071232.GB11218@infinet.ru> (raw)
In-Reply-To: <21120.58000.344447.562435@gargle.gargle.HOWL>

Thank you Sujith. Probably I understood the following patch in a wrong way.
Felix removed all chain masks checking. If the mask 5 is invalid, how about
the mask 4 and 6?
Regards,
Alex

commit 24171dd92096fc370b195f3f6bdc0798855dc3f9
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Sun Jan 20 21:55:21 2013 +0100

    ath9k_hw: fix chain swap setting when setting rx chainmask to 5
    
    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>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

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);
 }
 
 /*

  reply	other threads:[~2013-11-12  7:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 15:04 [ath9k-devel] ath9k: Deaf QCA9558 when setting rxchainmask Sven Eckelmann
2013-11-06 15:04 ` Sven Eckelmann
2013-11-09  0:32 ` [ath9k-devel] " Julius Schulz-Zander
2013-11-09  0:32   ` Julius Schulz-Zander
2013-11-09  2:33   ` [ath9k-devel] [OpenWrt-Devel] " Adrian Chadd
2013-11-09  2:33     ` [OpenWrt-Devel] [ath9k-devel] " Adrian Chadd
2013-11-11  8:33     ` [ath9k-devel] [OpenWrt-Devel] ath9k: Deaf " Alex Hacker
2013-11-11  8:33       ` Alex Hacker
2013-11-11  9:36     ` [ath9k-devel] [OpenWrt-Devel] ath9k: Deaf QCA9558 " Sven Eckelmann
2013-11-11  9:36       ` [OpenWrt-Devel] [ath9k-devel] " Sven Eckelmann
2013-11-11 13:58       ` [ath9k-devel] [OpenWrt-Devel] " Sujith Manoharan
2013-11-11 13:58         ` [OpenWrt-Devel] [ath9k-devel] " Sujith Manoharan
2013-11-12  7:12         ` Alex Hacker [this message]
2013-11-12  7:12           ` [ath9k-devel] [OpenWrt-Devel] " Alex Hacker
2013-11-14  8:39           ` Sujith Manoharan
2013-11-14  8:39             ` Sujith Manoharan
2013-11-18 13:00         ` Matthias May
2013-11-18 13:00           ` Matthias May
2013-11-18 13:12           ` Sujith Manoharan
2013-11-18 13:12             ` Sujith Manoharan
2013-11-18 13:36             ` Matthias May
2013-11-18 13:36               ` Matthias May
2013-11-18 15:05               ` Sujith Manoharan
2013-11-18 15:05                 ` Sujith Manoharan
2013-11-18 14:52           ` Sujith Manoharan
2013-11-18 14:52             ` Sujith Manoharan

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=20131112071232.GB11218@infinet.ru \
    --to=hacker@epn.ru \
    --cc=ath9k-devel@lists.ath9k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.