Search Linux Wireless

[PATCH] cfg80211: reg: get dfs region only from cfg80211_regd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scenario:
1) Driver register regd as "US"
2) cfg80211 set wiphy_regd->dfs_region = FCC
3) now I change country to FR
4) cfg80211_regd->dfs_region == ETSI
   wiphy_regd->dfs_region == FCC
6) start CAC (this call get_dfs_region)
5) next get warning
device specific dfs_region (FCC) disagrees with cfg80211's central dfs_region (ETSI)

Seems checking wiphy_regd->dfs_region is not required, while
there is no way to register more than one dfs_region from
the driver when registering regd.

With patch:
cfg80211: allow restricting supported dfs regions
driver will supported dfs regions using bitmap.
This seems like a more correct approach.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
 net/wireless/reg.c |   24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 11804e8..460ea0c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -133,29 +133,7 @@ static const char *reg_dfs_region_str(enum nl80211_dfs_regions dfs_region)
 
 enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy)
 {
-	const struct ieee80211_regdomain *regd = NULL;
-	const struct ieee80211_regdomain *wiphy_regd = NULL;
-
-	regd = get_cfg80211_regdom();
-	if (!wiphy)
-		goto out;
-
-	wiphy_regd = get_wiphy_regdom(wiphy);
-	if (!wiphy_regd)
-		goto out;
-
-	if (wiphy_regd->dfs_region == regd->dfs_region)
-		goto out;
-
-	REG_DBG_PRINT("%s: device specific dfs_region "
-		      "(%s) disagrees with cfg80211's "
-		      "central dfs_region (%s)\n",
-		      dev_name(&wiphy->dev),
-		      reg_dfs_region_str(wiphy_regd->dfs_region),
-		      reg_dfs_region_str(regd->dfs_region));
-
-out:
-	return regd->dfs_region;
+	return get_cfg80211_regdom()->dfs_region;
 }
 
 static void rcu_free_regdom(const struct ieee80211_regdomain *r)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux