Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5433957ybg; Tue, 22 Oct 2019 03:14:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBMKb7L/C1PNNirwFde0CDfskRoYSB+JKUM1p0ySKTZvrBzPxAz6LrFk0MrpGGMn16W6M/ X-Received: by 2002:a17:906:a88e:: with SMTP id ha14mr26100664ejb.92.1571739281649; Tue, 22 Oct 2019 03:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571739281; cv=none; d=google.com; s=arc-20160816; b=vhe1qMQR3hUaNi3bA/5NO/oSBq753Yft5FpmAPYsOJPmVXuGYTbUKsMDHz4EvXe0UN BqpjcC39XQ4e+25HO2noIGTfFXAYgUSuCrR4zT8Hpz/KNgYsXjIiVyYK1qHhMBADxS5J gRMY3Uw/0oO6+RS2niSR+j3oyE3SDVM/Nybkew4CsbIWoKEnPQS7UE1xbwjAw09gcHvU 2joICUtJj3VH32RiBR477aC2m4KKxpHoU4TnMZ+D+qZCJBZ1MC5S4n05g4g9U3QibABR gIKVgtKAlgEjXvyX2HyU6JjebdeFaCwE+7d1tOeopogp4j1KsApVwLZyehQQKl0RPy/Y qx7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=6kEykK947e3+gtbBwvp1BhwHoGzJcj5oESwFOALjQ+c=; b=F/49WBjgifX5hx04x0hD5kqHZ+ge9fxc0Rf1IXJ67rxzAY7SJj41iNhBAPccS+LS6f AFK6dl+r1GKtfa7ALQ6fikact2qZF2ghfdRwk/1NxubPnxdwszsuaIeOTk1SkqWP3Use eUWGutK/vOSto9z+eubFT4PyyyaJInfUfRheL93yXAxKg439oMdVI/5hbesfQaGzRbn0 EJlGb6nLIpAuD1Nh33jEnRuK3cRZB08WZ8tk+IkYtuW4vYSxnuHhBIn4N5VYvaQbbDdz z/huJDKODp43eaJPkZZZvOwwyzd/yiDg7RXq/juYu0CHPNKpBFHwPKQYrCfjmtNurMjs pxqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x51si12297807eda.272.2019.10.22.03.14.17; Tue, 22 Oct 2019 03:14:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731738AbfJVKMk (ORCPT + 99 others); Tue, 22 Oct 2019 06:12:40 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:38297 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731732AbfJVKMj (ORCPT ); Tue, 22 Oct 2019 06:12:39 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x9MACXsM019316, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x9MACXsM019316 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 22 Oct 2019 18:12:33 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Tue, 22 Oct 2019 18:12:33 +0800 From: To: CC: , Subject: [PATCH v3 2/2] rtw88: support dynamic user regulatory setting Date: Tue, 22 Oct 2019 18:12:29 +0800 Message-ID: <20191022101229.26044-3-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022101229.26044-1-yhchuang@realtek.com> References: <20191022101229.26044-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Tzu-En Huang 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 Signed-off-by: Yan-Hsuan Chuang --- 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