Lines Matching refs:ar

23 	struct ath6kl *ar = container_of(work, struct ath6kl,  in ath6kl_recovery_work()  local
26 ar->state = ATH6KL_STATE_RECOVERY; in ath6kl_recovery_work()
28 del_timer_sync(&ar->fw_recovery.hb_timer); in ath6kl_recovery_work()
30 ath6kl_init_hw_restart(ar); in ath6kl_recovery_work()
32 ar->state = ATH6KL_STATE_ON; in ath6kl_recovery_work()
33 clear_bit(WMI_CTRL_EP_FULL, &ar->flag); in ath6kl_recovery_work()
35 ar->fw_recovery.err_reason = 0; in ath6kl_recovery_work()
37 if (ar->fw_recovery.hb_poll) in ath6kl_recovery_work()
38 mod_timer(&ar->fw_recovery.hb_timer, jiffies + in ath6kl_recovery_work()
39 msecs_to_jiffies(ar->fw_recovery.hb_poll)); in ath6kl_recovery_work()
42 void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason) in ath6kl_recovery_err_notify() argument
44 if (!ar->fw_recovery.enable) in ath6kl_recovery_err_notify()
50 set_bit(reason, &ar->fw_recovery.err_reason); in ath6kl_recovery_err_notify()
52 if (!test_bit(RECOVERY_CLEANUP, &ar->flag) && in ath6kl_recovery_err_notify()
53 ar->state != ATH6KL_STATE_RECOVERY) in ath6kl_recovery_err_notify()
54 queue_work(ar->ath6kl_wq, &ar->fw_recovery.recovery_work); in ath6kl_recovery_err_notify()
57 void ath6kl_recovery_hb_event(struct ath6kl *ar, u32 cookie) in ath6kl_recovery_hb_event() argument
59 if (cookie == ar->fw_recovery.seq_num) in ath6kl_recovery_hb_event()
60 ar->fw_recovery.hb_pending = false; in ath6kl_recovery_hb_event()
65 struct ath6kl *ar = from_timer(ar, t, fw_recovery.hb_timer); in ath6kl_recovery_hb_timer() local
68 if (test_bit(RECOVERY_CLEANUP, &ar->flag) || in ath6kl_recovery_hb_timer()
69 (ar->state == ATH6KL_STATE_RECOVERY)) in ath6kl_recovery_hb_timer()
72 if (ar->fw_recovery.hb_pending) in ath6kl_recovery_hb_timer()
73 ar->fw_recovery.hb_misscnt++; in ath6kl_recovery_hb_timer()
75 ar->fw_recovery.hb_misscnt = 0; in ath6kl_recovery_hb_timer()
77 if (ar->fw_recovery.hb_misscnt > ATH6KL_HB_RESP_MISS_THRES) { in ath6kl_recovery_hb_timer()
78 ar->fw_recovery.hb_misscnt = 0; in ath6kl_recovery_hb_timer()
79 ar->fw_recovery.seq_num = 0; in ath6kl_recovery_hb_timer()
80 ar->fw_recovery.hb_pending = false; in ath6kl_recovery_hb_timer()
81 ath6kl_recovery_err_notify(ar, ATH6KL_FW_HB_RESP_FAILURE); in ath6kl_recovery_hb_timer()
85 ar->fw_recovery.seq_num++; in ath6kl_recovery_hb_timer()
86 ar->fw_recovery.hb_pending = true; in ath6kl_recovery_hb_timer()
88 err = ath6kl_wmi_get_challenge_resp_cmd(ar->wmi, in ath6kl_recovery_hb_timer()
89 ar->fw_recovery.seq_num, 0); in ath6kl_recovery_hb_timer()
94 mod_timer(&ar->fw_recovery.hb_timer, jiffies + in ath6kl_recovery_hb_timer()
95 msecs_to_jiffies(ar->fw_recovery.hb_poll)); in ath6kl_recovery_hb_timer()
98 void ath6kl_recovery_init(struct ath6kl *ar) in ath6kl_recovery_init() argument
100 struct ath6kl_fw_recovery *recovery = &ar->fw_recovery; in ath6kl_recovery_init()
102 clear_bit(RECOVERY_CLEANUP, &ar->flag); in ath6kl_recovery_init()
106 ar->fw_recovery.hb_pending = false; in ath6kl_recovery_init()
107 timer_setup(&ar->fw_recovery.hb_timer, ath6kl_recovery_hb_timer, in ath6kl_recovery_init()
110 if (ar->fw_recovery.hb_poll) in ath6kl_recovery_init()
111 mod_timer(&ar->fw_recovery.hb_timer, jiffies + in ath6kl_recovery_init()
112 msecs_to_jiffies(ar->fw_recovery.hb_poll)); in ath6kl_recovery_init()
115 void ath6kl_recovery_cleanup(struct ath6kl *ar) in ath6kl_recovery_cleanup() argument
117 if (!ar->fw_recovery.enable) in ath6kl_recovery_cleanup()
120 set_bit(RECOVERY_CLEANUP, &ar->flag); in ath6kl_recovery_cleanup()
122 del_timer_sync(&ar->fw_recovery.hb_timer); in ath6kl_recovery_cleanup()
123 cancel_work_sync(&ar->fw_recovery.recovery_work); in ath6kl_recovery_cleanup()
126 void ath6kl_recovery_suspend(struct ath6kl *ar) in ath6kl_recovery_suspend() argument
128 if (!ar->fw_recovery.enable) in ath6kl_recovery_suspend()
131 ath6kl_recovery_cleanup(ar); in ath6kl_recovery_suspend()
133 if (!ar->fw_recovery.err_reason) in ath6kl_recovery_suspend()
137 ar->fw_recovery.err_reason = 0; in ath6kl_recovery_suspend()
138 WARN_ON(ar->state != ATH6KL_STATE_ON); in ath6kl_recovery_suspend()
139 ar->state = ATH6KL_STATE_RECOVERY; in ath6kl_recovery_suspend()
140 ath6kl_init_hw_restart(ar); in ath6kl_recovery_suspend()
141 ar->state = ATH6KL_STATE_ON; in ath6kl_recovery_suspend()
144 void ath6kl_recovery_resume(struct ath6kl *ar) in ath6kl_recovery_resume() argument
146 if (!ar->fw_recovery.enable) in ath6kl_recovery_resume()
149 clear_bit(RECOVERY_CLEANUP, &ar->flag); in ath6kl_recovery_resume()
151 if (!ar->fw_recovery.hb_poll) in ath6kl_recovery_resume()
154 ar->fw_recovery.hb_pending = false; in ath6kl_recovery_resume()
155 ar->fw_recovery.seq_num = 0; in ath6kl_recovery_resume()
156 ar->fw_recovery.hb_misscnt = 0; in ath6kl_recovery_resume()
157 mod_timer(&ar->fw_recovery.hb_timer, in ath6kl_recovery_resume()
158 jiffies + msecs_to_jiffies(ar->fw_recovery.hb_poll)); in ath6kl_recovery_resume()