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>
This commit is contained in:

committed by
John W. Linville

parent
cedb5412ba
commit
a1f1c21c18
@@ -875,6 +875,15 @@ struct cfg80211_scan_request {
|
||||
struct ieee80211_channel *channels[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_match_set - sets of attributes to match
|
||||
*
|
||||
* @ssid: SSID to be matched
|
||||
*/
|
||||
struct cfg80211_match_set {
|
||||
struct cfg80211_ssid ssid;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_sched_scan_request - scheduled scan request description
|
||||
*
|
||||
@@ -884,6 +893,11 @@ 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
|
||||
* @match_sets: sets of parameters to be matched for a scan result
|
||||
* entry to be considered valid and to be passed to the host
|
||||
* (others are filtered out).
|
||||
* If ommited, all results are passed.
|
||||
* @n_match_sets: number of match sets
|
||||
* @wiphy: the wiphy this was for
|
||||
* @dev: the interface
|
||||
* @channels: channels to scan
|
||||
@@ -895,6 +909,8 @@ struct cfg80211_sched_scan_request {
|
||||
u32 interval;
|
||||
const u8 *ie;
|
||||
size_t ie_len;
|
||||
struct cfg80211_match_set *match_sets;
|
||||
int n_match_sets;
|
||||
|
||||
/* internal */
|
||||
struct wiphy *wiphy;
|
||||
@@ -1814,6 +1830,9 @@ struct wiphy_wowlan_support {
|
||||
* any given scan
|
||||
* @max_sched_scan_ssids: maximum number of SSIDs the device can scan
|
||||
* for in any given scheduled scan
|
||||
* @max_match_sets: maximum number of match sets the device can handle
|
||||
* when performing a scheduled scan, 0 if filtering is not
|
||||
* supported.
|
||||
* @max_scan_ie_len: maximum length of user-controlled IEs device can
|
||||
* add to probe request frames transmitted during a scan, must not
|
||||
* include fixed IEs like supported rates
|
||||
@@ -1871,6 +1890,7 @@ struct wiphy {
|
||||
int bss_priv_size;
|
||||
u8 max_scan_ssids;
|
||||
u8 max_sched_scan_ssids;
|
||||
u8 max_match_sets;
|
||||
u16 max_scan_ie_len;
|
||||
u16 max_sched_scan_ie_len;
|
||||
|
||||
|
Reference in New Issue
Block a user