diff options
author | Eliad Peller <eliad@wizery.com> | 2013-12-05 04:21:27 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-12-05 11:16:06 -0500 |
commit | 8bd2a2489971d3bcdbae6d9d9e9414f04cb0543b (patch) | |
tree | 74035f4dbec167d1d8c55fcce60e71e65453c824 /net/mac80211/scan.c | |
parent | 24d584d70e478bf2e815135e8bf60f72685046f7 (diff) |
mac80211: determine completed scan type by defined ops
In some cases, determining the completed scan type was
done by testing the SCAN_HW_SCANNING flag.
However, this doesn't take care for the case in which
the hw scan was requested, but hasn't started yet (e.g.
due to active remain_on_channel).
Replace this test by checking whether ops->hw_scan is
defined.
This solves the following warning:
WARNING: CPU: 0 PID: 3552 at net/mac80211/offchannel.c:156 __ieee80211_scan_completed+0x1b4/0x2dc [mac80211]()
[<c001cd38>] (unwind_backtrace+0x0/0xf0)
[<c00181d0>] (show_stack+0x10/0x14)
[<c05c0d8c>] (dump_stack+0x78/0x94)
[<c0047c08>] (warn_slowpath_common+0x68/0x8c)
[<c0047c48>] (warn_slowpath_null+0x1c/0x24)
[<bf4d4504>] (__ieee80211_scan_completed+0x1b4/0x2dc [mac80211])
[<bf4d5a74>] (ieee80211_scan_cancel+0xe8/0x190 [mac80211])
[<bf4df970>] (ieee80211_do_stop+0x63c/0x79c [mac80211])
[<bf4dfae0>] (ieee80211_stop+0x10/0x18 [mac80211])
[<c0504d84>] (__dev_close_many+0x84/0xcc)
[<c0504df4>] (__dev_close+0x28/0x3c)
[<c0509708>] (__dev_change_flags+0x78/0x144)
[<c0509854>] (dev_change_flags+0x10/0x48)
[<c055fe3c>] (devinet_ioctl+0x614/0x6d0)
[<c04f22a0>] (sock_ioctl+0x5c/0x2a4)
[<c0124eb4>] (do_vfs_ioctl+0x7c/0x5d8)
[<c012547c>] (SyS_ioctl+0x6c/0x7c)
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index b12bb72a5f37..78e968a41f03 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -271,10 +271,10 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) | |||
271 | return true; | 271 | return true; |
272 | } | 272 | } |
273 | 273 | ||
274 | static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, | 274 | static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) |
275 | bool was_hw_scan) | ||
276 | { | 275 | { |
277 | struct ieee80211_local *local = hw_to_local(hw); | 276 | struct ieee80211_local *local = hw_to_local(hw); |
277 | bool hw_scan = local->ops->hw_scan; | ||
278 | 278 | ||
279 | lockdep_assert_held(&local->mtx); | 279 | lockdep_assert_held(&local->mtx); |
280 | 280 | ||
@@ -290,7 +290,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, | |||
290 | if (WARN_ON(!local->scan_req)) | 290 | if (WARN_ON(!local->scan_req)) |
291 | return; | 291 | return; |
292 | 292 | ||
293 | if (was_hw_scan && !aborted && ieee80211_prep_hw_scan(local)) { | 293 | if (hw_scan && !aborted && ieee80211_prep_hw_scan(local)) { |
294 | int rc; | 294 | int rc; |
295 | 295 | ||
296 | rc = drv_hw_scan(local, | 296 | rc = drv_hw_scan(local, |
@@ -316,7 +316,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, | |||
316 | /* Set power back to normal operating levels. */ | 316 | /* Set power back to normal operating levels. */ |
317 | ieee80211_hw_config(local, 0); | 317 | ieee80211_hw_config(local, 0); |
318 | 318 | ||
319 | if (!was_hw_scan) { | 319 | if (!hw_scan) { |
320 | ieee80211_configure_filter(local); | 320 | ieee80211_configure_filter(local); |
321 | drv_sw_scan_complete(local); | 321 | drv_sw_scan_complete(local); |
322 | ieee80211_offchannel_return(local); | 322 | ieee80211_offchannel_return(local); |
@@ -747,7 +747,7 @@ void ieee80211_scan_work(struct work_struct *work) | |||
747 | container_of(work, struct ieee80211_local, scan_work.work); | 747 | container_of(work, struct ieee80211_local, scan_work.work); |
748 | struct ieee80211_sub_if_data *sdata; | 748 | struct ieee80211_sub_if_data *sdata; |
749 | unsigned long next_delay = 0; | 749 | unsigned long next_delay = 0; |
750 | bool aborted, hw_scan; | 750 | bool aborted; |
751 | 751 | ||
752 | mutex_lock(&local->mtx); | 752 | mutex_lock(&local->mtx); |
753 | 753 | ||
@@ -826,8 +826,7 @@ void ieee80211_scan_work(struct work_struct *work) | |||
826 | goto out; | 826 | goto out; |
827 | 827 | ||
828 | out_complete: | 828 | out_complete: |
829 | hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning); | 829 | __ieee80211_scan_completed(&local->hw, aborted); |
830 | __ieee80211_scan_completed(&local->hw, aborted, hw_scan); | ||
831 | out: | 830 | out: |
832 | mutex_unlock(&local->mtx); | 831 | mutex_unlock(&local->mtx); |
833 | } | 832 | } |
@@ -965,7 +964,7 @@ void ieee80211_scan_cancel(struct ieee80211_local *local) | |||
965 | */ | 964 | */ |
966 | cancel_delayed_work(&local->scan_work); | 965 | cancel_delayed_work(&local->scan_work); |
967 | /* and clean up */ | 966 | /* and clean up */ |
968 | __ieee80211_scan_completed(&local->hw, true, false); | 967 | __ieee80211_scan_completed(&local->hw, true); |
969 | out: | 968 | out: |
970 | mutex_unlock(&local->mtx); | 969 | mutex_unlock(&local->mtx); |
971 | } | 970 | } |