nl80211/cfg80211: Specify band specific min RSSI thresholds with sched scan
PATCH v2 1/1 nl80211/cfg80211: Specify band specific min RSSI thresholds with sched scan
From: vamsi krishna <[email protected]>
This commit adds the support to specify the RSSI thresholds per band for each match set. This enhances the current behavior which specifies a single rssi_threshold across all the bands by introducing the rssi_threshold_per_band. These per band rssi thresholds are referred through NL80211_BAND_* (enum nl80211_band) variables as attribute types. Such attributes/values per each band are nested through NL80211_ATTR_SCHED_SCAN_MIN_RSSI. These band specific rssi thresholds shall take precedence over the current rssi_thold per match set.
Drivers indicate this support through %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These per band rssi attributes/values does not specify "default RSSI filter" as done by NL80211_SCHED_SCAN_MATCH_ATTR_RSSI to stay backward compatible. That said, these per band rssi values have to be specified for the corresponding matchset.
---
v2:
Per band rssi thresholds were defined as global for all the matchsets in v1. This version moves them to represent each matchset.
--- include/net/cfg80211.h | 8 ++++++++ include/uapi/linux/nl80211.h | 13 +++++++++++++ net/wireless/nl80211.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+)
include/net/cfg80211.h +8 -0
@@ -1831,11 +1831,19 @@ static inline void get_random_mask_addr(u8 *buf, const u8 *addr, const u8 *mask)* @bssid: BSSID to be matched; may be all-zero BSSID in case of SSID match * or no match (RSSI only) * @rssi_thold: don't report scan results below this threshold (in s32 dBm) +* @per_band_rssi_thold: Minimum rssi threshold for each band to be applied +* for filtering out scan results received. Drivers advertize this support +* of band specific rssi based filtering through the feature capability +* %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These band +* specific rssi thresholds take precedence over rssi_thold, if specified. +* If not specified for any band, it will be assigned with rssi_thold of +* corresponding matchset. */ struct cfg80211_match_set {struct cfg80211_ssid ssid;u8 bssid[ETH_ALEN ];s32 rssi_thold; +s32 per_band_rssi_thold[NUM_NL80211_BANDS ]; };/**
include/uapi/linux/nl80211.h +13 -0
@@ -3638,6 +3638,14 @@ enum nl80211_reg_rule_attr {* value as specified by &struct nl80211_bss_select_rssi_adjust. * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching * (this cannot be used together with SSID). +* @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the +* band specific minimum rssi thresholds for the bands defined in +* enum nl80211_band. The minimum rssi threshold value(s32) specific to a +* band shall be encapsulated in attribute with type value equals to one +* of the NL80211_BAND_* defined in enum nl80211_band. For example, the +* minimum rssi threshold value for 2.4GHZ band shall be encapsulated +* within an attribute of type NL80211_BAND_2GHZ. And one or more of such +* attributes will be nested within this attribute. * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter * attribute number currently defined * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
@@ -3650,6 +3658,7 @@ enum nl80211_sched_scan_match_attr {NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI ,NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST ,NL80211_SCHED_SCAN_MATCH_ATTR_BSSID , +NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI ,/* keep last */ __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
@@ -5343,6 +5352,9 @@ enum nl80211_feature_flags {* @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching * (set/del PMKSA operations) in AP mode. * +* @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports +* filtering of sched scan results using band specific RSSI thresholds. +* * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */
@@ -5384,6 +5396,7 @@ enum nl80211_ext_feature_index {NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER ,NL80211_EXT_FEATURE_AIRTIME_FAIRNESS ,NL80211_EXT_FEATURE_AP_PMKSA_CACHING , +NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD ,/* add new features before the definition below */ NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c +45 -0
63 lines not on this page · raw message
Signature · 1 line
1.9.1