Search Linux Wireless

Re: [RFC 2/2] cfg80211: check (VHT) bandwidth against regulatory

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

 



On Thu, 2012-12-13 at 23:46 +0100, Johannes Berg wrote:
> On Thu, 2012-12-13 at 14:34 -0800, Luis R. Rodriguez wrote:
> > On Mon, Dec 10, 2012 at 9:06 AM, Johannes Berg
> > <johannes@xxxxxxxxxxxxxxxx> wrote:
> > > On Thu, 2012-12-06 at 17:53 +0100, Johannes Berg wrote:
> > >
> > >> +bool reg_check_bandwidth(struct wiphy *wiphy,
> > >> +                      u32 center_freq_khz, u32 bw_khz)
> > >> +{
> > >> +     const struct ieee80211_reg_rule *reg_rule;
> > >> +
> > >> +     /*
> > >> +      * This interpretation is a bit of a strange quirk in the regulatory
> > >> +      * rules definitions that we have today: each 20 MHz channel must fit
> > >> +      * entirely into a single regulatory range, but if this range forbids
> > >> +      * using more than 20 MHz then it forbids even using a small part of
> > >> +      * this for the wider channel.
> > >> +      */
> > >> +
> > >> +     reg_rule = freq_reg_info(wiphy, center_freq_khz);
> > >> +     if (!IS_ERR(reg_rule))
> > >> +             return reg_rule->freq_range.max_bandwidth_khz >= bw_khz;
> > >
> > > This needs rcu_read_lock() obviously... Fixed in my version in the wip
> > > branch.
> > 
> > Looks good, the get_wiphy_regdom() change above seemed like it'd
> > belong on a separate patch though.
> 
> Humm, yeah, wtf. That belongs into the RCU change.

No actually it doesn't, though I could make it a separate patch with the
reg.c changes except for adding reg_check_bandwidth(), but that'd only
be something like "prepare to be able to use rcu protection for
freq_reg_info", I think I'll keep it this way but add some description.

johannes

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