diff options
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 7 |
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 5046a0005034..373930afc26b 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -700,8 +700,9 @@ static void lbs_scan_worker(struct work_struct *work) | |||
700 | 700 | ||
701 | if (priv->scan_channel < priv->scan_req->n_channels) { | 701 | if (priv->scan_channel < priv->scan_req->n_channels) { |
702 | cancel_delayed_work(&priv->scan_work); | 702 | cancel_delayed_work(&priv->scan_work); |
703 | queue_delayed_work(priv->work_thread, &priv->scan_work, | 703 | if (!priv->stopping) |
704 | msecs_to_jiffies(300)); | 704 | queue_delayed_work(priv->work_thread, &priv->scan_work, |
705 | msecs_to_jiffies(300)); | ||
705 | } | 706 | } |
706 | 707 | ||
707 | /* This is the final data we are about to send */ | 708 | /* This is the final data we are about to send */ |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index f062ed583901..cb14c38caf3a 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -36,6 +36,7 @@ struct lbs_private { | |||
36 | /* CFG80211 */ | 36 | /* CFG80211 */ |
37 | struct wireless_dev *wdev; | 37 | struct wireless_dev *wdev; |
38 | bool wiphy_registered; | 38 | bool wiphy_registered; |
39 | bool stopping; | ||
39 | struct cfg80211_scan_request *scan_req; | 40 | struct cfg80211_scan_request *scan_req; |
40 | u8 assoc_bss[ETH_ALEN]; | 41 | u8 assoc_bss[ETH_ALEN]; |
41 | u8 disassoc_reason; | 42 | u8 disassoc_reason; |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 47ce5a6ba120..46b88b118c99 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -104,6 +104,7 @@ static int lbs_dev_open(struct net_device *dev) | |||
104 | lbs_deb_enter(LBS_DEB_NET); | 104 | lbs_deb_enter(LBS_DEB_NET); |
105 | 105 | ||
106 | spin_lock_irq(&priv->driver_lock); | 106 | spin_lock_irq(&priv->driver_lock); |
107 | priv->stopping = false; | ||
107 | 108 | ||
108 | if (priv->connect_status == LBS_CONNECTED) | 109 | if (priv->connect_status == LBS_CONNECTED) |
109 | netif_carrier_on(dev); | 110 | netif_carrier_on(dev); |
@@ -131,10 +132,16 @@ static int lbs_eth_stop(struct net_device *dev) | |||
131 | lbs_deb_enter(LBS_DEB_NET); | 132 | lbs_deb_enter(LBS_DEB_NET); |
132 | 133 | ||
133 | spin_lock_irq(&priv->driver_lock); | 134 | spin_lock_irq(&priv->driver_lock); |
135 | priv->stopping = true; | ||
134 | netif_stop_queue(dev); | 136 | netif_stop_queue(dev); |
135 | spin_unlock_irq(&priv->driver_lock); | 137 | spin_unlock_irq(&priv->driver_lock); |
136 | 138 | ||
137 | schedule_work(&priv->mcast_work); | 139 | schedule_work(&priv->mcast_work); |
140 | cancel_delayed_work_sync(&priv->scan_work); | ||
141 | if (priv->scan_req) { | ||
142 | cfg80211_scan_done(priv->scan_req, false); | ||
143 | priv->scan_req = NULL; | ||
144 | } | ||
138 | 145 | ||
139 | lbs_deb_leave(LBS_DEB_NET); | 146 | lbs_deb_leave(LBS_DEB_NET); |
140 | return 0; | 147 | return 0; |