From patchwork Sun Dec 21 16:32:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 5524251 X-Patchwork-Delegate: johannes@sipsolutions.net 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 9D913BEEA8 for ; Sun, 21 Dec 2014 16:32:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD7852011E for ; Sun, 21 Dec 2014 16:32:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B76BE20121 for ; Sun, 21 Dec 2014 16:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751285AbaLUQcd (ORCPT ); Sun, 21 Dec 2014 11:32:33 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:40625 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbaLUQcc (ORCPT ); Sun, 21 Dec 2014 11:32:32 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so5058111wgh.1 for ; Sun, 21 Dec 2014 08:32:31 -0800 (PST) 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=HS/uvRN6nfIcFHI1f6dBNtCIOr6KkxBl34+Rq83lRoQ=; b=JUJi/GfmH/D4Xh2yjdO3+jdC948HPZcXaZlYrIs4guIg9kPQ33UEVzJL6ZG24Vu9v2 dmaycA+a4WMuV/Q8yj5bJ1dcx2ueCeZF+trzv0nX5tGxiFmiwFClpVys+mGzOFPaIaSf VA/okcEkVNR+M6j1IVTUqdtPS803zbu/i2K3EyTlm4I23P3FzHJO+QQMytx0Q3xeR1Vl aZhxHKTlpPD0CIgocbZkQbEZdJPeIByaiARjprOLxnlz8scOCDJXVQTawy80ba8DQRJK INA23XfqL9YG+Wg7Sl+3A1XpZdpUQuNE1/JMSk6zGQdwdRUuxFD38YlzZ1HgjgF9A5xn /YEQ== X-Gm-Message-State: ALoCoQnilr4kmGBMLRLvYs08Dw1LuvVtSuhe3Aq1VU7ALuCqOTS8/aeReSn3FOG2KLyZR+MY9oy7 X-Received: by 10.180.91.136 with SMTP id ce8mr24028067wib.29.1419179551171; Sun, 21 Dec 2014 08:32:31 -0800 (PST) Received: from localhost.localdomain (93-173-25-207.bb.netvision.net.il. [93.173.25.207]) by mx.google.com with ESMTPSA id gy8sm9992815wib.23.2014.12.21.08.32.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Dec 2014 08:32:30 -0800 (PST) From: Eliad Peller To: Johannes Berg Cc: Subject: [PATCH 2/2] mac80211: allow some multi-channel combinations with DFS master Date: Sun, 21 Dec 2014 18:32:26 +0200 Message-Id: <1419179546-29313-2-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.1.109.g3d252a9 In-Reply-To: <1419179546-29313-1-git-send-email-eliad@wizery.com> References: <1419179546-29313-1-git-send-email-eliad@wizery.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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Allow some multi-channel interface combinations along with DFS master support, if there is only a single AP/GO. Allowing other interface types at the same time is fine (as long as the device supports them), and doesn't require additional code. Update ieee80211_dfs_radar_detected_work() to consider this case, and look specifically for the chanctx with radar_enabled. Signed-off-by: Eliad Peller --- net/mac80211/main.c | 11 ----------- net/mac80211/util.c | 3 +++ net/wireless/core.c | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index d9ce336..78d8c6d 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -792,17 +792,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) */ if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) return -EINVAL; - - /* DFS is not supported with multi-channel combinations yet */ - for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { - const struct ieee80211_iface_combination *comb; - - comb = &local->hw.wiphy->iface_combinations[i]; - - if (comb->radar_detect_widths && - comb->num_different_channels > 1) - return -EINVAL; - } } /* Only HW csum features are currently compatible with mac80211 */ diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 974ebe7..61affe6 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2625,6 +2625,9 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work) if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) continue; + if (!ctx->conf.radar_enabled) + continue; + num_chanctx++; chandef = ctx->conf.def; } diff --git a/net/wireless/core.c b/net/wireless/core.c index 4910758..8bcadd9 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -453,7 +453,7 @@ static int wiphy_verify_combinations(struct wiphy *wiphy) int i, j; for (i = 0; i < wiphy->n_iface_combinations; i++) { - u32 cnt = 0; + u32 cnt = 0, dfs_cnt = 0; u16 all_iftypes = 0; c = &wiphy->iface_combinations[i]; @@ -477,11 +477,6 @@ static int wiphy_verify_combinations(struct wiphy *wiphy) CFG80211_MAX_NUM_DIFFERENT_CHANNELS)) return -EINVAL; - /* DFS only works on one channel. */ - if (WARN_ON(c->radar_detect_widths && - (c->num_different_channels > 1))) - return -EINVAL; - if (WARN_ON(!c->n_limits)) return -EINVAL; @@ -505,6 +500,22 @@ static int wiphy_verify_combinations(struct wiphy *wiphy) c->limits[j].max > 1)) return -EINVAL; + if (types & (BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_ADHOC) | + BIT(NL80211_IFTYPE_MESH_POINT))) { + dfs_cnt += c->limits[j].max; + + /* + * Multiple DFS masters on multiple channels + * are not supported yet. + */ + if (WARN_ON(c->radar_detect_widths && + c->num_different_channels > 1 && + dfs_cnt > 1)) + return -EINVAL; + } + cnt += c->limits[j].max; /* * Don't advertise an unsupported type