Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3360170pxb; Mon, 24 Jan 2022 08:02:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrQEucxFaJNy4ElpyEWh0sdQ3gahlFxTDX4Xj3FtUImSCZJpd9PvrXynTFwhWOniaxaZkD X-Received: by 2002:a63:7251:: with SMTP id c17mr10356914pgn.579.1643040172692; Mon, 24 Jan 2022 08:02:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643040172; cv=none; d=google.com; s=arc-20160816; b=g9S9/Lr9eoQ5BUr/uZLA/BrT2lwvwDhPXxMLw4kzliqOIh7Jg8C1gnYCSdfan/siHi VpsFX9/GXT+XuaXbPJ6qKN7Q33QEdn+Ozn+1xGWO7bhZbWrScN7ueLu2djbnAqv6PRQD FF4+eokx6aEf/+eGPC59hKaLllcezmTkZWfIquGF0dQVlKV6J4a2MLKPpd/C2x5HsnH+ YyuyQyLNZJZvvfIlwnc/lvGp630Wcq0tCzkXDahWuIFIJ2TQbDsiq13EzoZQTEjjOSDM W8e+lbUslk7fFmQ7tA03BLJw9lswhd2oT26QaJg2+azaZkFTqpexCCRZ56d3b3mV44JF fqHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=G67BEsbAxR1gj0IodGAo3n1Z0PbP4sP10sU/LQd+yXs=; b=Scc4UHPDHHB4/eZ6k8Qpd/p/AUSTsUJUKuQOsqqx+HttwpbL+MJZZnpLEUWPpMUvEk S+WZMOKScQ7PlGYJmdrU4md0F78mwq/VU0Bt72QKLv/M/UZdXhYD72qTK/0tTMGpoyM2 +8p2Affn9AYK2CGhWJFeb5elAUxPHhfO3TnU6f9JrQiMIz5MCFnqRmMDSr8kA9F/YpTI WwfPTAMrFcTZnbwNLfyKkVX/Y/BbiaCf4ybZfQiltZMxWqkINwHSl44HIRRx7LnbncoF ux5RXDSUUEMyzvnJm+bR55YMIt7rFUFAW6Pgd0TbHIaxa25J5adQ4F94lyQN41Qdr+Sp S/0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si2559606pfc.304.2022.01.24.08.02.41; Mon, 24 Jan 2022 08:02:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241048AbiAXD21 (ORCPT + 71 others); Sun, 23 Jan 2022 22:28:27 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:54570 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S241038AbiAXD20 (ORCPT ); Sun, 23 Jan 2022 22:28:26 -0500 X-UUID: 9e059a6af36148fdb4724737b9f63c95-20220124 X-UUID: 9e059a6af36148fdb4724737b9f63c95-20220124 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1614654800; Mon, 24 Jan 2022 11:28:23 +0800 Received: from MTKMBS34N1.mediatek.inc (172.27.4.172) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 24 Jan 2022 11:28:22 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS34N1.mediatek.inc (172.27.4.172) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 24 Jan 2022 11:28:19 +0800 Received: from mcddlt001.gcn.mediatek.inc (10.19.240.15) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 24 Jan 2022 11:28:18 +0800 From: Xing Song To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , Ryder Lee , Evelyn Tsai , , , "Xing Song" Subject: [PATCH] mt76: stop the radar detector after leaving dfs channel Date: Mon, 24 Jan 2022 11:28:11 +0800 Message-ID: <20220124032811.47087-1-xing.song@mediatek.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The radar detctor is used for dfs channel. So it will start after switching to dfs channel and will stop after leaving. The TX will be blocked if radar detctor isn't stopped in non-dfs channel. This patch resets the dfs state to indicate the radar detector needs to be stopped. Signed-off-by: Xing Song --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 9f7ac78f1222..a5432fd5cb93 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -291,7 +291,8 @@ static void mt7615_init_dfs_state(struct mt7615_phy *phy) if (hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) return; - if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) + if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR) && + !(mphy->chandef.chan->flags & IEEE80211_CHAN_RADAR)) return; if (mphy->chandef.chan->center_freq == chandef->chan->center_freq && diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 41b0a4d8b93e..7e03b2a137af 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -311,7 +311,8 @@ static void mt7915_init_dfs_state(struct mt7915_phy *phy) if (hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) return; - if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) + if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR) && + !(mphy->chandef.chan->flags & IEEE80211_CHAN_RADAR)) return; if (mphy->chandef.chan->center_freq == chandef->chan->center_freq && -- 2.17.0