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, lrodriguez@atheros.com
Subject: [PATCH 1/9] ath9k: check for specific rx stuck conditions and recover from them
Date: Sun, 18 Apr 2010 16:56:34 +0200	[thread overview]
Message-ID: <1271602602-8538-1-git-send-email-nbd@openwrt.org> (raw)

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/hw.c   |   28 ++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath9k/hw.h   |    1 +
 drivers/net/wireless/ath/ath9k/main.c |    3 ++-
 3 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9aa40df..5a29048 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1160,6 +1160,34 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
 	return true;
 }
 
+bool ath9k_hw_check_alive(struct ath_hw *ah)
+{
+	int count = 50;
+	u32 reg;
+
+	if (AR_SREV_9285_10_OR_LATER(ah))
+		return true;
+
+	do {
+		reg = REG_READ(ah, AR_OBS_BUS_1);
+
+		if ((reg & 0x7E7FFFEF) == 0x00702400)
+			continue;
+
+		switch (reg & 0x7E000B00) {
+		case 0x1E000000:
+		case 0x52000B00:
+		case 0x18000B00:
+			continue;
+		default:
+			return true;
+		}
+	} while (count-- > 0);
+
+	return false;
+}
+EXPORT_SYMBOL(ath9k_hw_check_alive);
+
 int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 		    bool bChannelChange)
 {
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 8158e8e..a78e09b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -869,6 +869,7 @@ void ath9k_hw_set11nmac2040(struct ath_hw *ah);
 void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
 void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
 				    const struct ath9k_beacon_state *bs);
+bool ath9k_hw_check_alive(struct ath_hw *ah);
 
 bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
 
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 1f4ea74..0246e7a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -405,7 +405,8 @@ void ath9k_tasklet(unsigned long data)
 
 	ath9k_ps_wakeup(sc);
 
-	if (status & ATH9K_INT_FATAL) {
+	if ((status & ATH9K_INT_FATAL) ||
+	    !ath9k_hw_check_alive(ah)) {
 		ath_reset(sc, false);
 		ath9k_ps_restore(sc);
 		return;
-- 
1.6.4.2


             reply	other threads:[~2010-04-18 15:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-18 14:56 Felix Fietkau [this message]
2010-04-18 14:56 ` [PATCH 2/9] ath9k: clean up tx buffer handling Felix Fietkau
2010-04-18 14:56   ` [PATCH 3/9] ath9k: update the MCS mask for MCS16 and above Felix Fietkau
2010-04-18 14:56     ` [PATCH 4/9] ath9k: update the ath_max_4ms_framelen table Felix Fietkau
2010-04-18 14:56       ` [PATCH 5/9] ath9k: reduce the bits_per_symbol table size, support more streams Felix Fietkau
2010-04-18 14:56         ` [PATCH 6/9] ath9k: initialize the number of tx/rx streams correctly Felix Fietkau
2010-04-18 14:56           ` [PATCH 7/9] mac80211: add flags for STBC (Space-Time Block Coding) Felix Fietkau
2010-04-18 14:56             ` [PATCH 8/9] ath9k: add support for Tx and Rx STBC Felix Fietkau
2010-04-18 14:56               ` [PATCH 9/9] ath9k: set the STBC flag in rate control if the peer supports it Felix Fietkau
2010-04-19 12:22               ` [PATCH 8/9] ath9k: add support for Tx and Rx STBC Björn Smedman
2010-04-19 12:28                 ` Felix Fietkau
2010-04-18 15:53             ` [PATCH 7/9] mac80211: add flags for STBC (Space-Time Block Coding) Johannes Berg
2010-04-18 16:05               ` Felix Fietkau
2010-04-19  5:57                 ` Johannes Berg
2010-04-19  8:45                   ` Felix Fietkau
2010-04-19  8:59                     ` Johannes Berg
2010-04-19  9:06                       ` Felix Fietkau
2010-04-19  9:09                         ` Johannes Berg
2010-04-19 10:14                           ` Felix Fietkau
2010-04-19 10:19                             ` Johannes Berg
2010-04-19 10:51                               ` Felix Fietkau

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=1271602602-8538-1-git-send-email-nbd@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    /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).