aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-02 21:03:31 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-02 21:03:31 (GMT)
commit949938aadf54735f29c340caf667e7505840b3c7 (patch)
treeaacfeedfced0f7ba25e0af3578ab4a499264c673 /src
parenta1a31b6c3f9f87f87e232a819065042c85092726 (diff)
downloadhostap-949938aadf54735f29c340caf667e7505840b3c7.zip
hostap-949938aadf54735f29c340caf667e7505840b3c7.tar.gz
hostap-949938aadf54735f29c340caf667e7505840b3c7.tar.bz2
Ask driver to report only new scan results if requested
If the BSS table within wpa_supplicant is flushed, request the driver to flush its own scan result table during the next scan. This can avoid unexpected old BSS entries showing up after BSS_FLUSH or FLUSH command in cases where the driver may maintain its internal cache of scan results (e.g., cfg80211 BSS table persists at least for 15 seconds). In addition to doing this automatically on BSS_FLUSH/FLUSH, a new SCAN command argument, only_new=1, can be used to request a manual scan request to do same. Though, it should be noted that this maintains the BSS table within wpa_supplicant. BSS_FLUSH followed by SCAN command can be used to clear all BSS entries from both the driver and wpa_supplicant. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h9
-rw-r--r--src/drivers/driver_nl80211.c6
2 files changed, 15 insertions, 0 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index b4442be..4e5ab34 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -340,6 +340,15 @@ struct wpa_driver_scan_params {
* and not to transmit the frames at any of those rates.
*/
u8 p2p_probe;
+
+ /**
+ * only_new_results - Request driver to report only new results
+ *
+ * This is used to request the driver to report only BSSes that have
+ * been detected after this scan request has been started, i.e., to
+ * flush old cached BSS entries.
+ */
+ int only_new_results;
};
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 5aa6925..6c4c816 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4679,6 +4679,12 @@ nl80211_scan_common(struct wpa_driver_nl80211_data *drv, u8 cmd,
params->filter_ssids = NULL;
drv->num_filter_ssids = params->num_filter_ssids;
+ if (params->only_new_results) {
+ wpa_printf(MSG_DEBUG, "nl80211: Add NL80211_SCAN_FLAG_FLUSH");
+ NLA_PUT_U32(msg, NL80211_ATTR_SCAN_FLAGS,
+ NL80211_SCAN_FLAG_FLUSH);
+ }
+
return msg;
fail: