linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/8] ath5k: Fixes for PCI-E cards
@ 2008-02-24  4:28 Nick Kossifidis
  2008-02-24  4:45 ` [ath5k-devel] " Nick Kossifidis
  2008-02-24 20:16 ` Christoph Hellwig
  0 siblings, 2 replies; 22+ messages in thread
From: Nick Kossifidis @ 2008-02-24  4:28 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless; +Cc: linville, bruno, jirislaby, mcgrof

 * Fix nic_wakeup for PCI-E chips (don't set AR5K_RESET_CTL_PCI bit)

 * Fix dma size setting for PCI-E chips (thanx to Bob Copeland).

Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

---
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index c0b6596..d8ec373 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -971,6 +971,7 @@ struct ath5k_hw {
 	enum ath5k_version	ah_version;
 	enum ath5k_radio	ah_radio;
 	u32			ah_phy;
+	bool			ah_pcie;
 
 	bool			ah_5ghz;
 	bool			ah_2ghz;
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 3ae5522..cd640ed 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -214,6 +214,14 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 		ah->ah_single_chip = false;
 	}
 
+	/* Identify PCI-E cards */
+	if((srev >= AR5K_SREV_VER_AR2424 && srev <= AR5K_SREV_VER_AR5424) ||
+	srev >= AR5K_SREV_VER_AR5416) {
+		ah->ah_pcie = true;
+	} else {
+		ah->ah_pcie = false;
+	}
+
 	/* Single chip radio */
 	if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
 		ah->ah_radio_2ghz_revision = 0;
@@ -377,9 +385,12 @@ static int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
 					AR5K_PHY_TURBO);
 	}
 
-	/* ...reset chipset and PCI device */
-	if (ah->ah_single_chip == false && ath5k_hw_nic_reset(ah,
-				AR5K_RESET_CTL_CHIP | AR5K_RESET_CTL_PCI)) {
+	/* ...reset chipset
+	 * Warning: reseting PCI on PCI-E cards results card to hang
+	 * and always return 0xffff...
+	 */
+	if (ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_BASEBAND |
+				(ah->ah_pcie == false ? AR5K_RESET_CTL_PCI : 0) )) {
 		ATH5K_ERR(ah->ah_sc, "failed to reset the MAC Chip + PCI\n");
 		return -EIO;
 	}
@@ -900,13 +911,25 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
 
 	/*
 	 * Set Rx/Tx DMA Configuration
-	 *(passing dma size not available on 5210)
+	 * 
+	 * Set maximum DMA size (512) except for PCI-E cards since
+	 * it causes rx overruns and tx errors (tested on 5424 but since
+	 * rx overruns also occur on 5416/5418 with madwifi we set 128
+	 * for all PCI-E cards to be safe).
+	 *
+	 * In dumps this is 128 for allchips.
+	 *
+	 * XXX: need to check 5210 for this
+	 * TODO: Check out tx triger level, it's always 64 on dumps but i 
+	 * guess we can tweak it and see how it goes ;-)
 	 */
 	if (ah->ah_version != AR5K_AR5210) {
 		AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG, AR5K_TXCFG_SDMAMR,
-				AR5K_DMASIZE_512B | AR5K_TXCFG_DMASIZE);
+				(ah->ah_pcie == true ?
+				AR5K_DMASIZE_128B : AR5K_DMASIZE_512B));
 		AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG, AR5K_RXCFG_SDMAMW,
-				AR5K_DMASIZE_512B);
+				(ah->ah_pcie == true ?
+				AR5K_DMASIZE_128B : AR5K_DMASIZE_512B));
 	}
 
 	/*



^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH 1/8] ath5k: Add RF2413 srev values
@ 2008-02-28 22:56 Luis R. Rodriguez
  2008-02-28 22:59 ` [PATCH 6/8] ath5k: Fixes for PCI-E cards Luis R. Rodriguez
  0 siblings, 1 reply; 22+ messages in thread
From: Luis R. Rodriguez @ 2008-02-28 22:56 UTC (permalink / raw)
  To: linville; +Cc: ath5k-devel, linux-wireless, jirislaby, mickflemm, bruno, me

 * Add RF2413 srev values and a new entry on ath5k_radio enum for it
  since it differs from RF5413 (it's not like 5112-2112).

Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
---
 drivers/net/wireless/ath5k/ath5k.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index 18223d9..25c8e98 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -140,7 +140,8 @@ enum ath5k_radio {
 	AR5K_RF5110	= 0,
 	AR5K_RF5111	= 1,
 	AR5K_RF5112	= 2,
-	AR5K_RF5413	= 3,
+	AR5K_RF2413	= 3,
+	AR5K_RF5413	= 4,
 };
 
 /*
@@ -168,12 +169,15 @@ struct ath5k_srev_name {
 #define AR5K_SREV_VER_AR5212	0x50
 #define AR5K_SREV_VER_AR5213	0x55
 #define AR5K_SREV_VER_AR5213A	0x59
+#define AR5K_SREV_VER_AR2413	0x78
+#define AR5K_SREV_VER_AR2414	0x79
 #define AR5K_SREV_VER_AR2424	0xa0
 #define AR5K_SREV_VER_AR5424	0xa3
 #define AR5K_SREV_VER_AR5413	0xa4
 #define AR5K_SREV_VER_AR5414	0xa5
 #define AR5K_SREV_VER_AR5416	0xc0	/* ? */
 #define AR5K_SREV_VER_AR5418	0xca
+#define AR5K_SREV_VER_AR2425	0xe2
 
 #define AR5K_SREV_RAD_5110	0x00
 #define AR5K_SREV_RAD_5111	0x10
@@ -183,8 +187,9 @@ struct ath5k_srev_name {
 #define AR5K_SREV_RAD_5112A	0x35
 #define AR5K_SREV_RAD_2112	0x40
 #define AR5K_SREV_RAD_2112A	0x45
+#define AR5K_SREV_RAD_SC0	0x56	/* Found on 2413/2414 */
 #define AR5K_SREV_RAD_SC1	0x63	/* Found on 5413/5414 */
-#define AR5K_SREV_RAD_SC2	0xa2	/* Found on 2424/5424 */
+#define AR5K_SREV_RAD_SC2	0xa2	/* Found on 2424-5/5424 */
 #define AR5K_SREV_RAD_5133	0xc0	/* MIMO found on 5418 */
 
 /* IEEE defs */
-- 
1.5.3.7


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-02-29  2:03 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-24  4:28 [PATCH 6/8] ath5k: Fixes for PCI-E cards Nick Kossifidis
2008-02-24  4:45 ` [ath5k-devel] " Nick Kossifidis
2008-02-24  4:47   ` Nick Kossifidis
2008-02-24 16:09   ` Bob Copeland
2008-02-24 17:59   ` Bob Copeland
2008-02-24 18:58     ` Nick Kossifidis
2008-02-24 20:21       ` Bob Copeland
2008-02-24 23:23         ` Nick Kossifidis
2008-02-27  3:23       ` Luis R. Rodriguez
2008-02-27  5:54         ` Nick Kossifidis
2008-02-27 13:30           ` Luis R. Rodriguez
2008-02-27 15:52             ` John W. Linville
2008-02-27 18:44               ` Nick Kossifidis
2008-02-28 22:20                 ` Luis R. Rodriguez
2008-02-24 23:48     ` Nick Kossifidis
2008-02-25  2:23       ` Bob Copeland
2008-02-25 14:20         ` Nick Kossifidis
2008-02-24 20:17   ` Christoph Hellwig
2008-02-24 23:27     ` Nick Kossifidis
2008-02-24 20:16 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2008-02-28 22:56 [PATCH 1/8] ath5k: Add RF2413 srev values Luis R. Rodriguez
2008-02-28 22:59 ` [PATCH 6/8] ath5k: Fixes for PCI-E cards Luis R. Rodriguez
2008-02-29  2:03   ` Bob Copeland

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).