aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-25 10:33:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:45 -0400
commit15db0b7fd872b0312033666d3a82e1214a227ec0 (patch)
tree0c853f69292d085fac68e0cf5098b484fde9d13c /net/mac80211/iface.c
parent6bd5f5208fac04d00325b458355e4a4abda76595 (diff)
mac80211: fix scan cancel on ifdown
When an interface is taken down while a scan is pending -- i.e. a scan request was accepted but not yet acted upon due to other work being in progress -- we currently do not properly cancel that scan and end up getting stuck. Fix this by doing better checks when an interface is taken down. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index d134bd79972f..f6005adcbf90 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -497,30 +497,8 @@ static int ieee80211_stop(struct net_device *dev)
497 } 497 }
498 /* fall through */ 498 /* fall through */
499 default: 499 default:
500 if (local->scan_sdata == sdata) { 500 if (local->scan_sdata == sdata)
501 if (!local->ops->hw_scan) 501 ieee80211_scan_cancel(local);
502 cancel_delayed_work_sync(&local->scan_work);
503 /*
504 * The software scan can no longer run now, so we can
505 * clear out the scan_sdata reference. However, the
506 * hardware scan may still be running. The complete
507 * function must be prepared to handle a NULL value.
508 */
509 local->scan_sdata = NULL;
510 /*
511 * The memory barrier guarantees that another CPU
512 * that is hardware-scanning will now see the fact
513 * that this interface is gone.
514 */
515 smp_mb();
516 /*
517 * If software scanning, complete the scan but since
518 * the scan_sdata is NULL already don't send out a
519 * scan event to userspace -- the scan is incomplete.
520 */
521 if (test_bit(SCAN_SW_SCANNING, &local->scanning))
522 ieee80211_scan_completed(&local->hw, true);
523 }
524 502
525 /* 503 /*
526 * Disable beaconing for AP and mesh, IBSS can't 504 * Disable beaconing for AP and mesh, IBSS can't