wil6210: wait for disconnect completion
[deliverable/linux.git] / drivers / net / wireless / ath / wil6210 / cfg80211.c
index 774352f9e2565d1cbf072ac483f72cc5d5fc4e70..97ad91eef4a67e86bf1eeb76cea6b38fb7868afa 100644 (file)
@@ -535,7 +535,18 @@ static int wil_cfg80211_disconnect(struct wiphy *wiphy,
 
        wil_dbg_misc(wil, "%s(reason=%d)\n", __func__, reason_code);
 
-       rc = wmi_send(wil, WMI_DISCONNECT_CMDID, NULL, 0);
+       if (!(test_bit(wil_status_fwconnecting, wil->status) ||
+             test_bit(wil_status_fwconnected, wil->status))) {
+               wil_err(wil, "%s: Disconnect was called while disconnected\n",
+                       __func__);
+               return 0;
+       }
+
+       rc = wmi_call(wil, WMI_DISCONNECT_CMDID, NULL, 0,
+                     WMI_DISCONNECT_EVENTID, NULL, 0,
+                     WIL6210_DISCONNECT_TO_MS);
+       if (rc)
+               wil_err(wil, "%s: disconnect error %d\n", __func__, rc);
 
        return rc;
 }
This page took 0.041193 seconds and 5 git commands to generate.