linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Arend van Spriel <arend@broadcom.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [RFC V4 1/2] nl80211: add feature for BSS selection support
Date: Tue, 26 Jan 2016 14:56:34 +0100	[thread overview]
Message-ID: <1453816594.2759.70.camel@sipsolutions.net> (raw)
In-Reply-To: <1453813592-5266-2-git-send-email-arend@broadcom.com>

On Tue, 2016-01-26 at 14:06 +0100, Arend van Spriel wrote:
> 
> + * @behaviour: requested BSS selection behaviour.
> + * @param: parameters for requestion behaviour.
> + * @band_pref: preferred band for
> %NL80211_BSS_SELECT_ATTR_BAND_PREF.
> + * @adjust: parameters for %NL80211_BSS_SELECT_ATTR_RSSI_ADJUST.

Sadly, I don't think this works with kernel-doc. You'd have to split it
out into a named union to get this working properly.

> +/**
> + * enum nl80211_bss_select_attr - attributes for bss selection.
> + *
> + * @__NL80211_BSS_SELECT_ATTR_INVALID: reserved.
> + * @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection
> + * is requested.
> + * @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS
> + *> 	> selection should be done such that the specified band is preferred.
> + *> 	> When there are multiple BSS-es in the preferred band, the driver
> + *> 	> shall use RSSI-based BSS selection as a second step. The value of
> + *> 	> this attribute is according to &enum nl80211_band (u32).
> + * @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for
> + *> 	> BSS-es in the specified band is to be adjusted before doing
> + *> 	> RSSI-based BSS selection. The attribute value is a packed two-byte
> + *> 	> value. The lower byte contains the adjustment value (s8) and the
> + *	high byte contains the band according &enum nl80211_band.

I think it might be nicer to define an explicit struct for this, then
you don't have to use u8 for the band in one attribute and u32 for the
band in the other attribute either.

As long as there's no u64 in the struct that's pretty much safe - if
u64 is needed use compat_u64 :)

> + * @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number.
> + *@__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use.
> + *
> + * These attributes are found within %NL80211_ATTR_BSS_SELECT and
> + * indicate the required BSS selection behaviour which the driver
> + * should use.

You should probably indicate that only a single one can ever be
specified?

> +static const struct nla_policy
> +nl80211_bss_select_policy[NL80211_BSS_SELECT_ATTR_MAX + 1] = {
> +	[NL80211_BSS_SELECT_ATTR_RSSI] = { .type = NLA_FLAG },
> +	[NL80211_BSS_SELECT_ATTR_BAND_PREF] = { .type = NLA_U32 },
> +	[NL80211_BSS_SELECT_ATTR_RSSI_ADJUST] = { .type = NLA_U8 },

The RSSI_ADJUST here seems wrong in any case? Should've been NLA_U16
now?

> @@ -5753,6 +5778,42 @@ static int validate_scan_freqs(struct nlattr
> *freqs)
>  	return n_channels;
>  }
>  
> +static int parse_bss_select(struct nlattr *nla,
> +			    struct cfg80211_bss_selection
> *bss_select)
> +{
> +	struct nlattr *attr[NL80211_BSS_SELECT_ATTR_MAX + 1];
> +	u16 band_delta;
> +	int err;

This should perhaps reject specification of multiple attributes, since
otherwise the order of the code here dictates which one "wins".


But these are small things - looks good!

johannes

  reply	other threads:[~2016-01-26 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 13:06 [RFC V4 0/2] nl80211: allow configuration of BSS selection Arend van Spriel
2016-01-26 13:06 ` [RFC V4 1/2] nl80211: add feature for BSS selection support Arend van Spriel
2016-01-26 13:56   ` Johannes Berg [this message]
2016-01-27 21:53     ` Arend van Spriel
2016-01-28  9:50       ` Johannes Berg
2016-01-26 13:06 ` [RFC V4 2/2] brcmfmac: add support for nl80211 BSS_SELECT feature Arend van Spriel
2016-01-26 14:02   ` Johannes Berg

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=1453816594.2759.70.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arend@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).