aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2006-01-05 19:43:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-03-22 22:16:52 -0500
commit5c4df6da580b9317dc0856e235232b95cbc8251c (patch)
treedf82db654b024cd7204f182cbc40101681e012c0
parent45867e6a55aee984d69ce8f93a87e26d32d470dc (diff)
[PATCH] softmac: convert to use global workqueue
Convert softmac to use global workqueue instead of private one... Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/ieee80211softmac.h3
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c4
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_auth.c6
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_event.c2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_module.c7
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_scan.c4
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c6
7 files changed, 12 insertions, 20 deletions
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 0b5f2df29f02..7264bd87c7d7 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -177,9 +177,6 @@ struct ieee80211softmac_device {
177 u8 scanning:1, /* protects scanning from being done multiple times at once */ 177 u8 scanning:1, /* protects scanning from being done multiple times at once */
178 associated:1; 178 associated:1;
179 179
180 /* workquere for scannning, ... */
181 struct workqueue_struct *workqueue;
182
183 struct ieee80211softmac_scaninfo *scaninfo; 180 struct ieee80211softmac_scaninfo *scaninfo;
184 struct ieee80211softmac_assoc_info associnfo; 181 struct ieee80211softmac_assoc_info associnfo;
185 182
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index d491005d6cfd..98487448f2d3 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -29,7 +29,7 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft
29 29
30 /* Set a timer for timeout */ 30 /* Set a timer for timeout */
31 /* FIXME: make timeout configurable */ 31 /* FIXME: make timeout configurable */
32 queue_delayed_work(mac->workqueue, &mac->associnfo.timeout, 5 * HZ); 32 schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
33} 33}
34 34
35void 35void
@@ -324,7 +324,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
324 network->authenticated = 0; 324 network->authenticated = 0;
325 /* we don't want to do this more than once ... */ 325 /* we don't want to do this more than once ... */
326 network->auth_desynced_once = 1; 326 network->auth_desynced_once = 1;
327 queue_work(mac->workqueue, &mac->associnfo.work); 327 schedule_work(&mac->associnfo.work);
328 break; 328 break;
329 } 329 }
330 default: 330 default:
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 286f0718eb7e..5a773528110f 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -36,7 +36,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
36 36
37 /* add to list */ 37 /* add to list */
38 list_add_tail(&auth->list, &mac->auth_queue); 38 list_add_tail(&auth->list, &mac->auth_queue);
39 queue_work(mac->workqueue, &auth->work); 39 schedule_work(&auth->work);
40 spin_unlock_irqrestore(&mac->lock, flags); 40 spin_unlock_irqrestore(&mac->lock, flags);
41 41
42 return 0; 42 return 0;
@@ -67,7 +67,7 @@ ieee80211softmac_auth_queue(void *data)
67 net->authenticated = 0; 67 net->authenticated = 0;
68 net->authenticating = 1; 68 net->authenticating = 1;
69 /* add a timeout call so we eventually give up waiting for an auth reply */ 69 /* add a timeout call so we eventually give up waiting for an auth reply */
70 queue_delayed_work(mac->workqueue, &auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT); 70 schedule_delayed_work(&auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT);
71 auth->retry--; 71 auth->retry--;
72 spin_unlock_irqrestore(&mac->lock, flags); 72 spin_unlock_irqrestore(&mac->lock, flags);
73 if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state)) 73 if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state))
@@ -279,7 +279,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
279 kfree(net); 279 kfree(net);
280 280
281 /* let's try to re-associate */ 281 /* let's try to re-associate */
282 queue_work(mac->workqueue, &mac->associnfo.work); 282 schedule_work(&mac->associnfo.work);
283 spin_unlock_irqrestore(&mac->lock, flags); 283 spin_unlock_irqrestore(&mac->lock, flags);
284} 284}
285 285
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c
index 0d0a8327252f..b640a58a2687 100644
--- a/net/ieee80211/softmac/ieee80211softmac_event.c
+++ b/net/ieee80211/softmac/ieee80211softmac_event.c
@@ -118,7 +118,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
118 if ((eventptr->event_type == event || eventptr->event_type == -1) 118 if ((eventptr->event_type == event || eventptr->event_type == -1)
119 && (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) { 119 && (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) {
120 list_del(&eventptr->list); 120 list_del(&eventptr->list);
121 queue_work(mac->workqueue, &eventptr->work); 121 schedule_work(&eventptr->work);
122 } 122 }
123 } 123 }
124} 124}
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c
index 1244a659cd83..79ef959a2c11 100644
--- a/net/ieee80211/softmac/ieee80211softmac_module.c
+++ b/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -22,10 +22,6 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
22 * (once they're written) 22 * (once they're written)
23 */ 23 */
24 24
25 softmac->workqueue = create_workqueue("80211softmac");
26 if (!softmac->workqueue)
27 goto err_free_ieee80211;
28
29 INIT_LIST_HEAD(&softmac->auth_queue); 25 INIT_LIST_HEAD(&softmac->auth_queue);
30 INIT_LIST_HEAD(&softmac->network_list); 26 INIT_LIST_HEAD(&softmac->network_list);
31 INIT_LIST_HEAD(&softmac->events); 27 INIT_LIST_HEAD(&softmac->events);
@@ -90,7 +86,7 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm)
90 cancel_delayed_work(&eventptr->work); 86 cancel_delayed_work(&eventptr->work);
91 87
92 spin_unlock_irqrestore(&sm->lock, flags); 88 spin_unlock_irqrestore(&sm->lock, flags);
93 flush_workqueue(sm->workqueue); 89 flush_scheduled_work();
94 90
95 // now we should be save and no longer need locking... 91 // now we should be save and no longer need locking...
96 spin_lock_irqsave(&sm->lock, flags); 92 spin_lock_irqsave(&sm->lock, flags);
@@ -121,7 +117,6 @@ void free_ieee80211softmac(struct net_device *dev)
121{ 117{
122 struct ieee80211softmac_device *sm = ieee80211_priv(dev); 118 struct ieee80211softmac_device *sm = ieee80211_priv(dev);
123 ieee80211softmac_clear_pending_work(sm); 119 ieee80211softmac_clear_pending_work(sm);
124 destroy_workqueue(sm->workqueue);
125 kfree(sm->scaninfo); 120 kfree(sm->scaninfo);
126 kfree(sm->wpa.IE); 121 kfree(sm->wpa.IE);
127 free_ieee80211(dev); 122 free_ieee80211(dev);
diff --git a/net/ieee80211/softmac/ieee80211softmac_scan.c b/net/ieee80211/softmac/ieee80211softmac_scan.c
index b4b44fa8727d..1a1eda434cfd 100644
--- a/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ b/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -93,7 +93,7 @@ void ieee80211softmac_scan(void *d)
93 // TODO: is this if correct, or should we do this only if scanning from assoc request? 93 // TODO: is this if correct, or should we do this only if scanning from assoc request?
94 if (sm->associnfo.req_essid.len) 94 if (sm->associnfo.req_essid.len)
95 ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0); 95 ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0);
96 queue_delayed_work(sm->workqueue, &si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY); 96 schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY);
97 return; 97 return;
98 } else { 98 } else {
99 dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel); 99 dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel);
@@ -158,7 +158,7 @@ int ieee80211softmac_start_scan_implementation(struct net_device *dev)
158 sm->scaninfo->current_channel_idx = 0; 158 sm->scaninfo->current_channel_idx = 0;
159 sm->scaninfo->started = 1; 159 sm->scaninfo->started = 1;
160 INIT_COMPLETION(sm->scaninfo->finished); 160 INIT_COMPLETION(sm->scaninfo->finished);
161 queue_work(sm->workqueue, &sm->scaninfo->softmac_scan); 161 schedule_work(&sm->scaninfo->softmac_scan);
162 spin_unlock_irqrestore(&sm->lock, flags); 162 spin_unlock_irqrestore(&sm->lock, flags);
163 return 0; 163 return 0;
164} 164}
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index bae5fcc11967..ca11737de6f5 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -58,7 +58,7 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
58 sm->associnfo.req_essid.len = length; 58 sm->associnfo.req_essid.len = length;
59 59
60 /* queue lower level code to do work (if necessary) */ 60 /* queue lower level code to do work (if necessary) */
61 queue_work(sm->workqueue, &sm->associnfo.work); 61 schedule_work(&sm->associnfo.work);
62 62
63 spin_unlock_irqrestore(&sm->lock, flags); 63 spin_unlock_irqrestore(&sm->lock, flags);
64 return 0; 64 return 0;
@@ -286,7 +286,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
286 spin_lock_irqsave(&mac->lock, flags); 286 spin_lock_irqsave(&mac->lock, flags);
287 if (!memcmp(any, data->ap_addr.sa_data, ETH_ALEN) || 287 if (!memcmp(any, data->ap_addr.sa_data, ETH_ALEN) ||
288 !memcmp(off, data->ap_addr.sa_data, ETH_ALEN)) { 288 !memcmp(off, data->ap_addr.sa_data, ETH_ALEN)) {
289 queue_work(mac->workqueue, &mac->associnfo.work); 289 schedule_work(&mac->associnfo.work);
290 goto out; 290 goto out;
291 } else { 291 } else {
292 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { 292 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
@@ -299,7 +299,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
299 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN); 299 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN);
300 } 300 }
301 /* queue associate if new bssid or (old one again and not associated) */ 301 /* queue associate if new bssid or (old one again and not associated) */
302 queue_work(mac->workqueue,&mac->associnfo.work); 302 schedule_work(&mac->associnfo.work);
303 } 303 }
304 304
305out: 305out: