From patchwork Wed Feb 12 18:54:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 3639961 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 13B409F369 for ; Wed, 12 Feb 2014 18:54:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30D2F201F2 for ; Wed, 12 Feb 2014 18:54:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 464DB201ED for ; Wed, 12 Feb 2014 18:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753994AbaBLSym (ORCPT ); Wed, 12 Feb 2014 13:54:42 -0500 Received: from mail-ea0-f182.google.com ([209.85.215.182]:52443 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753385AbaBLSyk (ORCPT ); Wed, 12 Feb 2014 13:54:40 -0500 Received: by mail-ea0-f182.google.com with SMTP id r15so4645659ead.13 for ; Wed, 12 Feb 2014 10:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JwMbFxlSFL1R8gTZA/1YnIYoJPIFSKerbgmRyJNym/k=; b=1rh2Sy3UlFN+7gd6NiylT73nEV1Ar2Ml+ETUXTextFxbHeebYCcRCUTi5ie4rZk0OY vsVD8Apr1ifnlO6NcuVVYmwH3GtCOuQgsiPjBD5AQDU+GM+Vd5TOSjUd3E2vfxKN1G/+ 01Tf7SQ6XKQGrYhuisVS+DrN+RT3XH++puQOo= 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:in-reply-to :references; bh=JwMbFxlSFL1R8gTZA/1YnIYoJPIFSKerbgmRyJNym/k=; b=BDdJNE+LbDLPyGUXOiASfpZZQijo10EBz/037MwAF/fRqIuR+sQX4DkBt7/jRlm6yI NDjk9iZtQkGw6QimDOczrx/HSZNOlfyg8ARKNFToOUyQ034Pm6a5S4vS9RxL1hMem3p+ ojcphN4S3LUP6jc7rteU+WyBxDdbfaFS3g+bgMwdtytRqka1UwSCAFsruaMeSE/2Xqwj LeC6g/EA6J/RYZ4vDsk6yvYpTfRzTBXp5e3gXMn4ekAS7GEz60E3Z9fvbwP/IIIio3vQ D5uJwX0RnBQlkgji0UAvY09iqKxj/J9p0W9fMexxbvg5UCQUqxzJpa1aHpbOOsDWM+ZW NpZA== X-Gm-Message-State: ALoCoQmen8zhfGUh3jOYEZqCIE2bbbPo+SCCNq1r7/GQsFO+mje946j2tjRXAQF3HTfbsk9HPWzI7rjm743z0hRN459LR4IR8wQtU3KcGg4QfZM2ztYV/Lw= X-Received: by 10.14.110.198 with SMTP id u46mr5863102eeg.20.1392231279563; Wed, 12 Feb 2014 10:54:39 -0800 (PST) Received: from localhost.localdomain (host-62-141-194-198.swidnica.mm.pl. [62.141.194.198]) by mx.google.com with ESMTPSA id x2sm84113214eeo.8.2014.02.12.10.54.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 10:54:38 -0800 (PST) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, mcgrof@do-not-panic.com, linville@tuxdriver.com, Janusz Dziedzic Subject: [PATCH 3/4] cfg80211/mac80211: DFS pass CAC time as a parameter Date: Wed, 12 Feb 2014 19:54:22 +0100 Message-Id: <1392231266-28479-3-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392231266-28479-1-git-send-email-janusz.dziedzic@tieto.com> References: <1392231266-28479-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.com 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Send Channel Availability Check time as a parameter of start_radar_detection() callback. We will get this time from regulatory database. Signed-off-by: Janusz Dziedzic --- include/net/cfg80211.h | 3 ++- net/mac80211/cfg.c | 8 ++++---- net/wireless/nl80211.c | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index e1ea2ed..14e2671 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -2499,7 +2499,8 @@ struct cfg80211_ops { int (*start_radar_detection)(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_chan_def *chandef); + struct cfg80211_chan_def *chandef, + u32 cac_time_ms); int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_update_ft_ies_params *ftie); int (*crit_proto_start)(struct wiphy *wiphy, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 7f01f2ae..f504205 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2912,11 +2912,11 @@ static int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy, static int ieee80211_start_radar_detection(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_chan_def *chandef) + struct cfg80211_chan_def *chandef, + u32 cac_time_ms) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; - unsigned long timeout; int err; mutex_lock(&local->mtx); @@ -2935,9 +2935,9 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy, if (err) goto out_unlock; - timeout = msecs_to_jiffies(IEEE80211_DFS_MIN_CAC_TIME_MS); ieee80211_queue_delayed_work(&sdata->local->hw, - &sdata->dfs_cac_timer_work, timeout); + &sdata->dfs_cac_timer_work, + msecs_to_jiffies(cac_time_ms)); out_unlock: mutex_unlock(&local->mtx); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0bf69da..4a4c988 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5811,7 +5811,8 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, if (err) return err; - err = rdev->ops->start_radar_detection(&rdev->wiphy, dev, &chandef); + err = rdev->ops->start_radar_detection(&rdev->wiphy, dev, &chandef, + IEEE80211_DFS_MIN_CAC_TIME_MS); if (!err) { wdev->chandef = chandef; wdev->cac_started = true;