summaryrefslogtreecommitdiff
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-10-10 14:43:23 +0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-10 19:08:33 +0400
commit486cf4c08fe8b2b049bfccb76ce445ec1088fa25 (patch)
treec9080b814add0e48d5f4963f9516cbe0505480c9 /net/mac80211/util.c
parent408b18abf677841f49d64ceb884e2b196ca1cf05 (diff)
downloadlinux-486cf4c08fe8b2b049bfccb76ce445ec1088fa25.tar.xz
mac80211: enable DFS with channel contexts
It is okay to enable DFS for channel contexts based drivers as long as no combination advertises radar detection and multi-channel operation at the same time. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 3c61060a4d2b..c76c9d7294ae 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2526,11 +2526,23 @@ 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 = local->hw.conf.chandef;
+ struct ieee80211_chanctx *ctx;
+ int num_chanctx = 0;
+
+ mutex_lock(&local->chanctx_mtx);
+ list_for_each_entry(ctx, &local->chanctx_list, list) {
+ if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER)
+ continue;
+
+ num_chanctx++;
+ chandef = ctx->conf.def;
+ }
+ mutex_unlock(&local->chanctx_mtx);
ieee80211_dfs_cac_cancel(local);
- if (local->use_chanctx)
- /* currently not handled */
+ if (num_chanctx > 1)
+ /* XXX: multi-channel is not supported yet */
WARN_ON(1);
else
cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL);