From: Luca Coelho <luca@coelho.fi>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
sw@simonwunderlich.de, "Otcheretianski,
Andrei" <andrei.otcheretianski@intel.com>
Subject: Re: [PATCH v3 2/3] mac80211: implement chanctx reservation
Date: Tue, 04 Mar 2014 11:03:41 +0200 [thread overview]
Message-ID: <1393923821.13669.123.camel@dubbel> (raw)
In-Reply-To: <CA+BoTQnXUzJWfe3yoVoLDB=dSvZUsuCEVoX1UFk8KOBxzZr=6Q@mail.gmail.com>
On Mon, 2014-03-03 at 12:54 +0100, Michal Kazior wrote:
> On 28 February 2014 13:23, Luca Coelho <luca@coelho.fi> 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.
You're right. I'll add mode as an argument to this function in v4.
--
Luca
next prev parent reply other threads:[~2014-03-04 9:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 12:23 [PATCH v3 0/3] mac802111: channel context reservation Luca Coelho
2014-02-28 12:23 ` [PATCH v3 1/3] mac80211: split ieee80211_vif_change_channel in two Luca Coelho
2014-02-28 12:23 ` [PATCH v3 2/3] mac80211: implement chanctx reservation Luca Coelho
2014-03-03 11:54 ` Michal Kazior
2014-03-04 9:03 ` Luca Coelho [this message]
2014-03-03 12:46 ` Michal Kazior
2014-03-03 13:08 ` Luca Coelho
2014-02-28 12:23 ` [PATCH v3 3/3] mac80211: allow reservation of a running chanctx Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393923821.13669.123.camel@dubbel \
--to=luca@coelho.fi \
--cc=andrei.otcheretianski@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
--cc=sw@simonwunderlich.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox