From: Joe Perches <joe@perches.com>
To: Luca Coelho <lrothc@gmail.com>
Cc: Michal Kazior <michal.kazior@tieto.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
sw@simonwunderlich.de, "Otcheretianski,
Andrei" <andrei.otcheretianski@intel.com>
Subject: Re: [PATCH v5 3/3] mac80211: allow reservation of a running chanctx
Date: Fri, 07 Mar 2014 12:19:49 -0800 [thread overview]
Message-ID: <1394223589.16156.83.camel@joe-AO722> (raw)
In-Reply-To: <1394174602.4192.7.camel@dubbel>
On Fri, 2014-03-07 at 08:43 +0200, Luca Coelho wrote:
> On Wed, 2014-03-05 at 12:32 +0100, Michal Kazior wrote:
> > On 5 March 2014 12:11, Luca Coelho <luca@coelho.fi> wrote:
> > > With single-channel drivers, we need to be able to change a running
> > > chanctx if we want to use chanctx reservation. Not all drivers may be
> > > able to do this, so add a flag that indicates support for it.
[]
> > > diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
[]
> > > @@ -162,6 +162,26 @@ static void ieee80211_change_chanctx(struct ieee80211_local *local,
> > > }
> > > }
> > >
> > > +static bool ieee80211_chanctx_is_reserved(struct ieee80211_local *local,
> > > + struct ieee80211_chanctx *ctx)
> > > +{
> > > + struct ieee80211_sub_if_data *sdata;
> > > + bool ret = false;
> > > +
> > > + lockdep_assert_held(&local->chanctx_mtx);
> > > + rcu_read_lock();
> > > + list_for_each_entry_rcu(sdata, &local->interfaces, list) {
> > > + if (sdata->reserved_chanctx == ctx) {
> > > + ret = true;
> > > + goto out;
> > > + }
> > > + }
> > > +
> > > +out:
> > > + rcu_read_unlock();
> > > + return false;
> >
> > `return ret` ;-)
>
> Gack! I'll fix.
trivia: using break is more traditional
static bool ieee80211_chanctx_is_reserved(struct ieee80211_local *local,
struct ieee80211_chanctx *ctx)
{
struct ieee80211_sub_if_data *sdata;
bool reserved = false;
lockdep_assert_held(&local->chanctx_mtx);
rcu_read_lock();
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
if (sdata->reserved_chanctx == ctx) {
reserved = true;
break;
}
}
rcu_read_unlock();
return reserved;
}
next prev parent reply other threads:[~2014-03-07 20:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 11:11 [PATCH v5 0/3] mac802111: channel context reservation Luca Coelho
2014-03-05 11:11 ` [PATCH v5 1/3] mac80211: split ieee80211_vif_change_channel in two Luca Coelho
2014-03-05 11:11 ` [PATCH v5 2/3] mac80211: implement chanctx reservation Luca Coelho
2014-03-05 12:04 ` Michal Kazior
2014-03-07 6:48 ` Luca Coelho
2014-03-10 7:03 ` Michal Kazior
2014-03-10 9:08 ` Luca Coelho
2014-03-10 9:18 ` Michal Kazior
2014-03-05 11:11 ` [PATCH v5 3/3] mac80211: allow reservation of a running chanctx Luca Coelho
2014-03-05 11:32 ` Michal Kazior
2014-03-07 6:43 ` Luca Coelho
2014-03-07 20:19 ` Joe Perches [this message]
2014-03-09 13:38 ` 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=1394223589.16156.83.camel@joe-AO722 \
--to=joe@perches.com \
--cc=andrei.otcheretianski@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=lrothc@gmail.com \
--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