mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-23 20:54:14 +01:00
scan: Add flag to flush case when starting a scan
Add a flush flag to scan_parameters to tell the kernel to flush the cache of scan results before the new scan. Use this flag in the active scan during roaming.
This commit is contained in:
parent
3a4887fef4
commit
95e6623011
@ -783,7 +783,7 @@ static void device_roam_scan_destroy(void *userdata)
|
||||
static void device_roam_scan(struct device *device,
|
||||
struct scan_freq_set *freq_set)
|
||||
{
|
||||
struct scan_parameters params = { .freqs = freq_set };
|
||||
struct scan_parameters params = { .freqs = freq_set, .flush = true };
|
||||
|
||||
/* Use an active scan to save time */
|
||||
device->roam_scan_id = scan_active_full(device->index, ¶ms,
|
||||
|
@ -285,13 +285,14 @@ static struct l_genl_msg *scan_build_cmd(uint32_t ifindex, bool passive,
|
||||
{
|
||||
struct l_genl_msg *msg;
|
||||
int n_channels = 0;
|
||||
uint32_t flags = 0;
|
||||
|
||||
if (params->freqs)
|
||||
scan_freq_set_foreach(params->freqs, scan_freq_count,
|
||||
&n_channels);
|
||||
|
||||
msg = l_genl_msg_new_sized(NL80211_CMD_TRIGGER_SCAN,
|
||||
32 + params->extra_ie_size +
|
||||
64 + params->extra_ie_size +
|
||||
4 * n_channels);
|
||||
l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &ifindex);
|
||||
|
||||
@ -309,6 +310,12 @@ static struct l_genl_msg *scan_build_cmd(uint32_t ifindex, bool passive,
|
||||
if (params->freqs)
|
||||
scan_build_attr_scan_frequencies(msg, params->freqs);
|
||||
|
||||
if (params->flush)
|
||||
flags |= NL80211_SCAN_FLAG_FLUSH;
|
||||
|
||||
if (flags)
|
||||
l_genl_msg_append_attr(msg, NL80211_ATTR_SCAN_FLAGS, 4, &flags);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ struct scan_parameters {
|
||||
const uint8_t *extra_ie;
|
||||
size_t extra_ie_size;
|
||||
struct scan_freq_set *freqs;
|
||||
bool flush : 1;
|
||||
};
|
||||
|
||||
uint32_t scan_passive(uint32_t ifindex, scan_trigger_func_t trigger,
|
||||
|
Loading…
Reference in New Issue
Block a user