diff options
author | Daniel Drake <dsd@gentoo.org> | 2006-04-30 17:09:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-05-05 16:55:22 -0400 |
commit | d57336e3f2dd7c2d1fbe4a8323029869fb6e1f00 (patch) | |
tree | 5724c4017f744df284fb9f18e5b9c8a8bcb7fbcf /net/ieee80211/softmac/ieee80211softmac_module.c | |
parent | 995c99268e0b12eb3c8939211ba5368dd92d98d9 (diff) |
[PATCH] softmac: make non-operational after being stopped
zd1211 with softmac and wpa_supplicant revealed an issue with softmac
and the use of workqueues. Some of the work functions actually
reschedule themselves, so this meant that there could still be
pending work after flush_scheduled_work() had been called during
ieee80211softmac_stop().
This patch introduces a "running" flag which is used to ensure that
rescheduling does not happen in this situation.
I also used this flag to ensure that softmac's hooks into ieee80211 are
non-operational once the stop operation has been started. This simply
makes softmac a little more robust, because I could crash it easily
by receiving frames in the short timeframe after shutting down softmac
and before turning off the ZD1211 radio. (ZD1211 is now fixed as well!)
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_module.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_module.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c index be83bdc1644a..6252be2c0db9 100644 --- a/net/ieee80211/softmac/ieee80211softmac_module.c +++ b/net/ieee80211/softmac/ieee80211softmac_module.c | |||
@@ -89,6 +89,8 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) | |||
89 | ieee80211softmac_wait_for_scan(sm); | 89 | ieee80211softmac_wait_for_scan(sm); |
90 | 90 | ||
91 | spin_lock_irqsave(&sm->lock, flags); | 91 | spin_lock_irqsave(&sm->lock, flags); |
92 | sm->running = 0; | ||
93 | |||
92 | /* Free all pending assoc work items */ | 94 | /* Free all pending assoc work items */ |
93 | cancel_delayed_work(&sm->associnfo.work); | 95 | cancel_delayed_work(&sm->associnfo.work); |
94 | 96 | ||
@@ -204,6 +206,8 @@ void ieee80211softmac_start(struct net_device *dev) | |||
204 | assert(0); | 206 | assert(0); |
205 | if (mac->txrates_change) | 207 | if (mac->txrates_change) |
206 | mac->txrates_change(dev, change, &oldrates); | 208 | mac->txrates_change(dev, change, &oldrates); |
209 | |||
210 | mac->running = 1; | ||
207 | } | 211 | } |
208 | EXPORT_SYMBOL_GPL(ieee80211softmac_start); | 212 | EXPORT_SYMBOL_GPL(ieee80211softmac_start); |
209 | 213 | ||