Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1142800lqt; Fri, 7 Jun 2024 09:07:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUcdB7kbhfmTWNTPjdUZOfp9rantNcbsYb2cbzx3TA8xsIfVjjOPmpadpqg3/37MV7mrkTBPsrI9RAyiKa+5eJnTCgUA+oCkt6NrZg5Q== X-Google-Smtp-Source: AGHT+IF5SZyTWahxB8VaA0DMEUgMCkrIeVunjuHUlFYcgaUrENN6HYXU4647oBPQ43eZiHM6saun X-Received: by 2002:a05:6214:3217:b0:6af:c64c:d197 with SMTP id 6a1803df08f44-6b05952a874mr53855586d6.8.1717776468495; Fri, 07 Jun 2024 09:07:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717776468; cv=pass; d=google.com; s=arc-20160816; b=NBoHKBlkI/o1jckAW76p0aHrxuFUARw3pEIHQmThK8N4+YeE/w2MsWf83w4f5CF/Xb LhgDuv7moUq30bBa+UUaV/uTIzh3/XaAMoRQpZBKpMwc9UcSrXbT+aQdmhcjhVt1Czlf oJ5BNApMvHqgp4gzkdgAvtmvaCA2+/xnp/KVMIVdj2YNBQLodf2QATvAvCgakg1KZiIu znE2tZO9HHOcRRsv9M56pWx8f5ovIxHF1bxiAOvgzpdgUyo2Gc7Q36EZJfjudoABReWi p+ZwkLgs5xpei+F9sgEOL4vgrn6aqPAxJptOnt5zpB++jV7C8Bh7v1lmZsruh2LHStG8 egHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=34pDim3q98b+di9DArDJuxpv+10vrgDHS+iLBvplmv0=; fh=fUr549cSqKocV7UcRuBHkVs5Q/EFHHdf/SC+m2DGkeo=; b=bv4CgrpZ6xO7m8Z2Ik2Kjld47LjBf2bGicfCNpJawwL7oRbVCoIBd/LtH6/Nsro4ui oNBaxvGGOb4tTGOJMO4yZSmwY0mW2RuS9FrdMdilAfECK0ohHhuNXbk4V+uqiiVyVEpE tsUVEHXC27aTi9FSKBosiu8zTXKsB0q0d7rNtorLFWR4Lem6VsoL/S7m2mxJ/t0h9upQ mgpm31tFKoCJEaYtgRqSnjyGBwX6HSd74K48/IfqdFhmJCGHr8Hd/CYctmpBZOTAiPhF Sbwd0UxRVUNs0g3xLbkQb+ERkPdrJEfDNITyhnWh+SjCDDmL/n0bjJI0xKRqyvka6srN 2WBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=f2cO4n8d; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-8707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04fa4612esi28963536d6.586.2024.06.07.09.07.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 09:07:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=f2cO4n8d; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-8707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 14E461C237C7 for ; Fri, 7 Jun 2024 16:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18EF319AD40; Fri, 7 Jun 2024 16:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="f2cO4n8d" X-Original-To: linux-wireless@vger.kernel.org Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DCED19A2A8 for ; Fri, 7 Jun 2024 16:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717776358; cv=none; b=Z1RglSe5aZ1lJqef39XrMIPMoM7kktkfQFWDeUs/ew1t8NHijzg4S97DdYOhTBetSaAtk0VKKUH4RzHJqFmA3XmNc6SzdYTpPfpJscXdyUEGUTh+LQvQhbZi8z0q2BV/7ZXHcaZOT36J8kTehMrVftIMInEOxo3Rq7Ct3HRO0NI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717776358; c=relaxed/simple; bh=Eo5hwNf1jpd2lF8Ue4dQR4kcHfkFnUxOjriSsc+hC90=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jnlCFrpaI/nu7W68z0EnM/Ox/T7X/IGIh9alhC8mzbQS3zuY7vR1UP7YdG8fcTyl0yfRe9PnihUEfdbc/2d6ZZt+MsVf2F4XosNasbdwlsMe4mU946s6hP5bJ/pWO3g1nvt5weXhlVnDPZzf/ZbArXLcxhfytcJ3joL/WavblHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=f2cO4n8d; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=34pDim3q98b+di9DArDJuxpv+10vrgDHS+iLBvplmv0=; b=f2cO4n8dkIQHPI+U9ztWTitSRC Izf7H7d56GfoFWK9lPjXk7/Faidah4mQOVVGIG0K9Se1kNkoY6Tt2shSI6yv/DapHQB60Mf/YxWIa sFON/TSL7XArXmhaB54M81wXQ7tCzfFlG7RYnYZO6EQjazi7ZWni4LxU3KKBCm62O434=; Received: from p4ff13226.dip0.t-ipconnect.de ([79.241.50.38] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1sFc6B-008xPc-0I; Fri, 07 Jun 2024 18:05:51 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, quic_adisi@quicinc.com, quic_periyasa@quicinc.com, ath12k@lists.infradead.org Subject: [RFC v4 5/9] wifi: mac80211: add support for DFS with multiple radios Date: Fri, 7 Jun 2024 18:05:44 +0200 Message-ID: <31b407a1a07356e0335dd2604c507f65ddab9615.1717776325.git-series.nbd@nbd.name> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DFS can be supported with multi-channel combinations, as long as each DFS capable radio only supports one channel. Signed-off-by: Felix Fietkau --- net/mac80211/main.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 40fbf397ce74..e9c4cf611e94 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1084,6 +1084,21 @@ static int ieee80211_init_cipher_suites(struct ieee80211_local *local) return 0; } +static bool +ieee80211_ifcomb_check_radar(const struct ieee80211_iface_combination *comb, + int n_comb) +{ + int i; + + /* DFS is not supported with multi-channel combinations yet */ + for (i = 0; i < n_comb; i++, comb++) + if (comb->radar_detect_widths && + comb->num_different_channels > 1) + return false; + + return true; +} + int ieee80211_register_hw(struct ieee80211_hw *hw) { struct ieee80211_local *local = hw_to_local(hw); @@ -1173,17 +1188,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if (comb->num_different_channels > 1) return -EINVAL; } - } else { - /* 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]; + } else if (hw->wiphy->n_radio) { + for (i = 0; i < hw->wiphy->n_radio; i++) { + const struct wiphy_radio *radio = &hw->wiphy->radio[i]; - if (comb->radar_detect_widths && - comb->num_different_channels > 1) + if (!ieee80211_ifcomb_check_radar(radio->iface_combinations, + radio->n_iface_combinations)) return -EINVAL; } + } else { + if (!ieee80211_ifcomb_check_radar(hw->wiphy->iface_combinations, + hw->wiphy->n_iface_combinations)) + return -EINVAL; } /* Only HW csum features are currently compatible with mac80211 */ -- git-series 0.9.1