mt76-6e-usb: mac80211: Use less restrictive channel usage rules 69/289969/4
authorastsam <info@no-problem.cc>
Thu, 16 Mar 2023 08:45:18 +0000 (17:45 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 23 Mar 2023 06:46:04 +0000 (15:46 +0900)
Fixed an issue where Wi-Fi 6e could not be scanned. Use less
restrictive channel usage rules.

Signed-off-by: astsam <info@no-problem.cc>
Change-Id: Iafba1ceb9b3275ad1bc71f0d16c48492215d48dd
[Patch url: https://github.com/astsam/mt7921/commit/ec4206ea938037f07cbff516260c9f5706ffa9f7]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/net/wireless/mediatek/mt76-6e-usb/mac80211.c

index 2cd7b3f..aa4f5da 100644 (file)
@@ -393,6 +393,26 @@ mt76_check_sband(struct mt76_phy *phy, struct mt76_sband *msband,
        phy->hw->wiphy->bands[band] = NULL;
 }
 
+static void
+mt76_fix_up_regdb(struct wiphy *wiphy)
+{
+       enum nl80211_band band;
+       struct ieee80211_supported_band *sband;
+       int i;
+
+       for (band = 0; band < NUM_NL80211_BANDS; band++) {
+               sband = wiphy->bands[band];
+
+               if (!sband)
+                       continue;
+
+               for (i = 0; i < sband->n_channels; i++) {
+                       struct ieee80211_channel *chan = &sband->channels[i];
+                       chan->flags = 0;
+               }
+       }
+}
+
 static int
 mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
 {
@@ -639,6 +659,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
        if (ret)
                return ret;
 
+       mt76_fix_up_regdb(phy->hw->wiphy);
        WARN_ON(mt76_worker_setup(hw, &dev->tx_worker, NULL, "tx"));
        sched_set_fifo_low(dev->tx_worker.task);