ath12k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Harshitha Prem <quic_hprem@quicinc.com>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Harshitha Prem <quic_hprem@quicinc.com>
Subject: [PATCH] cfg80211: Allow pre-CAC for self-managed wiphy
Date: Mon, 29 Apr 2024 09:57:23 +0530	[thread overview]
Message-ID: <20240429042723.2847389-1-quic_hprem@quicinc.com> (raw)

Currently, to allow pre-CAC it requires both driver's regulatory domain
in wiphy and cfg80211 local regulatory domain to be same, along with the
region to be in ETSI.

But, for self-managed driver, some countries have mismatch between these
two regulatory domains and it would not allow for a pre-CAC. For example,
in ath12k driver (self-managed), country Sri Lanka (LK) is classified as
FCC domain as per cfg80211 local regulatory database but as per ath12k
driver it falls under ETSI domain then because of this mismatch, the
driver might not be able to do a pre-CAC.

Hence, add changes to allow pre-CAC based on wiphy's regulatory setting
if it is a self-managed wiphy.

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
---
 net/wireless/reg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 3cef0021a3db..e8cc38e37377 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -4214,7 +4214,8 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy)
 		return pre_cac_allowed;
 	}
 
-	if (regd->dfs_region == wiphy_regd->dfs_region &&
+	if ((regd->dfs_region == wiphy_regd->dfs_region ||
+	     wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) &&
 	    wiphy_regd->dfs_region == NL80211_DFS_ETSI)
 		pre_cac_allowed = true;
 
-- 
2.34.1



             reply	other threads:[~2024-04-29  4:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  4:27 Harshitha Prem [this message]
2024-04-29  7:35 ` [PATCH] cfg80211: Allow pre-CAC for self-managed wiphy Kalle Valo
2024-04-29 10:16   ` Harshitha Prem
2024-05-03  8:26 ` Johannes Berg
2024-05-06 17:01   ` Harshitha Prem

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=20240429042723.2847389-1-quic_hprem@quicinc.com \
    --to=quic_hprem@quicinc.com \
    --cc=ath12k@lists.infradead.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).