linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event
@ 2013-10-28 18:27 Janusz Dziedzic
  2013-10-28 18:27 ` [PATCH 2/5] mac80211: DFS setup chandef for radar_event correctly Janusz Dziedzic
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Janusz Dziedzic @ 2013-10-28 18:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Janusz Dziedzic

To report channel width correctly we have
to send correct channel parameters from
mac80211 when calling cfg80211_cac_event().

This is required in case of using channel width
higher than 20MHz and we have to set correct
dfs channel state after CAC (NL80211_DFS_AVAILABLE).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 include/net/cfg80211.h |    2 ++
 net/mac80211/cfg.c     |    5 ++++-
 net/mac80211/iface.c   |    5 ++++-
 net/mac80211/mlme.c    |    6 ++++--
 net/mac80211/util.c    |    3 +++
 net/wireless/mlme.c    |    8 +++-----
 6 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 45f6bf5..8b52fcb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4123,6 +4123,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
 /**
  * cfg80211_cac_event - Channel availability check (CAC) event
  * @netdev: network device
+ * @chandef: chandef for the current channel
  * @event: type of event
  * @gfp: context flags
  *
@@ -4131,6 +4132,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
  * also by full-MAC drivers.
  */
 void cfg80211_cac_event(struct net_device *netdev,
+			struct cfg80211_chan_def *chandef,
 			enum nl80211_radar_event event, gfp_t gfp);
 
 
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7501497..5690d21 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1050,6 +1050,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
 	struct ieee80211_local *local = sdata->local;
 	struct beacon_data *old_beacon;
 	struct probe_resp *old_probe_resp;
+	struct cfg80211_chan_def chandef;
 
 	old_beacon = rtnl_dereference(sdata->u.ap.beacon);
 	if (!old_beacon)
@@ -1090,8 +1091,10 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
 	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
 
 	if (sdata->wdev.cac_started) {
+		chandef = sdata->vif.bss_conf.chandef;
 		cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
-		cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED,
+		cfg80211_cac_event(sdata->dev, &chandef,
+				   NL80211_RADAR_CAC_ABORTED,
 				   GFP_KERNEL);
 	}
 
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index e48f103..cb5e339 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -749,6 +749,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 	u32 hw_reconf_flags = 0;
 	int i, flushed;
 	struct ps_data *ps;
+	struct cfg80211_chan_def chandef;
 
 	clear_bit(SDATA_STATE_RUNNING, &sdata->state);
 
@@ -823,11 +824,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 	cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
 
 	if (sdata->wdev.cac_started) {
+		chandef = sdata->vif.bss_conf.chandef;
 		WARN_ON(local->suspended);
 		mutex_lock(&local->iflist_mtx);
 		ieee80211_vif_release_channel(sdata);
 		mutex_unlock(&local->iflist_mtx);
-		cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED,
+		cfg80211_cac_event(sdata->dev, &chandef,
+				   NL80211_RADAR_CAC_ABORTED,
 				   GFP_KERNEL);
 	}
 
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 91cc828..a2487da 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1400,10 +1400,12 @@ void ieee80211_dfs_cac_timer_work(struct work_struct *work)
 	struct ieee80211_sub_if_data *sdata =
 		container_of(delayed_work, struct ieee80211_sub_if_data,
 			     dfs_cac_timer_work);
+	struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chandef;
 
 	ieee80211_vif_release_channel(sdata);
-
-	cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
+	cfg80211_cac_event(sdata->dev, &chandef,
+			   NL80211_RADAR_CAC_FINISHED,
+			   GFP_KERNEL);
 }
 
 /* MLME */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index aefb9d5..f704415 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2253,14 +2253,17 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
 void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
 {
 	struct ieee80211_sub_if_data *sdata;
+	struct cfg80211_chan_def chandef;
 
 	mutex_lock(&local->iflist_mtx);
 	list_for_each_entry(sdata, &local->interfaces, list) {
 		cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
 
 		if (sdata->wdev.cac_started) {
+			chandef = sdata->vif.bss_conf.chandef;
 			ieee80211_vif_release_channel(sdata);
 			cfg80211_cac_event(sdata->dev,
+					   &chandef,
 					   NL80211_RADAR_CAC_ABORTED,
 					   GFP_KERNEL);
 		}
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 6a6b1c8..a50c27b 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -763,12 +763,12 @@ void cfg80211_radar_event(struct wiphy *wiphy,
 EXPORT_SYMBOL(cfg80211_radar_event);
 
 void cfg80211_cac_event(struct net_device *netdev,
+			struct cfg80211_chan_def *chandef,
 			enum nl80211_radar_event event, gfp_t gfp)
 {
 	struct wireless_dev *wdev = netdev->ieee80211_ptr;
 	struct wiphy *wiphy = wdev->wiphy;
 	struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
-	struct cfg80211_chan_def chandef;
 	unsigned long timeout;
 
 	trace_cfg80211_cac_event(netdev, event);
@@ -779,14 +779,12 @@ void cfg80211_cac_event(struct net_device *netdev,
 	if (WARN_ON(!wdev->channel))
 		return;
 
-	cfg80211_chandef_create(&chandef, wdev->channel, NL80211_CHAN_NO_HT);
-
 	switch (event) {
 	case NL80211_RADAR_CAC_FINISHED:
 		timeout = wdev->cac_start_time +
 			  msecs_to_jiffies(IEEE80211_DFS_MIN_CAC_TIME_MS);
 		WARN_ON(!time_after_eq(jiffies, timeout));
-		cfg80211_set_dfs_state(wiphy, &chandef, NL80211_DFS_AVAILABLE);
+		cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE);
 		break;
 	case NL80211_RADAR_CAC_ABORTED:
 		break;
@@ -796,6 +794,6 @@ void cfg80211_cac_event(struct net_device *netdev,
 	}
 	wdev->cac_started = false;
 
-	nl80211_radar_notify(rdev, &chandef, event, netdev, gfp);
+	nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
 }
 EXPORT_SYMBOL(cfg80211_cac_event);
-- 
1.7.9.5


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

* [PATCH 2/5] mac80211: DFS setup chandef for radar_event correctly
  2013-10-28 18:27 [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Janusz Dziedzic
@ 2013-10-28 18:27 ` Janusz Dziedzic
  2013-10-28 18:27 ` [PATCH 3/5] cfg80211: add helper functions for start/end freq Janusz Dziedzic
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Janusz Dziedzic @ 2013-10-28 18:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Janusz Dziedzic

Setup chandef for radar event correctly, before we
will clear this in ieee80211_dfs_cac_cancel() function.

Without this patch mac80211 will report wrong channel
width in case we will get radar event during active CAC.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 net/mac80211/util.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index f704415..c286d9b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2275,17 +2275,15 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work)
 {
 	struct ieee80211_local *local =
 		container_of(work, struct ieee80211_local, radar_detected_work);
-	struct cfg80211_chan_def chandef;
+	struct cfg80211_chan_def chandef = local->hw.conf.chandef;
 
 	ieee80211_dfs_cac_cancel(local);
 
 	if (local->use_chanctx)
 		/* currently not handled */
 		WARN_ON(1);
-	else {
-		chandef = local->hw.conf.chandef;
+	else
 		cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL);
-	}
 }
 
 void ieee80211_radar_detected(struct ieee80211_hw *hw)
-- 
1.7.9.5


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

* [PATCH 3/5] cfg80211: add helper functions for start/end freq
  2013-10-28 18:27 [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Janusz Dziedzic
  2013-10-28 18:27 ` [PATCH 2/5] mac80211: DFS setup chandef for radar_event correctly Janusz Dziedzic
@ 2013-10-28 18:27 ` Janusz Dziedzic
  2013-10-28 18:27 ` [PATCH 4/5] cfg80211: DFS check chandef usable before CAC Janusz Dziedzic
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Janusz Dziedzic @ 2013-10-28 18:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Janusz Dziedzic

Add helper fuctions for start/end freq.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 net/wireless/chan.c |   44 ++++++++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 14 deletions(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 16f3c3a..f74dae3 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -277,6 +277,32 @@ void cfg80211_set_dfs_state(struct wiphy *wiphy,
 				     width, dfs_state);
 }
 
+static u32 cfg80211_get_start_freq(u32 center_freq,
+				   u32 bandwidth)
+{
+	u32 start_freq;
+
+	if (bandwidth <= 20)
+		start_freq = center_freq;
+	else
+		start_freq = center_freq - bandwidth/2 + 10;
+
+	return start_freq;
+}
+
+static u32 cfg80211_get_end_freq(u32 center_freq,
+				 u32 bandwidth)
+{
+	u32 end_freq;
+
+	if (bandwidth <= 20)
+		end_freq = center_freq;
+	else
+		end_freq = center_freq + bandwidth/2 - 10;
+
+	return end_freq;
+}
+
 static int cfg80211_get_chans_dfs_required(struct wiphy *wiphy,
 					    u32 center_freq,
 					    u32 bandwidth)
@@ -284,13 +310,8 @@ static int cfg80211_get_chans_dfs_required(struct wiphy *wiphy,
 	struct ieee80211_channel *c;
 	u32 freq, start_freq, end_freq;
 
-	if (bandwidth <= 20) {
-		start_freq = center_freq;
-		end_freq = center_freq;
-	} else {
-		start_freq = center_freq - bandwidth/2 + 10;
-		end_freq = center_freq + bandwidth/2 - 10;
-	}
+	start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
+	end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
 
 	for (freq = start_freq; freq <= end_freq; freq += 20) {
 		c = ieee80211_get_channel(wiphy, freq);
@@ -337,13 +358,8 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
 	struct ieee80211_channel *c;
 	u32 freq, start_freq, end_freq;
 
-	if (bandwidth <= 20) {
-		start_freq = center_freq;
-		end_freq = center_freq;
-	} else {
-		start_freq = center_freq - bandwidth/2 + 10;
-		end_freq = center_freq + bandwidth/2 - 10;
-	}
+	start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
+	end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
 
 	for (freq = start_freq; freq <= end_freq; freq += 20) {
 		c = ieee80211_get_channel(wiphy, freq);
-- 
1.7.9.5


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

* [PATCH 4/5] cfg80211: DFS check chandef usable before CAC
  2013-10-28 18:27 [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Janusz Dziedzic
  2013-10-28 18:27 ` [PATCH 2/5] mac80211: DFS setup chandef for radar_event correctly Janusz Dziedzic
  2013-10-28 18:27 ` [PATCH 3/5] cfg80211: add helper functions for start/end freq Janusz Dziedzic
@ 2013-10-28 18:27 ` Janusz Dziedzic
  2013-10-31 16:46   ` Johannes Berg
  2013-10-28 18:27 ` [PATCH 5/5] cfg80211: fix dfs channel state after stopping AP Janusz Dziedzic
  2013-10-31 16:47 ` [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Johannes Berg
  4 siblings, 1 reply; 8+ messages in thread
From: Janusz Dziedzic @ 2013-10-28 18:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Janusz Dziedzic

Check chandef we get in CAC request is usable for CAC.
All channels have to be DFS channels. Allow DFS_USABLE
and DFS_AVAILABLE channels mix. At least one channel
has to be DFS_USABLE (require CAC).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 net/wireless/chan.c    |   75 ++++++++++++++++++++++++++++++++++++++++++++++++
 net/wireless/core.h    |   11 +++++++
 net/wireless/nl80211.c |    2 +-
 3 files changed, 87 insertions(+), 1 deletion(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index f74dae3..a6f5c4c 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -351,6 +351,81 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(cfg80211_chandef_dfs_required);
 
+static int cfg80211_get_chans_dfs_usable(struct wiphy *wiphy,
+					 u32 center_freq,
+					 u32 bandwidth)
+{
+	struct ieee80211_channel *c;
+	u32 freq, start_freq, end_freq;
+	int count = 0;
+
+	start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
+	end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
+
+	/*
+	 * Check entire range of channels for the bandwidth.
+	 * Check all channels are DFS channels (DFS_USABLE or
+	 * DFS_AVAILABLE). Return number of usable channels
+	 * (require CAC).
+	 */
+	for (freq = start_freq; freq <= end_freq; freq += 20) {
+		c = ieee80211_get_channel(wiphy, freq);
+		if (!c)
+			return -EINVAL;
+
+		if (c->flags & IEEE80211_CHAN_DISABLED)
+			return -EINVAL;
+
+		if (!(c->flags & IEEE80211_CHAN_RADAR))
+			return -EINVAL;
+
+		if (c->dfs_state == NL80211_DFS_UNAVAILABLE)
+			return -EINVAL;
+
+		if (c->dfs_state == NL80211_DFS_USABLE)
+			count++;
+	}
+
+	return count;
+}
+
+bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
+				 const struct cfg80211_chan_def *chandef)
+{
+	int width;
+	int r1, r2 = 0;
+
+	if (WARN_ON(!cfg80211_chandef_valid(chandef)))
+		return false;
+
+	width = cfg80211_chandef_get_width(chandef);
+	if (width < 0)
+		return false;
+
+	r1 = cfg80211_get_chans_dfs_usable(wiphy, chandef->center_freq1,
+					  width);
+
+	if (r1 < 0)
+		return false;
+
+	switch (chandef->width) {
+	case NL80211_CHAN_WIDTH_80P80:
+		WARN_ON(!chandef->center_freq2);
+		r2 = cfg80211_get_chans_dfs_usable(wiphy,
+						   chandef->center_freq2,
+						   width);
+		if (r2 < 0)
+			return false;
+		break;
+	default:
+		WARN_ON(chandef->center_freq2);
+		break;
+	}
+
+	return (r1 + r2 > 0);
+}
+
+
 static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
 					u32 center_freq, u32 bandwidth,
 					u32 prohibited_flags)
diff --git a/net/wireless/core.h b/net/wireless/core.h
index eb0f7a3..eb24a53 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -382,6 +382,17 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
 				 enum cfg80211_chan_mode chanmode,
 				 u8 radar_detect);
 
+/**
+ * cfg80211_chandef_dfs_usable - checks if chandef is usable and we can
+ * start CAC on such chandef.
+ * @wiphy: the wiphy to validate against
+ * @chandef: the channel definition to check
+ * Return: Return true if all channels available and at least
+ * one channel required CAC (NL80211_DFS_USABLE)
+ */
+bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
+				 const struct cfg80211_chan_def *chandef);
+
 void cfg80211_set_dfs_state(struct wiphy *wiphy,
 			    const struct cfg80211_chan_def *chandef,
 			    enum nl80211_dfs_state dfs_state);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cbbef88..1cb1cd9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5604,7 +5604,7 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
 	if (err == 0)
 		return -EINVAL;
 
-	if (chandef.chan->dfs_state != NL80211_DFS_USABLE)
+	if (!cfg80211_chandef_dfs_usable(wdev->wiphy, &chandef))
 		return -EINVAL;
 
 	if (!rdev->ops->start_radar_detection)
-- 
1.7.9.5


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

* [PATCH 5/5] cfg80211: fix dfs channel state after stopping AP
  2013-10-28 18:27 [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Janusz Dziedzic
                   ` (2 preceding siblings ...)
  2013-10-28 18:27 ` [PATCH 4/5] cfg80211: DFS check chandef usable before CAC Janusz Dziedzic
@ 2013-10-28 18:27 ` Janusz Dziedzic
  2013-10-31 16:46   ` Johannes Berg
  2013-10-31 16:47 ` [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Johannes Berg
  4 siblings, 1 reply; 8+ messages in thread
From: Janusz Dziedzic @ 2013-10-28 18:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Marek Puzyniak

From: Marek Puzyniak <marek.puzyniak@tieto.com>

This can be called when a mode of operation that can supports
initiating radiation on a DFS channel leaves that channel to
ensure that if the mode of operation is started again on it
that it will require a new channel availability check.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 include/net/cfg80211.h |   10 ++++++++++
 net/mac80211/cfg.c     |    6 ++++++
 net/wireless/mlme.c    |    7 +++++++
 3 files changed, 23 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8b52fcb..cc1ba48 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4135,6 +4135,16 @@ void cfg80211_cac_event(struct net_device *netdev,
 			struct cfg80211_chan_def *chandef,
 			enum nl80211_radar_event event, gfp_t gfp);
 
+/**
+ * cfg80211_leave_dfs_channel - Leaving dfs channel
+ * @wiphy: the wiphy
+ * @chandef: chandef for the current channel
+ *
+ * This function is called when dfs channel is being not used for diffrent
+ * reasons. Make channel DFS USABLE again.
+ */
+void cfg80211_leave_dfs_channel(struct wiphy *wiphy,
+				struct cfg80211_chan_def *chandef);
 
 /**
  * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5690d21..10778ae 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1096,6 +1096,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
 		cfg80211_cac_event(sdata->dev, &chandef,
 				   NL80211_RADAR_CAC_ABORTED,
 				   GFP_KERNEL);
+	} else if (sdata->radar_required) {
+		/*
+		 * AP stopped on DFS channel so change that channel state
+		 * to NL80211_DFS_USABLE again.
+		 */
+		cfg80211_leave_dfs_channel(wiphy, &sdata->vif.bss_conf.chandef);
 	}
 
 	drv_stop_ap(sdata->local, sdata);
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index a50c27b..c75b1d3 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -797,3 +797,10 @@ void cfg80211_cac_event(struct net_device *netdev,
 	nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
 }
 EXPORT_SYMBOL(cfg80211_cac_event);
+
+void cfg80211_leave_dfs_channel(struct wiphy *wiphy,
+				struct cfg80211_chan_def *chandef)
+{
+	cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_USABLE);
+}
+EXPORT_SYMBOL(cfg80211_leave_dfs_channel);
-- 
1.7.9.5


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

* Re: [PATCH 4/5] cfg80211: DFS check chandef usable before CAC
  2013-10-28 18:27 ` [PATCH 4/5] cfg80211: DFS check chandef usable before CAC Janusz Dziedzic
@ 2013-10-31 16:46   ` Johannes Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-10-31 16:46 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless

On Mon, 2013-10-28 at 19:27 +0100, Janusz Dziedzic wrote:

> +/**
> + * cfg80211_chandef_dfs_usable - checks if chandef is usable and we can
> + * start CAC on such chandef.

The short kernel-doc description can't span multiple lines

johannes


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

* Re: [PATCH 5/5] cfg80211: fix dfs channel state after stopping AP
  2013-10-28 18:27 ` [PATCH 5/5] cfg80211: fix dfs channel state after stopping AP Janusz Dziedzic
@ 2013-10-31 16:46   ` Johannes Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-10-31 16:46 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless, Marek Puzyniak

On Mon, 2013-10-28 at 19:27 +0100, Janusz Dziedzic wrote:

> +	} else if (sdata->radar_required) {
> +		/*
> +		 * AP stopped on DFS channel so change that channel state
> +		 * to NL80211_DFS_USABLE again.
> +		 */
> +		cfg80211_leave_dfs_channel(wiphy, &sdata->vif.bss_conf.chandef);

Would it make sense to just do this in cfg80211?

johannes


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

* Re: [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event
  2013-10-28 18:27 [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Janusz Dziedzic
                   ` (3 preceding siblings ...)
  2013-10-28 18:27 ` [PATCH 5/5] cfg80211: fix dfs channel state after stopping AP Janusz Dziedzic
@ 2013-10-31 16:47 ` Johannes Berg
  4 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-10-31 16:47 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless

I'd apply patches 1-3 but those don't seem very useful in themselves,
please resend the entire series when/if you address my comments.

johannes


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

end of thread, other threads:[~2013-10-31 16:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-28 18:27 [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Janusz Dziedzic
2013-10-28 18:27 ` [PATCH 2/5] mac80211: DFS setup chandef for radar_event correctly Janusz Dziedzic
2013-10-28 18:27 ` [PATCH 3/5] cfg80211: add helper functions for start/end freq Janusz Dziedzic
2013-10-28 18:27 ` [PATCH 4/5] cfg80211: DFS check chandef usable before CAC Janusz Dziedzic
2013-10-31 16:46   ` Johannes Berg
2013-10-28 18:27 ` [PATCH 5/5] cfg80211: fix dfs channel state after stopping AP Janusz Dziedzic
2013-10-31 16:46   ` Johannes Berg
2013-10-31 16:47 ` [PATCH 1/5] cfg80211/mac80211: DFS setup chandef for cac event Johannes Berg

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).