On Mon, 2025-01-06 at 05:50 +0000, Mingyen Hsieh (謝明諺) wrote: > > > -----Original Message----- > From: Felix Fietkau <nbd@xxxxxxxx> > Sent: Tuesday, December 31, 2024 3:05 AM > To: Mingyen Hsieh (謝明諺) <Mingyen.Hsieh@xxxxxxxxxxxx>; > lorenzo@xxxxxxxxxx > Cc: Deren Wu (武德仁) <Deren.Wu@xxxxxxxxxxxx>; Sean Wang > <Sean.Wang@xxxxxxxxxxxx>; Soul Huang (黃至昶) <Soul.Huang@xxxxxxxxxxxx>; > Leon Yen (顏良儒) <Leon.Yen@xxxxxxxxxxxx>; Eric-SY Chang (張書源) > <Eric-SY.Chang@xxxxxxxxxxxx>; KM Lin (林昆民) <km.lin@xxxxxxxxxxxx>; > Robin Chiu (邱國濱) <robin.chiu@xxxxxxxxxxxx>; CH Yeh (葉志豪) > <ch.yeh@xxxxxxxxxxxx>; Posh Sun (孫瑞廷) <posh.sun@xxxxxxxxxxxx>; Quan > Zhou (周全) <Quan.Zhou@xxxxxxxxxxxx>; Ryder Lee > <Ryder.Lee@xxxxxxxxxxxx>; Shayne Chen (陳軒丞) > <Shayne.Chen@xxxxxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx; > linux-mediatek@xxxxxxxxxxxxxxxxxxx > Subject: Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of > the preset regulatory domain > > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > On 12.04.24 10:53, Mingyen Hsieh wrote: > > From: Leon Yen <leon.yen@xxxxxxxxxxxx> > > > > 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 <leon.yen@xxxxxxxxxxxx> > > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@xxxxxxxxxxxx> > > --- > > 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 ef0c721d26e3..3c9a5fcd6924 100644 > > --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c > > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c > > @@ -135,6 +135,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; > > + } > > + > > Sorry for the late response, I just noticed that I completely forgot > to review this one. > > In principle, it makes sense to me to ignore the country IE in this > case, however I don't understand why the change is done in the mt7921 > driver. Isn't this a generic issue that should be consistent across > drivers and thus better handled in mac80211? > > Thanks, > > - Felix Hi, Thank you for the review. The purpose of this patch is not to fix a bug; instead, it changes how the driver treats the beacon country IE hint and has both advantages and disadvantages. With this patch, the beacon country IE hinting will be disabled on a country code preset system, which might cause some issues during overseas travel in certain situations. it's a trade-off, I believe it's better to allow the developers of each wifi dirver to decide how to manage it and keeping mac80211 flexible. yen.