mac80211: add support for radar detection for reservations
authorMichal Kazior <michal.kazior@tieto.com>
Wed, 9 Apr 2014 13:29:25 +0000 (15:29 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 25 Apr 2014 15:08:15 +0000 (17:08 +0200)
Initial chanctx reservation code wasn't aware of
radar detection requirements. This is necessary
for chanctx reservations to be used for channel
switching in the future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/chan.c
net/mac80211/ieee80211_i.h

index fcb2cd8ffd0733b3818605c6bfd532e07bb6d929..4ed229c0966ab144bf15ba6b1442646e2bec8e7c 100644 (file)
@@ -742,7 +742,8 @@ int ieee80211_vif_unreserve_chanctx(struct ieee80211_sub_if_data *sdata)
 
 int ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
                                  const struct cfg80211_chan_def *chandef,
-                                 enum ieee80211_chanctx_mode mode)
+                                 enum ieee80211_chanctx_mode mode,
+                                 bool radar_required)
 {
        struct ieee80211_local *local = sdata->local;
        struct ieee80211_chanctx_conf *conf;
@@ -786,6 +787,7 @@ int ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
        new_ctx->refcount++;
        sdata->reserved_chanctx = new_ctx;
        sdata->reserved_chandef = *chandef;
+       sdata->reserved_radar_required = radar_required;
 out:
        mutex_unlock(&local->chanctx_mtx);
        return ret;
@@ -830,6 +832,7 @@ int ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata,
        /* unref our reservation */
        ctx->refcount--;
        sdata->reserved_chanctx = NULL;
+       sdata->radar_required = sdata->reserved_radar_required;
 
        if (old_ctx == ctx) {
                /* This is our own context, just change it */
index bfc3ca506fbd014a106577b7c43102058b48a2c3..4018ba13c0288fd262eb195f460c3daf0aace40b 100644 (file)
@@ -759,6 +759,7 @@ struct ieee80211_sub_if_data {
        /* context reservation -- protected with chanctx_mtx */
        struct ieee80211_chanctx *reserved_chanctx;
        struct cfg80211_chan_def reserved_chandef;
+       bool reserved_radar_required;
 
        /* used to reconfigure hardware SM PS */
        struct work_struct recalc_smps;
@@ -1777,7 +1778,8 @@ ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
 int __must_check
 ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
                              const struct cfg80211_chan_def *chandef,
-                             enum ieee80211_chanctx_mode mode);
+                             enum ieee80211_chanctx_mode mode,
+                             bool radar_required);
 int __must_check
 ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata,
                                   u32 *changed);