mt76: mt7915: enable radar background detection
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 12 Jan 2022 17:53:54 +0000 (18:53 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 3 Feb 2022 12:57:59 +0000 (13:57 +0100)
Notify userland the hw supports background radar/CAC detection.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/init.c

index 5139cc9f4ac59dc0b073ec1638ed83a0b12e8e9d..e908d56a9e21bf6fa36c208b91290718b786023f 100644 (file)
@@ -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);