Search Linux Wireless

Re: [PATCH v5 3/3] mac80211: allow reservation of a running chanctx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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;
}


--
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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux