linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Luciano Coelho <coelho@ti.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] nl80211/cfg80211: add ssid filtering for sched_scan
Date: Tue, 30 Aug 2011 16:16:52 +0200	[thread overview]
Message-ID: <1314713812.4011.33.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1314707979-26484-1-git-send-email-coelho@ti.com>

On Tue, 2011-08-30 at 15:39 +0300, Luciano Coelho wrote:

> + * @NL80211_ATTR_MAX_FILTER_SSIDS: number of SSIDs you can use as
> + *	filters in a scheduled scan request, a wiphy attribute.

When we add more filters, hopefully the number of filters will stay be
this? IOW, shouldn't this be "MAX_FILTERS"? Basically, each filter can
be thought of as a profile, and a profile can contain various attributes
that must match, I think?

> + * @NL80211_ATTR_SCHED_SCAN_FILTER: Nested attribute with various
> + *	types of filtering to be used with scheduled scans.
> + *	If @NL80211_ATTR_SCAN_SSIDS is passed with values that are not
> + *	included in the filter, the driver may return -EINVAL, since
> + *	it doesn't make sense to send probe requests with SSIDs that
> + *	will be filtered out.  This doesn't apply to the wildcard SSID.
> + *	If ommited, no filtering is done.

Maybe cfg80211 should just apply that rule anyway? But is that really
true anyway? Say "DIRECT-" as the P2P wildcard ...

> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index a37f264..a3e58ff 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -882,6 +882,9 @@ struct cfg80211_scan_request {
>   * @interval: interval between each scheduled scan cycle
>   * @ie: optional information element(s) to add into Probe Request or %NULL
>   * @ie_len: length of ie in octets
> + * @filter_ssids: SSIDs to pass to the host (others are filtered out).
> + * 	If ommited, no filtering is done.
> + * @n_filter_ssids: number of filter SSIDs

Maybe we should create a filter struct right away and use that with
filters/n_filters?

> +++ b/net/wireless/nl80211.c
> @@ -189,6 +189,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
>  					 .len = IEEE80211_MAX_DATA_LEN },
>  	[NL80211_ATTR_IE_ASSOC_RESP] = { .type = NLA_BINARY,
>  					 .len = IEEE80211_MAX_DATA_LEN },
> +	[NL80211_ATTR_SCHED_SCAN_FILTER] = { .type = NLA_NESTED },
>  };

Don't we need a policy for the filter attributes?

> +	if (info->attrs[NL80211_ATTR_SCHED_SCAN_FILTER]) {
> +		attr = nla_find_nested(info->attrs[NL80211_ATTR_SCHED_SCAN_FILTER],
> +				       NL80211_ATTR_SCHED_SCAN_FILTER_SSID);
> +		if (attr)
> +			nla_for_each_nested(attr2, attr, tmp)
> +				n_filter_ssids++;
> +	}
> +
> +	if (n_filter_ssids > wiphy->max_filter_ssids)
> +		return -EINVAL;

That looks a little odd. What does that even do? I don't understand the
find_nested at all.

johannes


  reply	other threads:[~2011-08-30 14:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 12:39 [PATCH] nl80211/cfg80211: add ssid filtering for sched_scan Luciano Coelho
2011-08-30 14:16 ` Johannes Berg [this message]
2011-08-30 15:27   ` Luciano Coelho
2011-08-30 16:09     ` Johannes Berg
2011-08-31  6:09       ` Luciano Coelho
2011-08-31  6:20         ` Johannes Berg
2011-08-31  7:30           ` Luciano Coelho
2011-08-31  7:39             ` Johannes Berg
2011-08-31  7:49               ` Luciano Coelho
2011-08-31  7:53                 ` Johannes Berg
2011-08-31  7:54                   ` Johannes Berg
2011-08-31  8:03                     ` Luciano Coelho
2011-08-31  8:08                   ` Luciano Coelho

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=1314713812.4011.33.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=coelho@ti.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).