mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 04:32:37 +01:00
scan: Add scan_freq_set_merge API
This commit is contained in:
parent
e5baa98a32
commit
405785cd0b
16
src/scan.c
16
src/scan.c
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user