Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5497829pxb; Mon, 7 Feb 2022 03:29:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjce5sVajQRVr5ygOVvSdzYCOQGv5cW5t0CxqLZu3AFQHP9WqCDmLpwquAnTlFo2X5s4y6 X-Received: by 2002:a17:907:1b1c:: with SMTP id mp28mr9741769ejc.624.1644233345272; Mon, 07 Feb 2022 03:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644233345; cv=none; d=google.com; s=arc-20160816; b=TsbqYgZRAq9M4YuWhQvsXCc7ZUzdPMiNKq9+kFNvCcTEZpvuUCJnJBlKnndTCUwaFc R/gh97D7DzbjuwMudL2HiJre1UFXSwpTO3Usif39JP+2I6DI6N7ET47LWrxfBLVBBTj1 8g/NJu+LtoF6/PwJUnCR7ktPXvK5tvwdBPdlTqeoN+VVa20FZcXJOSDP4IBPdgTlwz7h i2y+TMbnK8rSTA2FcnEtn3QUUD4E1HwqALhEp8Fm1jVPfukg9yIO7sk94LuOuBESfe+E +iAzLEkno27ZWH4I3nV4J31wJos5yxsNRurkM2qS9tflMBWrHrRZ/duNVnrrlCDtFke4 sXfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9D4EIzHcNcIZ78v6verPDgKFBAxjG4RfJr0Su9O5m94=; b=p68ZNx81DCkozgGdbfU1eOmDZ/WAWJLnCUQxqfnS4z3Oydwzq+qN/Djc6RBxrN6M8C xEDMgOPloELxdbwCkkxUmXFhtRLRQiiEHMACVNXWibYTG8e5GmBch5Cb4xcBE9w817P7 8GEKsXUzjz5x6IIes9XIFtZso8+GGmSFVdafnDPk5PgxgU0vscFY2cn1r/OY1C2nofj/ hL98ysbfMFiqTEWEdLsgYw02oriHcUy1XoWbuZnTeGcgNbnDHXIXA/EH/M1KrGXJcY72 RSB1P1VlwrtRSeP8eO1fyqFAzfM8QGFHt5AQHq6njURL3TtLhsqeNKu1wjZOumZTklHs Qd7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="t3x/C3rj"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10si7534813ejj.846.2022.02.07.03.28.46; Mon, 07 Feb 2022 03:29:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="t3x/C3rj"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350816AbiBCNgH (ORCPT + 72 others); Thu, 3 Feb 2022 08:36:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244071AbiBCNgE (ORCPT ); Thu, 3 Feb 2022 08:36:04 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E62C061401 for ; Thu, 3 Feb 2022 05:36:04 -0800 (PST) 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:To:From:Sender:Reply-To:Cc: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=9D4EIzHcNcIZ78v6verPDgKFBAxjG4RfJr0Su9O5m94=; b=t3x/C3rjtD8MnS1BKS/PbcTXsF cUfHfmTEekyumY+VXCjvYhkBQhp3k31pUvk2qG3716aATxi/P4ymYgEwIU9rkULulim79EIU4cwwY Lc16FrzmaiqhiTODwlUrL/zIBuHvYcsu2574kbvipJplY6w/fjFdPi4m3JQeO7yEUNyE=; Received: from p200300daa71e0b007cedb37d167c1481.dip0.t-ipconnect.de ([2003:da:a71e:b00:7ced:b37d:167c:1481] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nFcHK-0001Et-PG for linux-wireless@vger.kernel.org; Thu, 03 Feb 2022 14:36:02 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 5/5] mt76: mt76x02: use mt76_phy_dfs_state to determine radar detector state Date: Thu, 3 Feb 2022 14:36:00 +0100 Message-Id: <20220203133600.92211-5-nbd@nbd.name> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220203133600.92211-1-nbd@nbd.name> References: <20220203133600.92211-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fixes corner cases in enabling/disabling detector Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c index a601350531cd..024a5c0a5a57 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c @@ -823,10 +823,7 @@ EXPORT_SYMBOL_GPL(mt76x02_phy_dfs_adjust_agc); void mt76x02_dfs_init_params(struct mt76x02_dev *dev) { - struct cfg80211_chan_def *chandef = &dev->mphy.chandef; - - if ((chandef->chan->flags & IEEE80211_CHAN_RADAR) && - dev->mt76.region != NL80211_DFS_UNSET) { + if (mt76_phy_dfs_state(&dev->mphy) > MT_DFS_STATE_DISABLED) { mt76x02_dfs_init_sw_detector(dev); mt76x02_dfs_set_bbp_params(dev); /* enable debug mode */ -- 2.32.0 (Apple Git-132)