mac80211: do not requeue scan work when not needed
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 6 Oct 2010 09:22:11 +0000 (11:22 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Oct 2010 20:30:42 +0000 (16:30 -0400)
When performing hw scan and not abort it, __ieee80211_scan_completed()
is currently called from scan work, so does not need to reschedule work
to call drv_hw_scan().

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/scan.c

index 4dbef714d946a3b034979c50e21252f864901833..9aab921f7ca8d16593c4493cade052307c093b60 100644 (file)
@@ -269,9 +269,9 @@ static bool __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
                return false;
 
        if (was_hw_scan && !aborted && ieee80211_prep_hw_scan(local)) {
-               ieee80211_queue_delayed_work(&local->hw,
-                                            &local->scan_work, 0);
-               return false;
+               int rc = drv_hw_scan(local, local->scan_sdata, local->hw_scan_req);
+               if (rc == 0)
+                       return false;
        }
 
        kfree(local->hw_scan_req);
@@ -656,15 +656,6 @@ void ieee80211_scan_work(struct work_struct *work)
        if (!sdata || !local->scan_req)
                goto out;
 
-       if (local->hw_scan_req) {
-               int rc = drv_hw_scan(local, sdata, local->hw_scan_req);
-               if (rc) {
-                       aborted = true;
-                       goto out_complete;
-               } else
-                       goto out;
-       }
-
        if (local->scan_req && !local->scanning) {
                struct cfg80211_scan_request *req = local->scan_req;
                int rc;