ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT
[cascardo/linux.git] / drivers / net / wireless / ath / ath9k / htc_drv_main.c
index dab1323..172a9ff 100644 (file)
@@ -794,8 +794,11 @@ void ath9k_htc_ani_work(struct work_struct *work)
                common->ani.longcal_timer = timestamp;
        }
 
-       /* Short calibration applies only while caldone is false */
-       if (!common->ani.caldone) {
+       /*
+        * Short calibration applies only while caldone
+        * is false or -ETIMEDOUT
+        */
+       if (common->ani.caldone <= 0) {
                if ((timestamp - common->ani.shortcal_timer) >=
                    short_cal_interval) {
                        shortcal = true;
@@ -844,7 +847,11 @@ set_timer:
        */
        cal_interval = ATH_LONG_CALINTERVAL;
        cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
-       if (!common->ani.caldone)
+       /*
+        * Short calibration applies only while caldone
+        * is false or -ETIMEDOUT
+        */
+       if (common->ani.caldone <= 0)
                cal_interval = min(cal_interval, (u32)short_cal_interval);
 
        ieee80211_queue_delayed_work(common->hw, &priv->ani_work,