From: <yhchuang@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <linux-wireless@vger.kernel.org>, <briannorris@chromium.org>
Subject: [PATCH v3 2/2] rtw88: support dynamic user regulatory setting
Date: Tue, 22 Oct 2019 18:12:29 +0800 [thread overview]
Message-ID: <20191022101229.26044-3-yhchuang@realtek.com> (raw)
In-Reply-To: <20191022101229.26044-1-yhchuang@realtek.com>
From: Tzu-En Huang <tehuang@realtek.com>
Add support for regulatory set by NL80211_REGDOM_SET_BY_USER.
This should only be enabled for distributions that need set
Realtek's card regulatory from userspace.
Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
drivers/net/wireless/realtek/rtw88/Kconfig | 10 ++++++++++
drivers/net/wireless/realtek/rtw88/regd.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw88/Kconfig b/drivers/net/wireless/realtek/rtw88/Kconfig
index 33bd7ed797ff..04b84ec1dfc1 100644
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
@@ -52,4 +52,14 @@ config RTW88_DEBUGFS
If unsure, say Y to simplify debug problems
+config RTW88_REGD_USER_REG_HINTS
+ bool "Realtek rtw88 user regulatory hints"
+ depends on RTW88_CORE
+ default n
+ help
+ Enable regulatoy user hints
+
+ If unsure, say N. This should only be allowed on distributions
+ that need this to correct the regulatory.
+
endif
diff --git a/drivers/net/wireless/realtek/rtw88/regd.c b/drivers/net/wireless/realtek/rtw88/regd.c
index 718a147697cc..500a02b97a9c 100644
--- a/drivers/net/wireless/realtek/rtw88/regd.c
+++ b/drivers/net/wireless/realtek/rtw88/regd.c
@@ -364,7 +364,8 @@ static int rtw_regd_notifier_apply(struct rtw_dev *rtwdev,
{
if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER)
return -EINVAL;
- if (request->initiator == NL80211_REGDOM_SET_BY_USER)
+ if (request->initiator == NL80211_REGDOM_SET_BY_USER &&
+ !IS_ENABLED(CONFIG_RTW88_REGD_USER_REG_HINTS))
return -EINVAL;
if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
!rtw_regd_is_ww(&rtwdev->regd))
--
2.17.1
prev parent reply other threads:[~2019-10-22 10:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 10:12 [PATCH v3 0/2] rtw88: update regulatory settings yhchuang
2019-10-22 10:12 ` [PATCH v3 1/2] rtw88: add regulatory process strategy for different chipset yhchuang
2019-10-25 3:54 ` Chris Chiu
2019-11-29 2:29 ` Tony Chuang
2019-11-29 5:23 ` Kalle Valo
2020-02-12 8:47 ` Tony Chuang
2019-10-22 10:12 ` yhchuang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191022101229.26044-3-yhchuang@realtek.com \
--to=yhchuang@realtek.com \
--cc=briannorris@chromium.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox