Skip to content

Commit 90bd5be

Browse files
Sriram Rjmberg-intel
authored andcommitted
cfg80211: use 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 domain, even if the wiphy regdomain disagrees. 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. So for explicitly self-managed wiphys, just use their DFS domain. Signed-off-by: Sriram R <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent b034585 commit 90bd5be

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

net/wireless/reg.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy)
171171
{
172172
const struct ieee80211_regdomain *regd = NULL;
173173
const struct ieee80211_regdomain *wiphy_regd = NULL;
174+
enum nl80211_dfs_regions dfs_region;
174175

175176
rcu_read_lock();
176177
regd = get_cfg80211_regdom();
178+
dfs_region = regd->dfs_region;
177179

178180
if (!wiphy)
179181
goto out;
@@ -182,6 +184,11 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy)
182184
if (!wiphy_regd)
183185
goto out;
184186

187+
if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) {
188+
dfs_region = wiphy_regd->dfs_region;
189+
goto out;
190+
}
191+
185192
if (wiphy_regd->dfs_region == regd->dfs_region)
186193
goto out;
187194

@@ -193,7 +200,7 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy)
193200
out:
194201
rcu_read_unlock();
195202

196-
return regd->dfs_region;
203+
return dfs_region;
197204
}
198205

199206
static void rcu_free_regdom(const struct ieee80211_regdomain *r)

0 commit comments

Comments
 (0)