int ret, i, len, offset = 0;
dev->phy.clc_chan_conf = 0xff;
+ dev->regd_user = false;
if (!mt7925_regd_clc_supported(dev))
return 0;
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])
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')