3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-18 18:29:29 +01:00

scan: Add scan_freq_set_merge API

This commit is contained in:
Tim Kourt 2019-03-22 14:17:44 -07:00 committed by Denis Kenzior
parent e5baa98a32
commit 405785cd0b
2 changed files with 18 additions and 0 deletions

View File

@ -1657,6 +1657,22 @@ uint32_t scan_freq_set_get_bands(struct scan_freq_set *freqs)
return bands;
}
static void scan_channels_5ghz_add(uint32_t channel, void *user_data)
{
struct l_uintset *to = user_data;
l_uintset_put(to, channel);
}
void scan_freq_set_merge(struct scan_freq_set *to,
const struct scan_freq_set *from)
{
to->channels_2ghz |= from->channels_2ghz;
l_uintset_foreach(from->channels_5ghz, scan_channels_5ghz_add,
to->channels_5ghz);
}
struct channels_5ghz_foreach_data {
scan_freq_set_func_t func;
void *user_data;

View File

@ -123,6 +123,8 @@ bool scan_freq_set_contains(struct scan_freq_set *freqs, uint32_t freq);
uint32_t scan_freq_set_get_bands(struct scan_freq_set *freqs);
void scan_freq_set_foreach(const struct scan_freq_set *freqs,
scan_freq_set_func_t func, void *user_data);
void scan_freq_set_merge(struct scan_freq_set *to,
const struct scan_freq_set *from);
bool scan_ifindex_add(uint32_t ifindex);
bool scan_ifindex_remove(uint32_t ifindex);