* [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
@ 2024-04-12 8:53 Mingyen Hsieh
2024-04-12 9:27 ` Nicolas Escande
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Mingyen Hsieh @ 2024-04-12 8:53 UTC (permalink / raw)
To: nbd, lorenzo
Cc: deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang, km.lin,
robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee, Shayne.Chen,
linux-wireless, linux-mediatek, Leon Yen, Ming Yen Hsieh
From: Leon Yen <leon.yen@mediatek.com>
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@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
---
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;
+ }
+
if (pm->suspended)
return;
--
2.18.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-12 8:53 [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Mingyen Hsieh
@ 2024-04-12 9:27 ` Nicolas Escande
2024-04-15 5:53 ` Mingyen Hsieh (謝明諺)
2024-06-10 16:16 ` David Ruth
2024-12-30 19:05 ` Felix Fietkau
2 siblings, 1 reply; 9+ messages in thread
From: Nicolas Escande @ 2024-04-12 9:27 UTC (permalink / raw)
To: Mingyen Hsieh, nbd, lorenzo
Cc: deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang, km.lin,
robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee, Shayne.Chen,
linux-wireless, linux-mediatek, Leon Yen
On Fri Apr 12, 2024 at 10:53 AM CEST, Mingyen Hsieh wrote:
> From: Leon Yen <leon.yen@mediatek.com>
>
> 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).
I always had trouble fully understanding the regulation but isn't the country
code IE sole purpose to adapt the regulatory of the client ?
>
> Signed-off-by: Leon Yen <leon.yen@mediatek.com>
> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> ---
> 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;
> + }
> +
> if (pm->suspended)
> return;
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-12 9:27 ` Nicolas Escande
@ 2024-04-15 5:53 ` Mingyen Hsieh (謝明諺)
2024-04-15 10:26 ` Nicolas Escande
0 siblings, 1 reply; 9+ messages in thread
From: Mingyen Hsieh (謝明諺) @ 2024-04-15 5:53 UTC (permalink / raw)
To: nbd@nbd.name, nico.escande@gmail.com, lorenzo@kernel.org
Cc: linux-mediatek@lists.infradead.org,
Leon Yen (顏良儒),
Deren Wu (武德仁),
Shayne Chen (陳軒丞),
Quan Zhou (周全), Sean Wang,
KM Lin (林昆民),
Soul Huang (黃至昶),
Posh Sun (孫瑞廷),
Eric-SY Chang (張書源),
CH Yeh (葉志豪),
Robin Chiu (邱國濱), Ryder Lee,
linux-wireless@vger.kernel.org
On Fri, 2024-04-12 at 11:27 +0200, Nicolas Escande wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On Fri Apr 12, 2024 at 10:53 AM CEST, Mingyen Hsieh wrote:
> > From: Leon Yen <leon.yen@mediatek.com>
> >
> > 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).
>
> I always had trouble fully understanding the regulation but isn't the
> country
> code IE sole purpose to adapt the regulatory of the client ?
>
Hi Nicolas,
Yes, it is. However, if the users have set the specific country code
based on their region to the driver, they do not expect the country
setting to be changed by the country code IE as the AP cannot be
entirely trusted.
Best Regards,
Yen.
> >
> > Signed-off-by: Leon Yen <leon.yen@mediatek.com>
> > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > ---
> > 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;
> > +}
> > +
> > if (pm->suspended)
> > return;
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-15 5:53 ` Mingyen Hsieh (謝明諺)
@ 2024-04-15 10:26 ` Nicolas Escande
2024-04-22 6:32 ` Mingyen Hsieh (謝明諺)
2024-10-28 1:55 ` Mingyen Hsieh (謝明諺)
0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Escande @ 2024-04-15 10:26 UTC (permalink / raw)
To: Mingyen Hsieh (謝明諺), nbd@nbd.name,
lorenzo@kernel.org
Cc: linux-mediatek@lists.infradead.org,
Leon Yen (顏良儒),
Deren Wu (武德仁),
Shayne Chen (陳軒丞),
Quan Zhou (周全), Sean Wang,
KM Lin (林昆民),
Soul Huang (黃至昶),
Posh Sun (孫瑞廷),
Eric-SY Chang (張書源),
CH Yeh (葉志豪),
Robin Chiu (邱國濱), Ryder Lee,
linux-wireless@vger.kernel.org
On Mon Apr 15, 2024 at 7:53 AM CEST, Mingyen Hsieh (謝明諺) wrote:
> On Fri, 2024-04-12 at 11:27 +0200, Nicolas Escande wrote:
> >
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> > On Fri Apr 12, 2024 at 10:53 AM CEST, Mingyen Hsieh wrote:
> > > From: Leon Yen <leon.yen@mediatek.com>
> > >
> > > 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).
> >
> > I always had trouble fully understanding the regulation but isn't the
> > country
> > code IE sole purpose to adapt the regulatory of the client ?
> >
> Hi Nicolas,
>
> Yes, it is. However, if the users have set the specific country code
> based on their region to the driver, they do not expect the country
> setting to be changed by the country code IE as the AP cannot be
> entirely trusted.
Hi,
In AP mode, I understand that the hardware/firmware (and so user mode to some
extend) is the source of truth about which country/market the product has passed
certification and what not. Thus the country code of an AP should be trusted.
If you put an AP from another market at some place, you are responsible for that
But in STA mode the end user should not need to know which regulation follow,
right ? The AP's Country code IE is where the sta gets the final info. So no,
the AP should be trusted, and the user should not (and not the other way around)
Of course, I am no an expert on this. I just want to check if there was some
though behind this change. You guys make Wifi chips, you know what you are doing
Thanks
>
> Best Regards,
> Yen.
>
> > >
> > > Signed-off-by: Leon Yen <leon.yen@mediatek.com>
> > > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > > ---
> > > 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;
> > > +}
> > > +
> > > if (pm->suspended)
> > > return;
> > >
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-15 10:26 ` Nicolas Escande
@ 2024-04-22 6:32 ` Mingyen Hsieh (謝明諺)
2024-10-28 1:55 ` Mingyen Hsieh (謝明諺)
1 sibling, 0 replies; 9+ messages in thread
From: Mingyen Hsieh (謝明諺) @ 2024-04-22 6:32 UTC (permalink / raw)
To: nbd@nbd.name, nico.escande@gmail.com, lorenzo@kernel.org
Cc: linux-mediatek@lists.infradead.org,
Leon Yen (顏良儒),
Deren Wu (武德仁),
Shayne Chen (陳軒丞),
Quan Zhou (周全), KM Lin (林昆民),
Sean Wang, Soul Huang (黃至昶),
Posh Sun (孫瑞廷),
Eric-SY Chang (張書源),
CH Yeh (葉志豪),
Robin Chiu (邱國濱), Ryder Lee,
linux-wireless@vger.kernel.org
On Mon, 2024-04-15 at 12:26 +0200, Nicolas Escande wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On Mon Apr 15, 2024 at 7:53 AM CEST, Mingyen Hsieh (謝明諺) wrote:
> > On Fri, 2024-04-12 at 11:27 +0200, Nicolas Escande wrote:
> > >
> > > External email : Please do not click links or open attachments
> until
> > > you have verified the sender or the content.
> > > On Fri Apr 12, 2024 at 10:53 AM CEST, Mingyen Hsieh wrote:
> > > > From: Leon Yen <leon.yen@mediatek.com>
> > > >
> > > > 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).
> > >
> > > I always had trouble fully understanding the regulation but isn't
> the
> > > country
> > > code IE sole purpose to adapt the regulatory of the client ?
> > >
> > Hi Nicolas,
> >
> > Yes, it is. However, if the users have set the specific country
> code
> > based on their region to the driver, they do not expect the country
> > setting to be changed by the country code IE as the AP cannot be
> > entirely trusted.
>
> Hi,
>
> In AP mode, I understand that the hardware/firmware (and so user mode
> to some
> extend) is the source of truth about which country/market the product
> has passed
> certification and what not. Thus the country code of an AP should be
> trusted.
> If you put an AP from another market at some place, you are
> responsible for that
>
> But in STA mode the end user should not need to know which regulation
> follow,
> right ? The AP's Country code IE is where the sta gets the final
> info. So no,
> the AP should be trusted, and the user should not (and not the other
> way around)
>
> Of course, I am no an expert on this. I just want to check if there
> was some
> though behind this change. You guys make Wifi chips, you know what
> you are doing
>
> Thanks
Hi,
Sorry for late response. Firstly, the "users" for driver doesn't mean
end users here; instead, it means the freamework of a Linux based
operation system that set the country code via nl80211. Some devices
shipped with a preset country code setting and set it to the driver
during boot by using iw or CRDA, as mentioned in the commit message.
These devices may get local RF certificated only with their preset
country setting, so manufacturers do not anticipate any changes to the
country setting.
Secondly, some APs with incorrect country settings may be placed in a
public area either accidentally or intentionally. The devices connected
to those APs could potentially violate the local RF rules if beacon
country IE hinting is not disabled in this situation.
This patch tries to solve the issue described above by disabling beacon
country IE hinting on devices coming with preset country settings. Of
course, the country IE hinting remains enabled on devices lacking
preset country code settings to adapt the regulatory domain information
based on the connected AP.
Thanks
> >
> > Best Regards,
> > Yen.
> >
> > > >
> > > > Signed-off-by: Leon Yen <leon.yen@mediatek.com>
> > > > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > > > ---
> > > > 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;
> > > > +}
> > > > +
> > > > if (pm->suspended)
> > > > return;
> > > >
> > >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-12 8:53 [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Mingyen Hsieh
2024-04-12 9:27 ` Nicolas Escande
@ 2024-06-10 16:16 ` David Ruth
2024-12-30 19:05 ` Felix Fietkau
2 siblings, 0 replies; 9+ messages in thread
From: David Ruth @ 2024-06-10 16:16 UTC (permalink / raw)
To: Mingyen Hsieh
Cc: nbd, lorenzo, deren.wu, Sean.Wang, Soul.Huang, Leon.Yen,
Eric-SY.Chang, km.lin, robin.chiu, ch.yeh, posh.sun, Quan.Zhou,
Ryder.Lee, Shayne.Chen, linux-wireless, linux-mediatek
Tested-by: David Ruth <druth@chromium.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-15 10:26 ` Nicolas Escande
2024-04-22 6:32 ` Mingyen Hsieh (謝明諺)
@ 2024-10-28 1:55 ` Mingyen Hsieh (謝明諺)
1 sibling, 0 replies; 9+ messages in thread
From: Mingyen Hsieh (謝明諺) @ 2024-10-28 1:55 UTC (permalink / raw)
To: nbd@nbd.name, nico.escande@gmail.com, lorenzo@kernel.org
Cc: linux-mediatek@lists.infradead.org,
Leon Yen (顏良儒),
Deren Wu (武德仁),
Shayne Chen (陳軒丞),
Quan Zhou (周全), KM Lin (林昆民),
Sean Wang, Soul Huang (黃至昶),
Posh Sun (孫瑞廷),
Eric-SY Chang (張書源),
CH Yeh (葉志豪),
Robin Chiu (邱國濱), Ryder Lee,
linux-wireless@vger.kernel.org
On Mon, 2024-04-15 at 12:26 +0200, Nicolas Escande wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On Mon Apr 15, 2024 at 7:53 AM CEST, Mingyen Hsieh (謝明諺) wrote:
> > On Fri, 2024-04-12 at 11:27 +0200, Nicolas Escande wrote:
> > >
> > > External email : Please do not click links or open attachments
> until
> > > you have verified the sender or the content.
> > > On Fri Apr 12, 2024 at 10:53 AM CEST, Mingyen Hsieh wrote:
> > > > From: Leon Yen <leon.yen@mediatek.com>
> > > >
> > > > 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).
> > >
> > > I always had trouble fully understanding the regulation but isn't
> the
> > > country
> > > code IE sole purpose to adapt the regulatory of the client ?
> > >
> > Hi Nicolas,
> >
> > Yes, it is. However, if the users have set the specific country
> code
> > based on their region to the driver, they do not expect the country
> > setting to be changed by the country code IE as the AP cannot be
> > entirely trusted.
>
> Hi,
>
> In AP mode, I understand that the hardware/firmware (and so user mode
> to some
> extend) is the source of truth about which country/market the product
> has passed
> certification and what not. Thus the country code of an AP should be
> trusted.
> If you put an AP from another market at some place, you are
> responsible for that
>
> But in STA mode the end user should not need to know which regulation
> follow,
> right ? The AP's Country code IE is where the sta gets the final
> info. So no,
> the AP should be trusted, and the user should not (and not the other
> way around)
>
> Of course, I am no an expert on this. I just want to check if there
> was some
> though behind this change. You guys make Wifi chips, you know what
> you are doing
>
> Thanks
> >
> > Best Regards,
> > Yen.
> >
> > > >
> > > > Signed-off-by: Leon Yen <leon.yen@mediatek.com>
> > > > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > > > ---
> > > > 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;
> > > > +}
> > > > +
> > > > if (pm->suspended)
> > > > return;
> > > >
> > >
>
Hi nbd,
May I ask about the status of this patch?
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
2024-04-12 8:53 [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Mingyen Hsieh
2024-04-12 9:27 ` Nicolas Escande
2024-06-10 16:16 ` David Ruth
@ 2024-12-30 19:05 ` Felix Fietkau
[not found] ` <SI2PR03MB5322E7B73B5AB27215A5436585102@SI2PR03MB5322.apcprd03.prod.outlook.com>
2 siblings, 1 reply; 9+ messages in thread
From: Felix Fietkau @ 2024-12-30 19:05 UTC (permalink / raw)
To: Mingyen Hsieh, lorenzo
Cc: deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang, km.lin,
robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee, Shayne.Chen,
linux-wireless, linux-mediatek
On 12.04.24 10:53, Mingyen Hsieh wrote:
> From: Leon Yen <leon.yen@mediatek.com>
>
> 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@mediatek.com>
> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> ---
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
[not found] ` <SI2PR03MB5322E7B73B5AB27215A5436585102@SI2PR03MB5322.apcprd03.prod.outlook.com>
@ 2025-01-06 5:58 ` Mingyen Hsieh (謝明諺)
0 siblings, 0 replies; 9+ messages in thread
From: Mingyen Hsieh (謝明諺) @ 2025-01-06 5:58 UTC (permalink / raw)
To: nbd@nbd.name
Cc: linux-wireless@vger.kernel.org,
linux-mediatek@lists.infradead.org,
Leon Yen (顏良儒)
On Mon, 2025-01-06 at 05:50 +0000, Mingyen Hsieh (謝明諺) wrote:
>
>
> -----Original Message-----
> From: Felix Fietkau <nbd@nbd.name>
> Sent: Tuesday, December 31, 2024 3:05 AM
> To: Mingyen Hsieh (謝明諺) <Mingyen.Hsieh@mediatek.com>;
> lorenzo@kernel.org
> Cc: Deren Wu (武德仁) <Deren.Wu@mediatek.com>; Sean Wang
> <Sean.Wang@mediatek.com>; Soul Huang (黃至昶) <Soul.Huang@mediatek.com>;
> Leon Yen (顏良儒) <Leon.Yen@mediatek.com>; Eric-SY Chang (張書源)
> <Eric-SY.Chang@mediatek.com>; KM Lin (林昆民) <km.lin@mediatek.com>;
> Robin Chiu (邱國濱) <robin.chiu@mediatek.com>; CH Yeh (葉志豪)
> <ch.yeh@mediatek.com>; Posh Sun (孫瑞廷) <posh.sun@mediatek.com>; Quan
> Zhou (周全) <Quan.Zhou@mediatek.com>; Ryder Lee
> <Ryder.Lee@mediatek.com>; Shayne Chen (陳軒丞)
> <Shayne.Chen@mediatek.com>; linux-wireless@vger.kernel.org;
> linux-mediatek@lists.infradead.org
> 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@mediatek.com>
> >
> > 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@mediatek.com>
> > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > ---
> > 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-01-06 5:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12 8:53 [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Mingyen Hsieh
2024-04-12 9:27 ` Nicolas Escande
2024-04-15 5:53 ` Mingyen Hsieh (謝明諺)
2024-04-15 10:26 ` Nicolas Escande
2024-04-22 6:32 ` Mingyen Hsieh (謝明諺)
2024-10-28 1:55 ` Mingyen Hsieh (謝明諺)
2024-06-10 16:16 ` David Ruth
2024-12-30 19:05 ` Felix Fietkau
[not found] ` <SI2PR03MB5322E7B73B5AB27215A5436585102@SI2PR03MB5322.apcprd03.prod.outlook.com>
2025-01-06 5:58 ` Mingyen Hsieh (謝明諺)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox