Skip to content

Commit 2425dc7

Browse files
leon-yennbd168
authored andcommitted
wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
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 <[email protected]> Signed-off-by: Ming Yen Hsieh <[email protected]> Tested-by: David Ruth <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
1 parent 0e19942 commit 2425dc7

File tree

1 file changed

+7
-0
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7921

1 file changed

+7
-0
lines changed

drivers/net/wireless/mediatek/mt76/mt7921/init.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ mt7921_regd_notifier(struct wiphy *wiphy,
137137
dev->mt76.region = request->dfs_region;
138138
dev->country_ie_env = request->country_ie_env;
139139

140+
if (request->initiator == NL80211_REGDOM_SET_BY_USER) {
141+
if (dev->mt76.alpha2[0] == '0' && dev->mt76.alpha2[1] == '0')
142+
wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE;
143+
else
144+
wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
145+
}
146+
140147
if (pm->suspended)
141148
return;
142149

0 commit comments

Comments
 (0)