On 28 February 2014 13:23, Luca Coelho <luca@xxxxxxxxx> wrote: [...] > +int ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata, > + const struct cfg80211_chan_def *chandef) > +{ > + struct ieee80211_local *local = sdata->local; > + struct ieee80211_chanctx_conf *conf; > + struct ieee80211_chanctx *new_ctx, *curr_ctx; > + int ret = 0; > + > + mutex_lock(&local->chanctx_mtx); > + > + conf = rcu_dereference_protected(sdata->vif.chanctx_conf, > + lockdep_is_held(&local->chanctx_mtx)); > + if (!conf) { > + ret = -EINVAL; > + goto out; > + } > + > + curr_ctx = container_of(conf, struct ieee80211_chanctx, conf); > + > + /* try to find another context with the chandef we want */ > + new_ctx = ieee80211_find_chanctx(local, chandef, > + IEEE80211_CHANCTX_SHARED); > + if (!new_ctx) { > + /* create a new context */ > + new_ctx = ieee80211_new_chanctx(local, chandef, > + IEEE80211_CHANCTX_SHARED); Shouldn't you use curr_ctx->mode here instead of SHARED? Or perhaps the function should take `mode` argument.. For CSA it's probably okay to just use curr_ctx->mode, but for a more generic reservation it should probably be an argument. Michał -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html