linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cfg80211: DFS check dfs_region before CAC
@ 2013-11-08 10:41 Janusz Dziedzic
  2013-11-08 10:41 ` [PATCH 2/3] cfg80211/mac80211: DFS pass CAC time as a parameter Janusz Dziedzic
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Janusz Dziedzic @ 2013-11-08 10:41 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, mcgrof, Janusz Dziedzic

Before we will start radar detection check
if we have correct DFS region. Fail in case
we don't know DFS region (don't know CAC/NOP
timing and how to configure DFS pattern detector).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 net/wireless/nl80211.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 076ed55..635842b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5628,8 +5628,21 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
 	struct net_device *dev = info->user_ptr[1];
 	struct wireless_dev *wdev = dev->ieee80211_ptr;
 	struct cfg80211_chan_def chandef;
+	const struct ieee80211_regdomain *regdom;
+	u8 dfs_region;
 	int err;
 
+	if (!cfg80211_regdomain)
+		return -EINVAL;
+
+	rcu_read_lock();
+	regdom = rcu_dereference(cfg80211_regdomain);
+	dfs_region = regdom->dfs_region;
+	rcu_read_unlock();
+
+	if (dfs_region == NL80211_DFS_UNSET)
+		return -EINVAL;
+
 	err = nl80211_parse_chandef(rdev, info, &chandef);
 	if (err)
 		return err;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-11 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-08 10:41 [PATCH 1/3] cfg80211: DFS check dfs_region before CAC Janusz Dziedzic
2013-11-08 10:41 ` [PATCH 2/3] cfg80211/mac80211: DFS pass CAC time as a parameter Janusz Dziedzic
2013-11-08 10:41 ` [PATCH 3/3] cfg80211: DFS use 10 minutes CAC when weather channels Janusz Dziedzic
2013-11-11 14:03 ` [PATCH 1/3] cfg80211: DFS check dfs_region before CAC Johannes Berg
2013-11-11 17:12   ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).