linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Arik Nemtsov <arik@wizery.com>
Cc: linux-wireless@vger.kernel.org, "Luis R. Rodriguez" <mcgrof@suse.com>
Subject: Re: [PATCH v8 1/4] cfg80211: allow usermode to query wiphy specific regdom
Date: Fri, 12 Dec 2014 13:37:55 +0100	[thread overview]
Message-ID: <1418387875.2470.31.camel@sipsolutions.net> (raw)
In-Reply-To: <1417622897-30768-1-git-send-email-arik@wizery.com> (sfid-20141203_170816_721996_A0EB392E)

On Wed, 2014-12-03 at 18:08 +0200, Arik Nemtsov wrote:

>   * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
> - * 	regulatory domain.
> + *	regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device
> + *	has a private regulatory domain, it will be returned. Otherwise, the
> + *	global regdomain will be returned.
> + *	A device will have a private regulatory domain if it uses the
> + *	regulatory_hint() API. Even when a private regdomain is used the channel
> + *	information will still be mended according to further hints from
> + *	the regulatory core to help with compliance.

I think you need to document the new availability of the dump version of
this now.

> +	if (!regdom && !cfg80211_regdomain) {

I'm not sure why sparse doesn't warn here, but I think that should
probably use rcu_access_pointer(cfg80211_regdomain).

More realistically, the regdomain can never be NULL I think, so is that
even needed? OTOH, if it can be NULL, then you must make this check
after the rcu_dereference, which would make this code easier to follow.

> +		nlmsg_free(msg);
> +		return -EINVAL;
> +	}
> +
> +	if (!wiphy && reg_last_request_cell_base() &&
> +	    nla_put_u32(msg, NL80211_ATTR_USER_REG_HINT_TYPE,
> +			NL80211_USER_REG_HINT_CELL_BASE))
> +		goto nla_put_failure;
> +
> +	rcu_read_lock();
> +
> +	if (!regdom)
> +		regdom = rcu_dereference(cfg80211_regdomain);

i.e. move the check into this if here

johannes


  parent reply	other threads:[~2014-12-12 12:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 16:08 [PATCH v8 1/4] cfg80211: allow usermode to query wiphy specific regdom Arik Nemtsov
2014-12-03 16:08 ` [PATCH v8 2/4] cfg80211: allow wiphy specific regdomain management Arik Nemtsov
2014-12-12 12:39   ` Johannes Berg
2014-12-15 17:12     ` Arik Nemtsov
2014-12-15 18:41       ` Johannes Berg
2014-12-15 19:28         ` Arik Nemtsov
2014-12-03 16:08 ` [PATCH v8 3/4] cfg80211: return private regdom for self-managed devices Arik Nemtsov
2014-12-03 16:08 ` [PATCH v8 4/4] cfg80211: correctly check ad-hoc channels Arik Nemtsov
2014-12-12 12:40   ` Johannes Berg
2014-12-12 12:37 ` Johannes Berg [this message]
2014-12-15 17:07   ` [PATCH v8 1/4] cfg80211: allow usermode to query wiphy specific regdom Arik Nemtsov

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=1418387875.2470.31.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arik@wizery.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).