mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
wifi: mt76: mt7925: disable auto regd changes after user set
Add regd_user flag to block automatic regulatory domain updates if set by user. Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Link: https://patch.msgid.link/20251031090352.1400079-7-mingyen.hsieh@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
committed by
Felix Fietkau
parent
3bc62aa448
commit
992c304112
@@ -685,6 +685,7 @@ static int mt7925_load_clc(struct mt792x_dev *dev, const char *fw_name)
|
||||
int ret, i, len, offset = 0;
|
||||
|
||||
dev->phy.clc_chan_conf = 0xff;
|
||||
dev->regd_user = false;
|
||||
if (!mt7925_regd_clc_supported(dev))
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -173,6 +173,10 @@ void mt7925_regd_notifier(struct wiphy *wiphy, struct regulatory_request *req)
|
||||
struct mt76_connac_pm *pm = &dev->pm;
|
||||
struct mt76_dev *mdev = &dev->mt76;
|
||||
|
||||
if (req->initiator == NL80211_REGDOM_SET_BY_USER &&
|
||||
!dev->regd_user)
|
||||
dev->regd_user = true;
|
||||
|
||||
/* allow world regdom at the first boot only */
|
||||
if (!memcmp(req->alpha2, "00", 2) &&
|
||||
mdev->alpha2[0] && mdev->alpha2[1])
|
||||
@@ -224,7 +228,8 @@ int mt7925_regd_change(struct mt792x_phy *phy, char *alpha2)
|
||||
return 0;
|
||||
|
||||
if (!mt7925_regd_is_valid_alpha2(alpha2) ||
|
||||
!mt7925_regd_clc_supported(dev))
|
||||
!mt7925_regd_clc_supported(dev) ||
|
||||
dev->regd_user)
|
||||
return -EINVAL;
|
||||
|
||||
if (mdev->alpha2[0] != '0' && mdev->alpha2[1] != '0')
|
||||
|
||||
@@ -231,6 +231,7 @@ struct mt792x_dev {
|
||||
bool hw_init_done:1;
|
||||
bool fw_assert:1;
|
||||
bool has_eht:1;
|
||||
bool regd_user:1;
|
||||
bool regd_in_progress:1;
|
||||
bool aspm_supported:1;
|
||||
bool hif_idle:1;
|
||||
|
||||
Reference in New Issue
Block a user