Skip to contentSkip to conversation

cfg80211: Fetch wiphy DFS domain if it is self-managed

PATCH New Sriram R 1 participant 1 message Aug 25, 2021 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Sriram R

author
#0 lore raw

PATCH 1/1 cfg80211: Fetch wiphy DFS domain if it is self-managed

Currently during CAC start or other radar events, the DFS domain is fetched from cfg based on global DFS setting.

But this could be different in case of self managed wiphy's in case the self managed driver updates its database or supports regions which has DFS domain set to UNSET in cfg80211 local regdomain.

This avoids AP bringup failure for these self-managed drivers when such conflict occurs.

---
 net/wireless/reg.c | 8 ++++++++
 1 file changed, 8 insertions(+)
net/wireless/reg.c +8 -0
index c2d0ff7..78626e7 100644
@@ -171,6 +171,7 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy)
 {
 	const struct ieee80211_regdomain *regd = NULL;
 	const struct ieee80211_regdomain *wiphy_regd = NULL;
+	enum nl80211_dfs_regions dfs_region;
 
 	rcu_read_lock();
 	regd = get_cfg80211_regdom();
@@ -182,6 +183,13 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy)
 	if (!wiphy_regd)
 		goto out;
 
+	/* In case the wiphy is self managed, return its dfs domain */
+	if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) {
+		dfs_region = wiphy_regd->dfs_region;
+		rcu_read_unlock();
+		return dfs_region;
+	}
+
 	if (wiphy_regd->dfs_region == regd->dfs_region)
 		goto out;
 
Signature · 1 line
2.7.4