From patchwork Mon Dec 2 08:05:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3264221 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 9EFBC9F373 for ; Mon, 2 Dec 2013 08:06:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88CB420295 for ; Mon, 2 Dec 2013 08:06:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58FC520265 for ; Mon, 2 Dec 2013 08:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561Ab3LBIG3 (ORCPT ); Mon, 2 Dec 2013 03:06:29 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:39982 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498Ab3LBIG3 (ORCPT ); Mon, 2 Dec 2013 03:06:29 -0500 Received: by mail-pd0-f179.google.com with SMTP id r10so17699721pdi.10 for ; Mon, 02 Dec 2013 00:06:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=0u98VhwmtEj21xDoB6N5j1sfvQIrSJHQrE0I5Suo5hY=; b=PNY6Agwm7xtK346c/eHknFVuvzF2P85IXXUWzzlKw70qLMfr2dQmJr7kFpbyExvPut qgAtN8qOoKd8Svhi81MTwiflvhQL93mT/zAKVzJim+bLm6fuL5t/7oeHeTP2uDg+XW87 wmKU/ig6RVBdFJWiwzjhnUXIeGQxCns8Mh3qg/tyqvjNSu+gK4plkOjpNdtax53cpY17 MDGByEP7P/tzngiEhmZ7HZoUoSk5N3wN5wQf9nuUbIzrVKpvKIMiGP6gWxn2bzMJimu3 RPyEIVWkxOzCVJfCX9PkhCPkrk2XrhSrt1Z9/QhCBwYcqx6VdIrVCFxrE+MatUsGqMyv 4aMA== X-Received: by 10.68.242.163 with SMTP id wr3mr29229770pbc.84.1385971588514; Mon, 02 Dec 2013 00:06:28 -0800 (PST) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id gf5sm120553613pbc.22.2013.12.02.00.06.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 00:06:27 -0800 (PST) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, linville@tuxdriver.com, devel@lists.open80211s.org, distro11s@cozybit.com, Chun-Yeow Yeoh Subject: [PATCH] nl80211: allow the use of DFS channel in mesh Date: Mon, 2 Dec 2013 16:05:49 +0800 Message-Id: <1385971550-4892-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 This permits the use of DFS channel once the CAC is conducted and no radar is detected. Signed-off-by: Chun-Yeow Yeoh --- net/wireless/mesh.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index b0e1869..9c7a11a 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c @@ -99,6 +99,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, const struct mesh_config *conf) { struct wireless_dev *wdev = dev->ieee80211_ptr; + u8 radar_detect_width = 0; int err; BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); @@ -177,8 +178,16 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) return -EINVAL; - err = cfg80211_can_use_chan(rdev, wdev, setup->chandef.chan, - CHAN_MODE_SHARED); + err = cfg80211_chandef_dfs_required(wdev->wiphy, &setup->chandef); + if (err < 0) + return err; + if (err) + radar_detect_width = BIT(setup->chandef.width); + + err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, + setup->chandef.chan, + CHAN_MODE_SHARED, + radar_detect_width); if (err) return err;