diff options
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_wx.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c index b559aa9b5507..00f0d4f71897 100644 --- a/net/ieee80211/softmac/ieee80211softmac_wx.c +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c | |||
@@ -41,13 +41,23 @@ ieee80211softmac_wx_trigger_scan(struct net_device *net_dev, | |||
41 | EXPORT_SYMBOL_GPL(ieee80211softmac_wx_trigger_scan); | 41 | EXPORT_SYMBOL_GPL(ieee80211softmac_wx_trigger_scan); |
42 | 42 | ||
43 | 43 | ||
44 | /* if we're still scanning, return -EAGAIN so that userspace tools | ||
45 | * can get the complete scan results, otherwise return 0. */ | ||
44 | int | 46 | int |
45 | ieee80211softmac_wx_get_scan_results(struct net_device *net_dev, | 47 | ieee80211softmac_wx_get_scan_results(struct net_device *net_dev, |
46 | struct iw_request_info *info, | 48 | struct iw_request_info *info, |
47 | union iwreq_data *data, | 49 | union iwreq_data *data, |
48 | char *extra) | 50 | char *extra) |
49 | { | 51 | { |
52 | unsigned long flags; | ||
50 | struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); | 53 | struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); |
54 | |||
55 | spin_lock_irqsave(&sm->lock, flags); | ||
56 | if (sm->scanning) { | ||
57 | spin_unlock_irqrestore(&sm->lock, flags); | ||
58 | return -EAGAIN; | ||
59 | } | ||
60 | spin_unlock_irqrestore(&sm->lock, flags); | ||
51 | return ieee80211_wx_get_scan(sm->ieee, info, data, extra); | 61 | return ieee80211_wx_get_scan(sm->ieee, info, data, extra); |
52 | } | 62 | } |
53 | EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results); | 63 | EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results); |