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.
This commit is contained in:
James Prestwood 2019-11-15 10:39:21 -08:00 committed by Denis Kenzior
parent 4cee10ec50
commit dca90abdc5
2 changed files with 15 additions and 0 deletions

View File

@ -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, &params->duration);
if (params->duration_mandatory)
l_genl_msg_append_attr(msg,
NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY,
0, NULL);
}
done:
return msg;
}

View File

@ -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 */
};