From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 From: Ajrat Makhmutov To: devel-kernel@lists.altlinux.org Date: Wed, 10 Jun 2026 11:39:08 +0300 Message-ID: <20260610083910.23062-2-rauty@altlinux.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260610083910.23062-1-rauty@altlinux.org> References: <20260610083910.23062-1-rauty@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [d-kernel] [PATCH 1/2] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2026 08:39:23 -0000 Archived-At: List-Archive: List-Post: From: Leon Yen Some countries have strict RF restrictions where changing the regulatory domain dynamically based on the connected AP is not acceptable. This patch disables Beacon country IE hinting when a valid country code is set from usersland (e.g., by system using iw or CRDA). Signed-off-by: Leon Yen Signed-off-by: Ming Yen Hsieh Tested-by: David Ruth Link: https://patch.msgid.link/20240412085357.13756-1-mingyen.hsieh@mediatek.com Signed-off-by: Felix Fietkau (cherry picked from commit 2425dc7beaadc39c2636f97f8bdc22dc3cf88149) --- drivers/net/wireless/mediatek/mt76/mt7921/init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index 4bd533c4ba9a1..276dfb9c26e0d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -137,6 +137,13 @@ mt7921_regd_notifier(struct wiphy *wiphy, dev->mt76.region = request->dfs_region; dev->country_ie_env = request->country_ie_env; + if (request->initiator == NL80211_REGDOM_SET_BY_USER) { + if (dev->mt76.alpha2[0] == '0' && dev->mt76.alpha2[1] == '0') + wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE; + else + wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; + } + if (pm->suspended) return; -- 2.50.1