summaryrefslogtreecommitdiff
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2015-01-07 16:47:20 +0200
committerJohannes Berg <johannes.berg@intel.com>2015-01-14 09:43:44 +0100
commitef51fb1d1cd54ae9e0b0efd3b9bdb561fe5483a0 (patch)
treedbe2e22cd66e684c7bd4128ef140de44ce275952 /net/wireless/reg.c
parent2c3e861c94a29a30c75f60f2561b4ee70b3fb3a4 (diff)
cfg80211: avoid reg-hints in self-managed only systems
When a system contains only self-managed regulatory devices all hints from the regulatory core are ignored. Stop hint processing early in this case. These systems usually don't have CRDA deployed, which results in endless (irrelevent) logs of the form: cfg80211: Calling CRDA to update world regulatory domain Make sure there's at least one self-managed device before discarding a hint, in order to prevent initial hints from disappearing on CRDA managed systems. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index f8ed79729eb0..886cc7cb5566 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2108,6 +2108,26 @@ out_free:
reg_free_request(reg_request);
}
+static bool reg_only_self_managed_wiphys(void)
+{
+ struct cfg80211_registered_device *rdev;
+ struct wiphy *wiphy;
+ bool self_managed_found = false;
+
+ ASSERT_RTNL();
+
+ list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
+ wiphy = &rdev->wiphy;
+ if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)
+ self_managed_found = true;
+ else
+ return false;
+ }
+
+ /* make sure at least one self-managed wiphy exists */
+ return self_managed_found;
+}
+
/*
* Processes regulatory hints, this is all the NL80211_REGDOM_SET_BY_*
* Regulatory hints come on a first come first serve basis and we
@@ -2139,6 +2159,11 @@ static void reg_process_pending_hints(void)
spin_unlock(&reg_requests_lock);
+ if (reg_only_self_managed_wiphys()) {
+ reg_free_request(reg_request);
+ return;
+ }
+
reg_process_hint(reg_request);
}