|
@@ -135,6 +135,33 @@ static const char *reg_dfs_region_str(enum nl80211_dfs_regions dfs_region)
|
|
return "Unknown";
|
|
return "Unknown";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+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;
|
|
|
|
+}
|
|
|
|
+
|
|
static void rcu_free_regdom(const struct ieee80211_regdomain *r)
|
|
static void rcu_free_regdom(const struct ieee80211_regdomain *r)
|
|
{
|
|
{
|
|
if (!r)
|
|
if (!r)
|