mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-19 10:02:33 +01:00
network: add __network_path_append_bss
To reduce code duplication and prepare for moving the BSS interface to station, add a new API so station can create a BSS path without a network object directly.
This commit is contained in:
parent
7604762013
commit
514e483bc3
@ -1130,17 +1130,23 @@ bool network_update_known_frequencies(struct network *network)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *network_bss_get_path(const struct network *network,
|
const char *__network_path_append_bss(const char *network_path,
|
||||||
const struct scan_bss *bss)
|
const struct scan_bss *bss)
|
||||||
{
|
{
|
||||||
static char path[256];
|
static char path[256];
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%02x%02x%02x%02x%02x%02x",
|
snprintf(path, sizeof(path), "%s/%02x%02x%02x%02x%02x%02x",
|
||||||
network->object_path, MAC_STR(bss->addr));
|
network_path, MAC_STR(bss->addr));
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *network_bss_get_path(const struct network *network,
|
||||||
|
const struct scan_bss *bss)
|
||||||
|
{
|
||||||
|
return __network_path_append_bss(network->object_path, bss);
|
||||||
|
}
|
||||||
|
|
||||||
static bool network_unregister_bss(void *a, void *user_data)
|
static bool network_unregister_bss(void *a, void *user_data)
|
||||||
{
|
{
|
||||||
struct scan_bss *bss = a;
|
struct scan_bss *bss = a;
|
||||||
|
@ -77,6 +77,9 @@ const char *network_bss_get_path(const struct network *network,
|
|||||||
const struct scan_bss *bss);
|
const struct scan_bss *bss);
|
||||||
bool network_bss_list_isempty(struct network *network);
|
bool network_bss_list_isempty(struct network *network);
|
||||||
|
|
||||||
|
const char *__network_path_append_bss(const char *network_path,
|
||||||
|
const struct scan_bss *bss);
|
||||||
|
|
||||||
struct scan_bss *network_bss_list_pop(struct network *network);
|
struct scan_bss *network_bss_list_pop(struct network *network);
|
||||||
struct scan_bss *network_bss_find_by_addr(struct network *network,
|
struct scan_bss *network_bss_find_by_addr(struct network *network,
|
||||||
const uint8_t *addr);
|
const uint8_t *addr);
|
||||||
|
Loading…
Reference in New Issue
Block a user