]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
mt76: mt7615: introduce mt7615_regd_notifier
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 29 Jun 2019 10:36:06 +0000 (12:36 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Sep 2019 15:42:28 +0000 (17:42 +0200)
Introduce mt7615_regd_notifier callback. This is a preliminary patch to
add radar detection support to mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/init.c

index 859de2454ec68d8e00f4af04bd2812115fd44c0b..edce96ce79a42a5236f81c0eb23b4c02f549edd3 100644 (file)
@@ -208,6 +208,16 @@ mt7615_init_txpower(struct mt7615_dev *dev,
        }
 }
 
+static void
+mt7615_regd_notifier(struct wiphy *wiphy,
+                    struct regulatory_request *request)
+{
+       struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
+       struct mt7615_dev *dev = hw->priv;
+
+       dev->mt76.region = request->dfs_region;
+}
+
 int mt7615_register_device(struct mt7615_dev *dev)
 {
        struct ieee80211_hw *hw = mt76_hw(dev);
@@ -230,6 +240,7 @@ int mt7615_register_device(struct mt7615_dev *dev)
 
        wiphy->iface_combinations = if_comb;
        wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
+       wiphy->reg_notifier = mt7615_regd_notifier;
 
        ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER);
        ieee80211_hw_set(hw, TX_STATUS_NO_AMPDU_LEN);