aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2012-09-03 03:19:36 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2012-10-24 04:49:49 -0400
commita3561706320380027d4ac087e7b92ca19c0150df (patch)
tree15e5e6cbf1da43d5dc3f306b4ed3373a1a313ef2 /drivers/net
parente451f947c59d527088ebbd4505e776e968b9539a (diff)
ath6kl: Add a bit to ath6kl_dev_state for recovery cleanup state
Add a bit in ath6kl_dev_state to maintian the run time state of firmware recovery configuration. This would help to have user configuration in fw_recovery which will be added in a separate patch. 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.h2
-rw-r--r--drivers/net/wireless/ath/ath6kl/recovery.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index ac90b31514b..40a7b19925d 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -641,6 +641,7 @@ enum ath6kl_dev_state {
641 SKIP_SCAN, 641 SKIP_SCAN,
642 ROAM_TBL_PEND, 642 ROAM_TBL_PEND,
643 FIRST_BOOT, 643 FIRST_BOOT,
644 RECOVERY_CLEANUP,
644}; 645};
645 646
646enum ath6kl_state { 647enum ath6kl_state {
@@ -807,7 +808,6 @@ struct ath6kl {
807 bool wiphy_registered; 808 bool wiphy_registered;
808 809
809 struct ath6kl_fw_recovery { 810 struct ath6kl_fw_recovery {
810 bool enable;
811 struct work_struct recovery_work; 811 struct work_struct recovery_work;
812 unsigned long err_reason; 812 unsigned long err_reason;
813 unsigned long hb_poll; 813 unsigned long hb_poll;
diff --git a/drivers/net/wireless/ath/ath6kl/recovery.c b/drivers/net/wireless/ath/ath6kl/recovery.c
index 1a82e8bf03c..98b6aa09e1b 100644
--- a/drivers/net/wireless/ath/ath6kl/recovery.c
+++ b/drivers/net/wireless/ath/ath6kl/recovery.c
@@ -46,7 +46,8 @@ void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason)
46 46
47 set_bit(reason, &ar->fw_recovery.err_reason); 47 set_bit(reason, &ar->fw_recovery.err_reason);
48 48
49 if (ar->fw_recovery.enable && ar->state != ATH6KL_STATE_RECOVERY) 49 if (!test_bit(RECOVERY_CLEANUP, &ar->flag) &&
50 ar->state != ATH6KL_STATE_RECOVERY)
50 queue_work(ar->ath6kl_wq, &ar->fw_recovery.recovery_work); 51 queue_work(ar->ath6kl_wq, &ar->fw_recovery.recovery_work);
51} 52}
52 53
@@ -61,7 +62,8 @@ static void ath6kl_recovery_hb_timer(unsigned long data)
61 struct ath6kl *ar = (struct ath6kl *) data; 62 struct ath6kl *ar = (struct ath6kl *) data;
62 int err; 63 int err;
63 64
64 if (!ar->fw_recovery.enable || (ar->state == ATH6KL_STATE_RECOVERY)) 65 if (test_bit(RECOVERY_CLEANUP, &ar->flag) ||
66 (ar->state == ATH6KL_STATE_RECOVERY))
65 return; 67 return;
66 68
67 if (ar->fw_recovery.hb_pending) 69 if (ar->fw_recovery.hb_pending)
@@ -94,7 +96,7 @@ void ath6kl_recovery_init(struct ath6kl *ar)
94{ 96{
95 struct ath6kl_fw_recovery *recovery = &ar->fw_recovery; 97 struct ath6kl_fw_recovery *recovery = &ar->fw_recovery;
96 98
97 recovery->enable = true; 99 clear_bit(RECOVERY_CLEANUP, &ar->flag);
98 INIT_WORK(&recovery->recovery_work, ath6kl_recovery_work); 100 INIT_WORK(&recovery->recovery_work, ath6kl_recovery_work);
99 recovery->seq_num = 0; 101 recovery->seq_num = 0;
100 recovery->hb_misscnt = 0; 102 recovery->hb_misscnt = 0;
@@ -110,7 +112,7 @@ void ath6kl_recovery_init(struct ath6kl *ar)
110 112
111void ath6kl_recovery_cleanup(struct ath6kl *ar) 113void ath6kl_recovery_cleanup(struct ath6kl *ar)
112{ 114{
113 ar->fw_recovery.enable = false; 115 set_bit(RECOVERY_CLEANUP, &ar->flag);
114 116
115 del_timer_sync(&ar->fw_recovery.hb_timer); 117 del_timer_sync(&ar->fw_recovery.hb_timer);
116 cancel_work_sync(&ar->fw_recovery.recovery_work); 118 cancel_work_sync(&ar->fw_recovery.recovery_work);
@@ -133,7 +135,7 @@ void ath6kl_recovery_suspend(struct ath6kl *ar)
133 135
134void ath6kl_recovery_resume(struct ath6kl *ar) 136void ath6kl_recovery_resume(struct ath6kl *ar)
135{ 137{
136 ar->fw_recovery.enable = true; 138 clear_bit(RECOVERY_CLEANUP, &ar->flag);
137 139
138 if (!ar->fw_recovery.hb_poll) 140 if (!ar->fw_recovery.hb_poll)
139 return; 141 return;