]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath6kl: Fix reconnection issue after recovery
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Tue, 11 Sep 2012 06:37:00 +0000 (12:07 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 24 Oct 2012 08:49:50 +0000 (11:49 +0300)
Disallowing any wmi commands while re-initializing the
firmware results in connection failures after recovery
is done in open/WEP mode. To fix this, clear WMI_READY,
to make sure no wmi command is tried while fw is down.
Remove ATH6KL_STATE_RECOVERY state check in ath6kl_control_tx()
so that any configuration during fw init time will go through
using wmi commands.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/ath6kl/init.c
drivers/net/wireless/ath/ath6kl/txrx.c

index c8b6be44fa208d1c67c09a47a3899a3c173c5a41..530eede4f5e24f5a1dfd72ced847864200e0e3ca 100644 (file)
@@ -151,6 +151,10 @@ static bool __ath6kl_cfg80211_sscan_stop(struct ath6kl_vif *vif)
                return false;
 
        del_timer_sync(&vif->sched_scan_timer);
+
+       if (ar->state == ATH6KL_STATE_RECOVERY)
+               return true;
+
        ath6kl_wmi_enable_sched_scan_cmd(ar->wmi, vif->fw_vif_idx, false);
 
        return true;
@@ -3435,8 +3439,9 @@ void ath6kl_cfg80211_stop(struct ath6kl_vif *vif)
                break;
        }
 
-       if (test_bit(CONNECTED, &vif->flags) ||
-           test_bit(CONNECT_PEND, &vif->flags))
+       if (vif->ar->state != ATH6KL_STATE_RECOVERY &&
+           (test_bit(CONNECTED, &vif->flags) ||
+           test_bit(CONNECT_PEND, &vif->flags)))
                ath6kl_wmi_disconnect_cmd(vif->ar->wmi, vif->fw_vif_idx);
 
        vif->sme_state = SME_DISCONNECTED;
@@ -3448,7 +3453,8 @@ void ath6kl_cfg80211_stop(struct ath6kl_vif *vif)
        netif_carrier_off(vif->ndev);
 
        /* disable scanning */
-       if (ath6kl_wmi_scanparams_cmd(vif->ar->wmi, vif->fw_vif_idx, 0xFFFF,
+       if (vif->ar->state != ATH6KL_STATE_RECOVERY &&
+           ath6kl_wmi_scanparams_cmd(vif->ar->wmi, vif->fw_vif_idx, 0xFFFF,
                                      0, 0, 0, 0, 0, 0, 0, 0, 0) != 0)
                ath6kl_warn("failed to disable scan during stop\n");
 
index 6e270fa6d63b8c3494d569795c7cbffade080eac..424676e06b378b8362cf4c0e32365a09a0d6f80f 100644 (file)
@@ -1697,10 +1697,14 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
 
 void ath6kl_init_hw_restart(struct ath6kl *ar)
 {
+       clear_bit(WMI_READY, &ar->flag);
+
        ath6kl_cfg80211_stop_all(ar);
 
-       if (__ath6kl_init_hw_stop(ar))
+       if (__ath6kl_init_hw_stop(ar)) {
+               ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Failed to stop during fw error recovery\n");
                return;
+       }
 
        if (__ath6kl_init_hw_start(ar)) {
                ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Failed to restart during fw error recovery\n");
index e867193373fe25fcd4e20a499c24b436ad744cd8..efee590a234a2f9d3aed6fe5c0674e61925e50c4 100644 (file)
@@ -288,8 +288,7 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb,
        int status = 0;
        struct ath6kl_cookie *cookie = NULL;
 
-       if (WARN_ON_ONCE(ar->state == ATH6KL_STATE_WOW) ||
-           ar->state == ATH6KL_STATE_RECOVERY) {
+       if (WARN_ON_ONCE(ar->state == ATH6KL_STATE_WOW)) {
                dev_kfree_skb(skb);
                return -EACCES;
        }