Lines Matching defs:ar

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