From patchwork Fri Oct 1 12:05:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 223792 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o91C4g6Z014143 for ; Fri, 1 Oct 2010 12:04:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932273Ab0JAMEa (ORCPT ); Fri, 1 Oct 2010 08:04:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29547 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219Ab0JAME1 (ORCPT ); Fri, 1 Oct 2010 08:04:27 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o91C4846019919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Oct 2010 08:04:08 -0400 Received: from localhost (dhcp-26-173.brq.redhat.com [10.34.26.173]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o91C47Q6017812; Fri, 1 Oct 2010 08:04:08 -0400 From: Stanislaw Gruszka To: Johannes Berg , Wey-Yi Guy Cc: "John W. Linville" , linux-wireless@vger.kernel.org, Stanislaw Gruszka Subject: [PATCH 4/6] mac80211: assure we also cancel deferred scan request Date: Fri, 1 Oct 2010 14:05:30 +0200 Message-Id: <1285934732-16087-4-git-send-email-sgruszka@redhat.com> In-Reply-To: <1285934732-16087-1-git-send-email-sgruszka@redhat.com> References: <1285934732-16087-1-git-send-email-sgruszka@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Oct 2010 12:04:48 +0000 (UTC) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 494dba1..8ba09ff 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -304,8 +304,7 @@ static void ieee80211_restart_work(struct work_struct *work) mutex_unlock(&local->mtx); rtnl_lock(); - if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning))) - ieee80211_scan_cancel(local); + ieee80211_scan_cancel(local); ieee80211_reconfig(local); rtnl_unlock(); } diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index ce671df..d287fde 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c @@ -12,8 +12,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw) struct ieee80211_sub_if_data *sdata; struct sta_info *sta; - if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning))) - ieee80211_scan_cancel(local); + ieee80211_scan_cancel(local); ieee80211_stop_queues_by_reason(hw, IEEE80211_QUEUE_STOP_REASON_SUSPEND); diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 44deb05..2e9a70c 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -799,7 +799,7 @@ void ieee80211_scan_cancel(struct ieee80211_local *local) */ mutex_lock(&local->mtx); if (test_bit(SCAN_SW_SCANNING, &local->scanning) || - (!local->scanning && local->scan_req)) + (!test_bit(SCAN_HW_SCANNING, &local->scanning) && local->scan_req)) finish = __ieee80211_scan_completed(&local->hw, true, false); mutex_unlock(&local->mtx);