wil6210: do not start regular scan on stopped p2p device
authorLior David <qca_liord@qca.qualcomm.com>
Wed, 8 Mar 2017 11:52:11 +0000 (13:52 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 9 Mar 2017 08:04:04 +0000 (10:04 +0200)
The driver should not allow starting any type of scan on a stopped
P2P device. Current implementation only checked social scan.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/cfg80211.c

index 83155b5ddbfb1fe8018e59760a7c2b571215b0ae..14aa6d36fd1e92b91511cbff90518c00cd9d2121 100644 (file)
@@ -390,22 +390,23 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
        }
        mutex_unlock(&wil->p2p_wdev_mutex);
 
-       /* social scan on P2P_DEVICE is handled as p2p search */
-       if (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE &&
-           wil_p2p_is_social_scan(request)) {
+       if (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE) {
                if (!wil->p2p.p2p_dev_started) {
                        wil_err(wil, "P2P search requested on stopped P2P device\n");
                        rc = -EIO;
                        goto out;
                }
-               wil->scan_request = request;
-               wil->radio_wdev = wdev;
-               rc = wil_p2p_search(wil, request);
-               if (rc) {
-                       wil->radio_wdev = wil_to_wdev(wil);
-                       wil->scan_request = NULL;
+               /* social scan on P2P_DEVICE is handled as p2p search */
+               if (wil_p2p_is_social_scan(request)) {
+                       wil->scan_request = request;
+                       wil->radio_wdev = wdev;
+                       rc = wil_p2p_search(wil, request);
+                       if (rc) {
+                               wil->radio_wdev = wil_to_wdev(wil);
+                               wil->scan_request = NULL;
+                       }
+                       goto out;
                }
-               goto out;
        }
 
        (void)wil_p2p_stop_discovery(wil);