mwifiex: stop background scan when net device closed
authorXinming Hu <huxm@marvell.com>
Mon, 18 Apr 2016 13:42:55 +0000 (06:42 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 26 Apr 2016 09:25:38 +0000 (12:25 +0300)
Transmit data path should not touch background scan. We will stop
background scan when net device is closed.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/main.c

index b459c70dc43ffca714e4660ae7d58bb70c2661cc..8b67a552a690ff47f79c041b6c32ed652c91db28 100644 (file)
@@ -702,6 +702,13 @@ mwifiex_close(struct net_device *dev)
                priv->scan_aborting = true;
        }
 
+       if (priv->sched_scanning) {
+               mwifiex_dbg(priv->adapter, INFO,
+                           "aborting bgscan on ndo_stop\n");
+               mwifiex_stop_bg_scan(priv);
+               cfg80211_sched_scan_stopped(priv->wdev.wiphy);
+       }
+
        return 0;
 }
 
@@ -753,13 +760,6 @@ int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb)
 
        mwifiex_queue_main_work(priv->adapter);
 
-       if (priv->sched_scanning) {
-               mwifiex_dbg(priv->adapter, INFO,
-                           "aborting bgscan on ndo_stop\n");
-               mwifiex_stop_bg_scan(priv);
-               cfg80211_sched_scan_stopped(priv->wdev.wiphy);
-       }
-
        return 0;
 }