From patchwork Mon Aug 24 10:57:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 259501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F65C433DF for ; Mon, 24 Aug 2020 10:57:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40AF020738 for ; Mon, 24 Aug 2020 10:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598266652; bh=3imcF2vxIpoWNFKt4kmwoUwK2ZR2Jf9V1XMMJQrD0Zs=; h=From:To:Cc:Subject:Date:List-ID:From; b=oXaNX/QdsbToAfWkIiTaDf9D3PU6IaYcfy0j1lKzzXOxjnknTKL0ixXff9qzQrADw lCwEG/bNLhjK2ggsIyH0D/Qab8s7ueSp2edk2FaIeXVC3YQjCzlPBVns8RwLNA6LnC EpqznkRIv4ewvfbKfjtAasJQyadWHfy0noqRkPfY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726964AbgHXK5W (ORCPT ); Mon, 24 Aug 2020 06:57:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:48072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbgHXK5U (ORCPT ); Mon, 24 Aug 2020 06:57:20 -0400 Received: from lore-desk.redhat.com (unknown [151.48.139.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADA5020738; Mon, 24 Aug 2020 10:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598266639; bh=3imcF2vxIpoWNFKt4kmwoUwK2ZR2Jf9V1XMMJQrD0Zs=; h=From:To:Cc:Subject:Date:From; b=LtUCSsvTEEHLLsmrpVug7hAknPXvGNaYIn1G8etZc6R9ntWngnS053y5D45skcrEG k6iKQw7lD7boK5QnhG19c2etjIfoPnWCSyd+aJP02iGf1fck9ZmgrHtvyk/aUQPJa+ jM/7eCh2oakvykoFSfEGQcd1S0lgWrDiWj5v1Fno= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com Subject: [PATCH v2] mt76: mt7615: unlock dfs bands Date: Mon, 24 Aug 2020 12:57:13 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Unlock dfs channels for mt7615 devices since the driver supports radar detection. Dfs pattern detector has been tested successfully by mt7615 users. Do not unlock DFS frequencies for mt7663 devices since it has not been tested yet. Signed-off-by: Lorenzo Bianconi --- Changes since v1: - do not unlock dfs bands for mt7663 --- .../net/wireless/mediatek/mt76/mt7615/init.c | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c index a147891953a1..00dc9e18a8a4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c @@ -217,6 +217,22 @@ static const struct ieee80211_iface_limit if_limits[] = { } }; +static const struct ieee80211_iface_combination if_comb_radar[] = { + { + .limits = if_limits, + .n_limits = ARRAY_SIZE(if_limits), + .max_interfaces = 4, + .num_different_channels = 1, + .beacon_int_infra_match = true, + .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | + BIT(NL80211_CHAN_WIDTH_20) | + BIT(NL80211_CHAN_WIDTH_40) | + BIT(NL80211_CHAN_WIDTH_80) | + BIT(NL80211_CHAN_WIDTH_160) | + BIT(NL80211_CHAN_WIDTH_80P80), + } +}; + static const struct ieee80211_iface_combination if_comb[] = { { .limits = if_limits, @@ -315,8 +331,13 @@ mt7615_init_wiphy(struct ieee80211_hw *hw) hw->sta_data_size = sizeof(struct mt7615_sta); hw->vif_data_size = sizeof(struct mt7615_vif); - wiphy->iface_combinations = if_comb; - wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); + if (is_mt7663(&phy->dev->mt76)) { + wiphy->iface_combinations = if_comb; + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); + } else { + wiphy->iface_combinations = if_comb_radar; + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb_radar); + } wiphy->reg_notifier = mt7615_regd_notifier; wiphy->max_sched_scan_plan_interval = MT7615_MAX_SCHED_SCAN_INTERVAL;