aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-05-28 15:47:41 +0200
committerJohannes Berg <johannes@sipsolutions.net>2018-06-15 13:34:40 +0200
commitb9771d41aee7aa3207b985422a1cc19e8342bc50 (patch)
tree13413533108492a4bb95aa282abf426fab1d707e /net/mac80211/main.c
parentnl80211: add scan features for improved scan privacy (diff)
downloadwireguard-linux-b9771d41aee7aa3207b985422a1cc19e8342bc50.tar.xz
wireguard-linux-b9771d41aee7aa3207b985422a1cc19e8342bc50.zip
mac80211: support scan features for improved scan privacy
Support the new random SN and minimal probe request contents scan flags for the case of software scan - for hardware scan the drivers need to opt in, but may need to do only that, depending on their implementation. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 4d2e797e3f16..a6f8e3a646d4 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -557,10 +557,19 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
wiphy_ext_feature_set(wiphy,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211);
- if (!ops->hw_scan)
+ if (!ops->hw_scan) {
wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN |
NL80211_FEATURE_AP_SCAN;
-
+ /*
+ * if the driver behaves correctly using the probe request
+ * (template) from mac80211, then both of these should be
+ * supported even with hw scan - but let drivers opt in.
+ */
+ wiphy_ext_feature_set(wiphy,
+ NL80211_EXT_FEATURE_SCAN_RANDOM_SN);
+ wiphy_ext_feature_set(wiphy,
+ NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT);
+ }
if (!ops->set_key)
wiphy->flags |= WIPHY_FLAG_IBSS_RSN;