diff options
author | Luciano Coelho <coelho@ti.com> | 2011-08-31 09:01:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-13 15:53:45 -0400 |
commit | a1f1c21c181be20a8b7e073e5292ff1fe77769fa (patch) | |
tree | 8b8e46d1dba26f4ef45d4e4d969cbda524d8a4c1 /include/linux/nl80211.h | |
parent | cedb5412baeffd7326fc4869aa996d7f68d98ebb (diff) |
nl80211/cfg80211: add match filtering for sched_scan
Introduce filtering for scheduled scans to reduce the number of
unnecessary results (which cause useless wake-ups).
Add a new nested attribute where sets of parameters to be matched can
be passed when starting a scheduled scan. Only scan results that
match any of the sets will be returned.
At this point, the set consists of a single parameter, an SSID. This
can be easily extended in the future to support more complex matches.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/nl80211.h')
-rw-r--r-- | include/linux/nl80211.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 387e6e220502..8aa7badc1966 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -769,6 +769,8 @@ enum nl80211_commands { | |||
769 | * that can be added to a scan request | 769 | * that can be added to a scan request |
770 | * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information | 770 | * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information |
771 | * elements that can be added to a scheduled scan request | 771 | * elements that can be added to a scheduled scan request |
772 | * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be | ||
773 | * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute. | ||
772 | * | 774 | * |
773 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 775 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
774 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 776 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
@@ -1011,6 +1013,24 @@ enum nl80211_commands { | |||
1011 | 1013 | ||
1012 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan | 1014 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan |
1013 | * cycles, in msecs. | 1015 | * cycles, in msecs. |
1016 | |||
1017 | * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more | ||
1018 | * sets of attributes to match during scheduled scans. Only BSSs | ||
1019 | * that match any of the sets will be reported. These are | ||
1020 | * pass-thru filter rules. | ||
1021 | * For a match to succeed, the BSS must match all attributes of a | ||
1022 | * set. Since not every hardware supports matching all types of | ||
1023 | * attributes, there is no guarantee that the reported BSSs are | ||
1024 | * fully complying with the match sets and userspace needs to be | ||
1025 | * able to ignore them by itself. | ||
1026 | * Thus, the implementation is somewhat hardware-dependent, but | ||
1027 | * this is only an optimization and the userspace application | ||
1028 | * needs to handle all the non-filtered results anyway. | ||
1029 | * If the match attributes don't make sense when combined with | ||
1030 | * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID | ||
1031 | * is included in the probe request, but the match attributes | ||
1032 | * will never let it go through), -EINVAL may be returned. | ||
1033 | * If ommited, no filtering is done. | ||
1014 | * | 1034 | * |
1015 | * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported | 1035 | * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported |
1016 | * interface combinations. In each nested item, it contains attributes | 1036 | * interface combinations. In each nested item, it contains attributes |
@@ -1265,6 +1285,9 @@ enum nl80211_attrs { | |||
1265 | 1285 | ||
1266 | NL80211_ATTR_ROAM_SUPPORT, | 1286 | NL80211_ATTR_ROAM_SUPPORT, |
1267 | 1287 | ||
1288 | NL80211_ATTR_SCHED_SCAN_MATCH, | ||
1289 | NL80211_ATTR_MAX_MATCH_SETS, | ||
1290 | |||
1268 | /* add attributes here, update the policy in nl80211.c */ | 1291 | /* add attributes here, update the policy in nl80211.c */ |
1269 | 1292 | ||
1270 | __NL80211_ATTR_AFTER_LAST, | 1293 | __NL80211_ATTR_AFTER_LAST, |
@@ -1724,6 +1747,26 @@ enum nl80211_reg_rule_attr { | |||
1724 | }; | 1747 | }; |
1725 | 1748 | ||
1726 | /** | 1749 | /** |
1750 | * enum nl80211_sched_scan_match_attr - scheduled scan match attributes | ||
1751 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved | ||
1752 | * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, | ||
1753 | * only report BSS with matching SSID. | ||
1754 | * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter | ||
1755 | * attribute number currently defined | ||
1756 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use | ||
1757 | */ | ||
1758 | enum nl80211_sched_scan_match_attr { | ||
1759 | __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, | ||
1760 | |||
1761 | NL80211_ATTR_SCHED_SCAN_MATCH_SSID, | ||
1762 | |||
1763 | /* keep last */ | ||
1764 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, | ||
1765 | NL80211_SCHED_SCAN_MATCH_ATTR_MAX = | ||
1766 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 | ||
1767 | }; | ||
1768 | |||
1769 | /** | ||
1727 | * enum nl80211_reg_rule_flags - regulatory rule flags | 1770 | * enum nl80211_reg_rule_flags - regulatory rule flags |
1728 | * | 1771 | * |
1729 | * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed | 1772 | * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed |