diff options
author | Thomas Pedersen <c_tpeder@qca.qualcomm.com> | 2012-06-21 14:09:54 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-06-26 03:32:28 -0400 |
commit | 88e920b4505105b710f8d4a535ec02c4078f8e2e (patch) | |
tree | f4e49c2b29fcd49e49b50aa9129dccd6d1654467 /net | |
parent | d0f718c1c0dfcb67f3af47a1fc4de7784974d1f7 (diff) |
nl80211: specify RSSI threshold in scheduled scan
Support configuring an RSSI threshold in dBm (s32) when requesting
scheduled scan, below which a BSS won't be reported by the cfg80211
driver.
Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/nl80211.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 888fadc4d63e..234ff3bbd104 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -340,6 +340,7 @@ static const struct nla_policy | |||
340 | nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = { | 340 | nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = { |
341 | [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY, | 341 | [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY, |
342 | .len = IEEE80211_MAX_SSID_LEN }, | 342 | .len = IEEE80211_MAX_SSID_LEN }, |
343 | [NL80211_SCHED_SCAN_MATCH_ATTR_RSSI] = { .type = NLA_U32 }, | ||
343 | }; | 344 | }; |
344 | 345 | ||
345 | /* ifidx get helper */ | 346 | /* ifidx get helper */ |
@@ -4387,7 +4388,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, | |||
4387 | nla_for_each_nested(attr, | 4388 | nla_for_each_nested(attr, |
4388 | info->attrs[NL80211_ATTR_SCHED_SCAN_MATCH], | 4389 | info->attrs[NL80211_ATTR_SCHED_SCAN_MATCH], |
4389 | tmp) { | 4390 | tmp) { |
4390 | struct nlattr *ssid; | 4391 | struct nlattr *ssid, *rssi; |
4391 | 4392 | ||
4392 | nla_parse(tb, NL80211_SCHED_SCAN_MATCH_ATTR_MAX, | 4393 | nla_parse(tb, NL80211_SCHED_SCAN_MATCH_ATTR_MAX, |
4393 | nla_data(attr), nla_len(attr), | 4394 | nla_data(attr), nla_len(attr), |
@@ -4403,6 +4404,12 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, | |||
4403 | request->match_sets[i].ssid.ssid_len = | 4404 | request->match_sets[i].ssid.ssid_len = |
4404 | nla_len(ssid); | 4405 | nla_len(ssid); |
4405 | } | 4406 | } |
4407 | rssi = tb[NL80211_SCHED_SCAN_MATCH_ATTR_RSSI]; | ||
4408 | if (rssi) | ||
4409 | request->rssi_thold = nla_get_u32(rssi); | ||
4410 | else | ||
4411 | request->rssi_thold = | ||
4412 | NL80211_SCAN_RSSI_THOLD_OFF; | ||
4406 | i++; | 4413 | i++; |
4407 | } | 4414 | } |
4408 | } | 4415 | } |