diff mbox

[v2,4/5] wil6210: add option to ignore OTA regulatory hints

Message ID 1494848759-3651-5-git-send-email-qca_merez@qca.qualcomm.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Maya Erez May 15, 2017, 11:45 a.m. UTC
On some platforms, the regulatory domain (country) is set
using mechanisms external to WIFI, such as cellular modem
and GPS. In these scenarios the regulatory hints that
are received over the air (in beacons and similar) can
conflict and even cause an incorrect country to be set.
Add an option to ignore the OTA regulatory hints to better
support such scenarios.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Kalle Valo May 19, 2017, 4:56 a.m. UTC | #1
Maya Erez <qca_merez@qca.qualcomm.com> writes:

> On some platforms, the regulatory domain (country) is set
> using mechanisms external to WIFI, such as cellular modem
> and GPS. In these scenarios the regulatory hints that
> are received over the air (in beacons and similar) can
> conflict and even cause an incorrect country to be set.
> Add an option to ignore the OTA regulatory hints to better
> support such scenarios.
>
> Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/wil6210/cfg80211.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
> index 567fe43..0f297c0 100644
> --- a/drivers/net/wireless/ath/wil6210/cfg80211.c
> +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
> @@ -26,6 +26,11 @@
>  module_param(disable_ap_sme, bool, 0444);
>  MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
>  
> +static bool ignore_reg_hints;
> +module_param(ignore_reg_hints, bool, 0444);
> +MODULE_PARM_DESC(ignore_reg_hints,
> +		 " Ignore OTA regulatory hints (Default: false)");
> +
>  #define CHAN60G(_channel, _flags) {				\
>  	.band			= NL80211_BAND_60GHZ,		\
>  	.center_freq		= 56160 + (2160 * (_channel)),	\
> @@ -1763,6 +1768,11 @@ static void wil_wiphy_init(struct wiphy *wiphy)
>  
>  	wiphy->n_vendor_commands = ARRAY_SIZE(wil_nl80211_vendor_commands);
>  	wiphy->vendor_commands = wil_nl80211_vendor_commands;
> +
> +	if (ignore_reg_hints) {
> +		wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
> +		wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
> +	}

I wonder should something like this be in cfg80211? Because I doubt
wil6210 is the only driver having this problem.
Haim, Maya May 21, 2017, 8:07 p.m. UTC | #2
kvalo@qca.qualcomm.com wrote:
> 
> I wonder should something like this be in cfg80211? Because I doubt
> wil6210 is the only driver having this problem.

We will check that and share our conclusions.
Can you please drop this patch for now and apply the rest of the patches
(if there are no additional comments)?

> 
> --
> Kalle Valo

Thanks,
Maya
Kalle Valo May 22, 2017, 2:22 p.m. UTC | #3
Maya Haim <merez@qti.qualcomm.com> writes:

> kvalo@qca.qualcomm.com wrote:
>> 
>> I wonder should something like this be in cfg80211? Because I doubt
>> wil6210 is the only driver having this problem.
>
> We will check that and share our conclusions.
> Can you please drop this patch for now and apply the rest of the patches
> (if there are no additional comments)?

Sure, I have now dropped this patch. The rest are still on my queue.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 567fe43..0f297c0 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -26,6 +26,11 @@ 
 module_param(disable_ap_sme, bool, 0444);
 MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
 
+static bool ignore_reg_hints;
+module_param(ignore_reg_hints, bool, 0444);
+MODULE_PARM_DESC(ignore_reg_hints,
+		 " Ignore OTA regulatory hints (Default: false)");
+
 #define CHAN60G(_channel, _flags) {				\
 	.band			= NL80211_BAND_60GHZ,		\
 	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -1763,6 +1768,11 @@  static void wil_wiphy_init(struct wiphy *wiphy)
 
 	wiphy->n_vendor_commands = ARRAY_SIZE(wil_nl80211_vendor_commands);
 	wiphy->vendor_commands = wil_nl80211_vendor_commands;
+
+	if (ignore_reg_hints) {
+		wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
+		wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
+	}
 }
 
 struct wireless_dev *wil_cfg80211_init(struct device *dev)