]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: mt7925: improve EHT capability control in regulatory flow
authorMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Fri, 31 Oct 2025 09:03:50 +0000 (17:03 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 24 Nov 2025 13:37:55 +0000 (14:37 +0100)
Move EHT flag handling into mt7925_regd_channel_update() to ensure
correct channel capability reporting.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20251031090352.1400079-5-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/main.c
drivers/net/wireless/mediatek/mt76/mt7925/regd.c

index 687f58f115b059129673c0f17ca03774ece6f01c..641be23011b1c90866e5d1c7509fb55ec97c2156 100644 (file)
@@ -1369,8 +1369,6 @@ void mt7925_scan_work(struct work_struct *work)
                                if (!is_valid_alpha2(evt->alpha2))
                                        break;
 
-                               mt7925_regd_be_ctrl(phy->dev, evt->alpha2);
-
                                if (mdev->alpha2[0] != '0' && mdev->alpha2[1] != '0')
                                        break;
 
index b36c6a6f5da6077ded55831df535cad317355fb9..12d8aac16e34ab58f6e44ed4d9e3f80c4edb1efa 100644 (file)
@@ -83,6 +83,17 @@ mt7925_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
                        dev->phy.clc_chan_conf &= ~MT7925_UNII_6G_IS_VALID;
        }
 
+       sband = wiphy->bands[NL80211_BAND_2GHZ];
+       if (!sband)
+               return;
+
+       for (i = 0; i < sband->n_channels; i++) {
+               ch = &sband->channels[i];
+
+               if (!dev->has_eht)
+                       ch->flags |= IEEE80211_CHAN_NO_EHT;
+       }
+
        sband = wiphy->bands[NL80211_BAND_5GHZ];
        if (!sband)
                return;
@@ -93,6 +104,9 @@ mt7925_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
                /* UNII-4 */
                if (IS_UNII_INVALID(0, 5845, 5925, ch->center_freq))
                        ch->flags |= IEEE80211_CHAN_DISABLED;
+
+               if (!dev->has_eht)
+                       ch->flags |= IEEE80211_CHAN_NO_EHT;
        }
 
        sband = wiphy->bands[NL80211_BAND_6GHZ];
@@ -108,6 +122,9 @@ mt7925_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
                    IS_UNII_INVALID(3, 6525, 6875, ch->center_freq) ||
                    IS_UNII_INVALID(4, 6875, 7125, ch->center_freq))
                        ch->flags |= IEEE80211_CHAN_DISABLED;
+
+               if (!dev->has_eht)
+                       ch->flags |= IEEE80211_CHAN_NO_EHT;
        }
 }
 
@@ -128,6 +145,7 @@ int mt7925_mcu_regd_update(struct mt792x_dev *dev, u8 *alpha2,
        if (ret < 0)
                goto err;
 
+       mt7925_regd_be_ctrl(dev, alpha2);
        mt7925_regd_channel_update(wiphy, dev);
 
        ret = mt7925_mcu_set_channel_domain(hw->priv);