From patchwork Wed Apr 30 13:14:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 4093851 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E31ABFF02 for ; Wed, 30 Apr 2014 13:14:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7F88201F4 for ; Wed, 30 Apr 2014 13:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECF3320176 for ; Wed, 30 Apr 2014 13:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933694AbaD3NOe (ORCPT ); Wed, 30 Apr 2014 09:14:34 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:54956 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933454AbaD3NOe (ORCPT ); Wed, 30 Apr 2014 09:14:34 -0400 Received: by mail-wg0-f48.google.com with SMTP id b13so1694085wgh.7 for ; Wed, 30 Apr 2014 06:14:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xfpjcc6vMTXnW3S5gMBYuy/Ef7zU9S2xMUiR7qgLZCw=; b=XD60NAL+afdykfxeKJK1vKWn3vnRpIYx9M48ApTJ3FagxIZxuzfAvXlkEyA8VNZN0d JugZylYKFMBeq4LXJmYej6Errthr3R1x6tWfsrSh7nyTNjCkcjsQYuHzMSlnIAGcEE9P QKYXDWHO6Hurx9/czxoFmUTvAnLzRNf4MWGcu/8GOeBG1mMMC6xNQAnyYELCFnj5u0an BdU+5veHrImbdM+hy75AfYOcQDncYblPBpIpGmEFu+l1D9D4ex/gR3pTr5tm1OUXoAoJ 8HlVlzYzkgeb7a/46yWpPxJLA+lPJAwv9N0qf4Lzj47vf7JzQr8VL4AlzTZrSjfmSotb vP5Q== X-Gm-Message-State: ALoCoQkikHvRWGGI7ICPU/gAHGt5xhXLkRhfiqRc/aSDOebXIzcGMajWO6IayOMQ7HwGACrhmdag X-Received: by 10.194.60.114 with SMTP id g18mr2323441wjr.61.1398863672985; Wed, 30 Apr 2014 06:14:32 -0700 (PDT) Received: from muse.amr.corp.intel.com (46-116-82-98.bb.netvision.net.il. [46.116.82.98]) by mx.google.com with ESMTPSA id q9sm26552426wjo.3.2014.04.30.06.14.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 06:14:32 -0700 (PDT) From: Eliad Peller To: Johannes Berg Cc: Subject: [PATCH 1/2] cfg80211: add cfg80211_sched_scan_stopped_rtnl Date: Wed, 30 Apr 2014 16:14:23 +0300 Message-Id: <1398863664-20193-1-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.2.229.g4448466.dirty Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add locked-version for cfg80211_sched_scan_stopped. This is used for some users that might want to call it when rtnl is already locked. Fixes: d43c6b6 ("mac80211: reschedule sched scan after HW restart") Cc: stable@vger.kernel.org (3.14+) Signed-off-by: Eliad Peller --- include/net/cfg80211.h | 12 ++++++++++++ net/wireless/scan.c | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7eae46c..f2c3186 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -3692,6 +3692,18 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy); void cfg80211_sched_scan_stopped(struct wiphy *wiphy); /** + * cfg80211_sched_scan_stopped_rtnl - notify that the scheduled scan has stopped + * + * @wiphy: the wiphy on which the scheduled scan stopped + * + * The driver can call this function to inform cfg80211 that the + * scheduled scan had to be stopped, for whatever reason. The driver + * is then called back via the sched_scan_stop operation when done. + * This function should be called with rtnl locked. + */ +void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy); + +/** * cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame * * @wiphy: the wiphy reporting the BSS diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 0f5da18..c0abd75 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -284,18 +284,27 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy) } EXPORT_SYMBOL(cfg80211_sched_scan_results); -void cfg80211_sched_scan_stopped(struct wiphy *wiphy) +void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy) { struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); + ASSERT_RTNL(); + trace_cfg80211_sched_scan_stopped(wiphy); - rtnl_lock(); __cfg80211_stop_sched_scan(rdev, true); +} +EXPORT_SYMBOL(cfg80211_sched_scan_stopped_rtnl); + +void cfg80211_sched_scan_stopped(struct wiphy *wiphy) +{ + rtnl_lock(); + cfg80211_sched_scan_stopped_rtnl(wiphy); rtnl_unlock(); } EXPORT_SYMBOL(cfg80211_sched_scan_stopped); + int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev, bool driver_initiated) {