Search Linux Wireless

Re: [PATCH v2 2/2] cfg80211: avoid reg-hints in self-managed only systems

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

 



Hi Arik,

On Thu, Jan 8, 2015 at 1:47 AM, Arik Nemtsov <arik@xxxxxxxxxx> wrote:
> When a system contains only self-managed regulatory devices all hints
> from the regulatory core are ignored. Stop hint processing early in this
> case. These systems usually don't have CRDA deployed, which results in
> endless (irrelevent) logs of the form:
> cfg80211: Calling CRDA to update world regulatory domain
>
> Make sure there's at least one self-managed device before discarding a
> hint, in order to prevent initial hints from disappearing on CRDA
> managed systems.
>
> Signed-off-by: Arik Nemtsov <arikx.nemtsov@xxxxxxxxx>
> ---
>  net/wireless/reg.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 521f3a4..588e45f 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -2120,6 +2120,26 @@ out_free:
>         reg_free_request(reg_request);
>  }
>
> +static bool reg_only_self_managed_wiphys(void)
> +{
> +       struct cfg80211_registered_device *rdev;
> +       struct wiphy *wiphy;
> +       bool self_managed_found = false;
> +
> +       ASSERT_RTNL();

Would it make sense to quickly return false here if the list is empty
rather than the whole mess with the new variable?

> +
> +       list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
> +               wiphy = &rdev->wiphy;
> +               if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)
> +                       self_managed_found = true;
> +               else
> +                       return false;
> +       }
> +
> +       /* make sure at least one self-managed wiphy exists */
> +       return self_managed_found;
> +}
> +
>  /*
>   * Processes regulatory hints, this is all the NL80211_REGDOM_SET_BY_*
>   * Regulatory hints come on a first come first serve basis and we

Thanks,

-- 
Julian Calaby

Email: julian.calaby@xxxxxxxxx
Profile: http://www.google.com/profiles/julian.calaby/
--
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