aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2012-09-03 03:19:37 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2012-10-24 04:49:49 -0400
commit66ddcc39420f3c6d2356f7618fbed3dd61177cee (patch)
tree17150794564db7d83ebecc5ad494f762ca270b41 /drivers/net
parenta3561706320380027d4ac087e7b92ca19c0150df (diff)
ath6kl: Make fw error recovery configurable
Add a modparam to configure recovery. Recovery from firmware error is disabled by default to debug the actual issue further. To recovery from error, modprobe ath6kl_core recovery_enable=1. Reported-by: Jin Navy <nhjin@qca.qualcomm.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.c12
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.h1
-rw-r--r--drivers/net/wireless/ath/ath6kl/recovery.c12
3 files changed, 23 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index fd5dd3aca77..4b46adbe8c9 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -33,6 +33,7 @@ static unsigned int wow_mode;
33static unsigned int uart_debug; 33static unsigned int uart_debug;
34static unsigned int ath6kl_p2p; 34static unsigned int ath6kl_p2p;
35static unsigned int testmode; 35static unsigned int testmode;
36static unsigned int recovery_enable;
36static unsigned int heart_beat_poll; 37static unsigned int heart_beat_poll;
37 38
38module_param(debug_mask, uint, 0644); 39module_param(debug_mask, uint, 0644);
@@ -41,9 +42,12 @@ module_param(wow_mode, uint, 0644);
41module_param(uart_debug, uint, 0644); 42module_param(uart_debug, uint, 0644);
42module_param(ath6kl_p2p, uint, 0644); 43module_param(ath6kl_p2p, uint, 0644);
43module_param(testmode, uint, 0644); 44module_param(testmode, uint, 0644);
45module_param(recovery_enable, uint, 0644);
44module_param(heart_beat_poll, uint, 0644); 46module_param(heart_beat_poll, uint, 0644);
45MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \ 47MODULE_PARM_DESC(recovery_enable, "Enable recovery from firmware error");
46 "polling. This also specifies the polling interval in msecs"); 48MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \
49 "polling. This also specifies the polling interval in" \
50 "msecs. Set reocvery_enable for this to be effective");
47 51
48void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb) 52void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb)
49{ 53{
@@ -206,6 +210,10 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
206 ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n", 210 ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n",
207 __func__, wdev->netdev->name, wdev->netdev, ar); 211 __func__, wdev->netdev->name, wdev->netdev, ar);
208 212
213 ar->fw_recovery.enable = !!recovery_enable;
214 if (!ar->fw_recovery.enable)
215 return ret;
216
209 if (heart_beat_poll && 217 if (heart_beat_poll &&
210 test_bit(ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL, 218 test_bit(ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL,
211 ar->fw_capabilities)) 219 ar->fw_capabilities))
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 40a7b19925d..3b2dfc18085 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -815,6 +815,7 @@ struct ath6kl {
815 u32 seq_num; 815 u32 seq_num;
816 bool hb_pending; 816 bool hb_pending;
817 u8 hb_misscnt; 817 u8 hb_misscnt;
818 bool enable;
818 } fw_recovery; 819 } fw_recovery;
819 820
820#ifdef CONFIG_ATH6KL_DEBUG 821#ifdef CONFIG_ATH6KL_DEBUG
diff --git a/drivers/net/wireless/ath/ath6kl/recovery.c b/drivers/net/wireless/ath/ath6kl/recovery.c
index 98b6aa09e1b..3a8d5e97dc8 100644
--- a/drivers/net/wireless/ath/ath6kl/recovery.c
+++ b/drivers/net/wireless/ath/ath6kl/recovery.c
@@ -41,6 +41,9 @@ static void ath6kl_recovery_work(struct work_struct *work)
41 41
42void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason) 42void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason)
43{ 43{
44 if (!ar->fw_recovery.enable)
45 return;
46
44 ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Fw error detected, reason:%d\n", 47 ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Fw error detected, reason:%d\n",
45 reason); 48 reason);
46 49
@@ -112,6 +115,9 @@ void ath6kl_recovery_init(struct ath6kl *ar)
112 115
113void ath6kl_recovery_cleanup(struct ath6kl *ar) 116void ath6kl_recovery_cleanup(struct ath6kl *ar)
114{ 117{
118 if (!ar->fw_recovery.enable)
119 return;
120
115 set_bit(RECOVERY_CLEANUP, &ar->flag); 121 set_bit(RECOVERY_CLEANUP, &ar->flag);
116 122
117 del_timer_sync(&ar->fw_recovery.hb_timer); 123 del_timer_sync(&ar->fw_recovery.hb_timer);
@@ -120,6 +126,9 @@ void ath6kl_recovery_cleanup(struct ath6kl *ar)
120 126
121void ath6kl_recovery_suspend(struct ath6kl *ar) 127void ath6kl_recovery_suspend(struct ath6kl *ar)
122{ 128{
129 if (!ar->fw_recovery.enable)
130 return;
131
123 ath6kl_recovery_cleanup(ar); 132 ath6kl_recovery_cleanup(ar);
124 133
125 if (!ar->fw_recovery.err_reason) 134 if (!ar->fw_recovery.err_reason)
@@ -135,6 +144,9 @@ void ath6kl_recovery_suspend(struct ath6kl *ar)
135 144
136void ath6kl_recovery_resume(struct ath6kl *ar) 145void ath6kl_recovery_resume(struct ath6kl *ar)
137{ 146{
147 if (!ar->fw_recovery.enable)
148 return;
149
138 clear_bit(RECOVERY_CLEANUP, &ar->flag); 150 clear_bit(RECOVERY_CLEANUP, &ar->flag);
139 151
140 if (!ar->fw_recovery.hb_poll) 152 if (!ar->fw_recovery.hb_poll)