From patchwork Wed Jan 12 14:13:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12711461 X-Patchwork-Delegate: nbd@nbd.name Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAF5C433FE for ; Wed, 12 Jan 2022 14:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354041AbiALOPB (ORCPT ); Wed, 12 Jan 2022 09:15:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354014AbiALOOk (ORCPT ); Wed, 12 Jan 2022 09:14:40 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61ABC061748 for ; Wed, 12 Jan 2022 06:14:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 74CF7614EB for ; Wed, 12 Jan 2022 14:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66C8AC36AE5; Wed, 12 Jan 2022 14:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641996878; bh=rJFr/ccMGxzX5Thiy1NAGXlf9AsqHRI3KKm8LzpKS9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVVCZXw5Em4fPyYwalRAPwAXS2q+0fGDJeeR+7jTVwTMX5rlDIL7ziN9CCuITPKOp GAFI91L+W9WvqYw74UMAm0DQXeBt3VExa4/ub5knPyNSvcaE1ExZULzzyZz5H+0lvO nNv47JJbKIvAhNTI6Ff5Dypj7hxcb5DF/J94rCx4mt+MU2osRB9YLfINMjr5PQjoos NeC+FDNv6wLsoKXCaq3F9ho7ybwWfGxafVWkhQ2bxpBZ6tGvDjDEu9w8iHSq56vjzT 96suLMeuauFxPKf/xXap2OA7ZUi+KyQDJT+TG1FYjrNSnzbS+H8qnOH94Nmt9kzLGJ NQwO0UDkYUTbQ== From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, evelyn.tsai@mediatek.com, owen.peng@mediatek.com Subject: [PATCH 5/6] mt76: mt7915: enable radar background detection Date: Wed, 12 Jan 2022 15:13:52 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Notify userland the hw supports background radar/CAC detection. Tested-by: Owen Peng Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index 5c1643963506..91c7ce60f296 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -309,6 +309,7 @@ static void mt7915_init_wiphy(struct ieee80211_hw *hw) { struct mt7915_phy *phy = mt7915_hw_phy(hw); + struct mt76_dev *mdev = &phy->dev->mt76; struct wiphy *wiphy = hw->wiphy; struct mt7915_dev *dev = phy->dev; @@ -337,6 +338,12 @@ mt7915_init_wiphy(struct ieee80211_hw *hw) wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_VHT); wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_HE); + if (!mdev->dev->of_node || + !of_property_read_bool(mdev->dev->of_node, + "mediatek,disable-radar-background")) + wiphy_ext_feature_set(wiphy, + NL80211_EXT_FEATURE_RADAR_BACKGROUND); + ieee80211_hw_set(hw, HAS_RATE_CONTROL); ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD); ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);