Permalink
Browse files

nl80211: report stopped sched scan only after driver does (INTERNAL)

Report NL80211_CMD_SCHED_SCAN_STOPPED and change internal
states in cfg80211 only after the driver reports that
sched scan was actually stopped.

Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information...
1 parent 329e192 commit 3d19e5c2e4ebb1b8e9db43c2d79b5a97e3361d09 @eyalsh eyalsh committed with ariknem Dec 20, 2011
Showing with 8 additions and 9 deletions.
  1. +8 −9 net/wireless/scan.c
View
@@ -133,6 +133,7 @@ EXPORT_SYMBOL(cfg80211_sched_scan_stopped);
int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
bool driver_initiated)
{
+ int err = 0;
struct net_device *dev;
lockdep_assert_held(&rdev->sched_scan_mtx);
@@ -143,17 +144,15 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
dev = rdev->sched_scan_req->dev;
if (!driver_initiated) {
- int err = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
- if (err)
- return err;
+ err = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
+ } else {
+ nl80211_send_sched_scan(rdev, dev,
+ NL80211_CMD_SCHED_SCAN_STOPPED);
+ kfree(rdev->sched_scan_req);
+ rdev->sched_scan_req = NULL;
}
- nl80211_send_sched_scan(rdev, dev, NL80211_CMD_SCHED_SCAN_STOPPED);
-
- kfree(rdev->sched_scan_req);
- rdev->sched_scan_req = NULL;
-
- return 0;
+ return err;
}
static void bss_release(struct kref *ref)

0 comments on commit 3d19e5c

Please sign in to comment.