commit dca90abdc5046c1fd59b7fe7d533f9914ba91378
parent 4cee10ec503725c48482852489f7b0e5dae6e6fa
Author: James Prestwood <prestwoj@gmail.com>
Date: Fri, 15 Nov 2019 10:39:21 -0800
scan: add duration scan_parameters
The kernel allows a scan duration and duration mandatory flag to be
set in scan requests. RRM requests can contain these values so they
have been added to scan_parameters.
Scanning with drivers which do not support EXT_FEATURE_SET_SCAN_DWELL
will not include these values in scan requests.
Diffstat:
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/scan.c b/src/scan.c
@@ -396,6 +396,19 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc,
l_free(scan_rates);
}
+ if (wiphy_has_ext_feature(sc->wiphy,
+ NL80211_EXT_FEATURE_SET_SCAN_DWELL)) {
+ if (params->duration)
+ l_genl_msg_append_attr(msg,
+ NL80211_ATTR_MEASUREMENT_DURATION,
+ 2, ¶ms->duration);
+
+ if (params->duration_mandatory)
+ l_genl_msg_append_attr(msg,
+ NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY,
+ 0, NULL);
+ }
+
done:
return msg;
}
diff --git a/src/scan.h b/src/scan.h
@@ -81,9 +81,11 @@ struct scan_parameters {
const uint8_t *extra_ie;
size_t extra_ie_size;
struct scan_freq_set *freqs;
+ uint16_t duration;
bool flush : 1;
bool randomize_mac_addr_hint : 1;
bool no_cck_rates : 1;
+ bool duration_mandatory : 1;
const char *ssid; /* Used for direct probe request */
};