aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/softmac/ieee80211softmac_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_scan.c')
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_scan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_scan.c b/net/ieee80211/softmac/ieee80211softmac_scan.c
index d31cf77498c4..a8326076581a 100644
--- a/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ b/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -91,12 +91,14 @@ ieee80211softmac_wait_for_scan(struct ieee80211softmac_device *sm)
91 91
92 92
93/* internal scanning implementation follows */ 93/* internal scanning implementation follows */
94void ieee80211softmac_scan(void *d) 94void ieee80211softmac_scan(struct work_struct *work)
95{ 95{
96 int invalid_channel; 96 int invalid_channel;
97 u8 current_channel_idx; 97 u8 current_channel_idx;
98 struct ieee80211softmac_device *sm = (struct ieee80211softmac_device *)d; 98 struct ieee80211softmac_scaninfo *si =
99 struct ieee80211softmac_scaninfo *si = sm->scaninfo; 99 container_of(work, struct ieee80211softmac_scaninfo,
100 softmac_scan.work);
101 struct ieee80211softmac_device *sm = si->mac;
100 unsigned long flags; 102 unsigned long flags;
101 103
102 while (!(si->stop) && (si->current_channel_idx < si->number_channels)) { 104 while (!(si->stop) && (si->current_channel_idx < si->number_channels)) {
@@ -146,7 +148,8 @@ static inline struct ieee80211softmac_scaninfo *allocate_scaninfo(struct ieee802
146 struct ieee80211softmac_scaninfo *info = kmalloc(sizeof(struct ieee80211softmac_scaninfo), GFP_ATOMIC); 148 struct ieee80211softmac_scaninfo *info = kmalloc(sizeof(struct ieee80211softmac_scaninfo), GFP_ATOMIC);
147 if (unlikely(!info)) 149 if (unlikely(!info))
148 return NULL; 150 return NULL;
149 INIT_WORK(&info->softmac_scan, ieee80211softmac_scan, mac); 151 INIT_DELAYED_WORK(&info->softmac_scan, ieee80211softmac_scan);
152 info->mac = mac;
150 init_completion(&info->finished); 153 init_completion(&info->finished);
151 return info; 154 return info;
152} 155}
@@ -189,7 +192,7 @@ int ieee80211softmac_start_scan_implementation(struct net_device *dev)
189 sm->scaninfo->started = 1; 192 sm->scaninfo->started = 1;
190 sm->scaninfo->stop = 0; 193 sm->scaninfo->stop = 0;
191 INIT_COMPLETION(sm->scaninfo->finished); 194 INIT_COMPLETION(sm->scaninfo->finished);
192 schedule_work(&sm->scaninfo->softmac_scan); 195 schedule_delayed_work(&sm->scaninfo->softmac_scan, 0);
193 spin_unlock_irqrestore(&sm->lock, flags); 196 spin_unlock_irqrestore(&sm->lock, flags);
194 return 0; 197 return 0;
195} 198}