Commit a3561706 authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Kalle Valo

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: default avatarVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent e451f947
...@@ -641,6 +641,7 @@ enum ath6kl_dev_state { ...@@ -641,6 +641,7 @@ enum ath6kl_dev_state {
SKIP_SCAN, SKIP_SCAN,
ROAM_TBL_PEND, ROAM_TBL_PEND,
FIRST_BOOT, FIRST_BOOT,
RECOVERY_CLEANUP,
}; };
enum ath6kl_state { enum ath6kl_state {
...@@ -807,7 +808,6 @@ struct ath6kl { ...@@ -807,7 +808,6 @@ struct ath6kl {
bool wiphy_registered; bool wiphy_registered;
struct ath6kl_fw_recovery { struct ath6kl_fw_recovery {
bool enable;
struct work_struct recovery_work; struct work_struct recovery_work;
unsigned long err_reason; unsigned long err_reason;
unsigned long hb_poll; unsigned long hb_poll;
......
...@@ -46,7 +46,8 @@ void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason) ...@@ -46,7 +46,8 @@ void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason)
set_bit(reason, &ar->fw_recovery.err_reason); set_bit(reason, &ar->fw_recovery.err_reason);
if (ar->fw_recovery.enable && ar->state != ATH6KL_STATE_RECOVERY) if (!test_bit(RECOVERY_CLEANUP, &ar->flag) &&
ar->state != ATH6KL_STATE_RECOVERY)
queue_work(ar->ath6kl_wq, &ar->fw_recovery.recovery_work); queue_work(ar->ath6kl_wq, &ar->fw_recovery.recovery_work);
} }
...@@ -61,7 +62,8 @@ static void ath6kl_recovery_hb_timer(unsigned long data) ...@@ -61,7 +62,8 @@ static void ath6kl_recovery_hb_timer(unsigned long data)
struct ath6kl *ar = (struct ath6kl *) data; struct ath6kl *ar = (struct ath6kl *) data;
int err; int err;
if (!ar->fw_recovery.enable || (ar->state == ATH6KL_STATE_RECOVERY)) if (test_bit(RECOVERY_CLEANUP, &ar->flag) ||
(ar->state == ATH6KL_STATE_RECOVERY))
return; return;
if (ar->fw_recovery.hb_pending) if (ar->fw_recovery.hb_pending)
...@@ -94,7 +96,7 @@ void ath6kl_recovery_init(struct ath6kl *ar) ...@@ -94,7 +96,7 @@ void ath6kl_recovery_init(struct ath6kl *ar)
{ {
struct ath6kl_fw_recovery *recovery = &ar->fw_recovery; struct ath6kl_fw_recovery *recovery = &ar->fw_recovery;
recovery->enable = true; clear_bit(RECOVERY_CLEANUP, &ar->flag);
INIT_WORK(&recovery->recovery_work, ath6kl_recovery_work); INIT_WORK(&recovery->recovery_work, ath6kl_recovery_work);
recovery->seq_num = 0; recovery->seq_num = 0;
recovery->hb_misscnt = 0; recovery->hb_misscnt = 0;
...@@ -110,7 +112,7 @@ void ath6kl_recovery_init(struct ath6kl *ar) ...@@ -110,7 +112,7 @@ void ath6kl_recovery_init(struct ath6kl *ar)
void ath6kl_recovery_cleanup(struct ath6kl *ar) void ath6kl_recovery_cleanup(struct ath6kl *ar)
{ {
ar->fw_recovery.enable = false; set_bit(RECOVERY_CLEANUP, &ar->flag);
del_timer_sync(&ar->fw_recovery.hb_timer); del_timer_sync(&ar->fw_recovery.hb_timer);
cancel_work_sync(&ar->fw_recovery.recovery_work); cancel_work_sync(&ar->fw_recovery.recovery_work);
...@@ -133,7 +135,7 @@ void ath6kl_recovery_suspend(struct ath6kl *ar) ...@@ -133,7 +135,7 @@ void ath6kl_recovery_suspend(struct ath6kl *ar)
void ath6kl_recovery_resume(struct ath6kl *ar) void ath6kl_recovery_resume(struct ath6kl *ar)
{ {
ar->fw_recovery.enable = true; clear_bit(RECOVERY_CLEANUP, &ar->flag);
if (!ar->fw_recovery.hb_poll) if (!ar->fw_recovery.hb_poll)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment