Search Linux Wireless

[PATCH] mac80211: set start_time_tsf/tsf_bssid for sw scans

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These values are already tracked so for the software scan path
we can set these into scan_info so NL80211 reports it in
TRIGGER_SCAN.

This patch also sets NL80211_EXT_FEATURE_SCAN_START_TIME in mac80211
if hw scanning is not available since driver support is not required.

Signed-off-by: James Prestwood <prestwoj@xxxxxxxxx>
---
 net/mac80211/main.c | 2 ++
 net/mac80211/scan.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 4c2702f128f3..ccbad5499e40 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -587,6 +587,8 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
 				      NL80211_EXT_FEATURE_SCAN_RANDOM_SN);
 		wiphy_ext_feature_set(wiphy,
 				      NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT);
+		wiphy_ext_feature_set(wiphy,
+				      NL80211_EXT_FEATURE_SCAN_START_TIME);
 	}
 
 	if (!ops->set_key)
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index adf94ba1ed77..2559ae76b97a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -700,6 +700,12 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 	else
 		memcpy(local->scan_addr, sdata->vif.addr, ETH_ALEN);
 
+	if (!hw_scan && sdata->vif.bss_conf.assoc) {
+		req->info.scan_start_tsf = req->scan_start;
+		ether_addr_copy(local->scan_info.tsf_bssid,
+				sdata->vif.bss_conf.bssid);
+	}
+
 	if (hw_scan) {
 		__set_bit(SCAN_HW_SCANNING, &local->scanning);
 	} else if ((req->n_channels == 1) &&
-- 
2.17.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux