mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
scan: Move bss_address_to_string to scan.[ch]
This commit is contained in:
parent
6a28baa893
commit
8a68ebd65b
11
src/scan.c
11
src/scan.c
@ -740,6 +740,17 @@ void scan_bss_free(struct scan_bss *bss)
|
|||||||
l_free(bss);
|
l_free(bss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *scan_bss_address_to_string(const struct scan_bss *bss)
|
||||||
|
{
|
||||||
|
static char buf[32];
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X",
|
||||||
|
bss->addr[0], bss->addr[1], bss->addr[2],
|
||||||
|
bss->addr[3], bss->addr[4], bss->addr[5]);
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
void bss_get_supported_ciphers(struct scan_bss *bss,
|
void bss_get_supported_ciphers(struct scan_bss *bss,
|
||||||
uint16_t *pairwise_ciphers,
|
uint16_t *pairwise_ciphers,
|
||||||
uint16_t *group_ciphers)
|
uint16_t *group_ciphers)
|
||||||
|
@ -84,6 +84,7 @@ void scan_sched_start(struct l_genl_family *nl80211, uint32_t ifindex,
|
|||||||
enum scan_ssid_security scan_get_ssid_security(enum ie_bss_capability bss_cap,
|
enum scan_ssid_security scan_get_ssid_security(enum ie_bss_capability bss_cap,
|
||||||
const struct ie_rsn_info *info);
|
const struct ie_rsn_info *info);
|
||||||
void scan_bss_free(struct scan_bss *bss);
|
void scan_bss_free(struct scan_bss *bss);
|
||||||
|
const char *scan_bss_address_to_string(const struct scan_bss *bss);
|
||||||
int scan_bss_rank_compare(const void *a, const void *b, void *user);
|
int scan_bss_rank_compare(const void *a, const void *b, void *user);
|
||||||
|
|
||||||
void bss_get_supported_ciphers(struct scan_bss *bss,
|
void bss_get_supported_ciphers(struct scan_bss *bss,
|
||||||
|
15
src/wiphy.c
15
src/wiphy.c
@ -860,17 +860,6 @@ static void setup_device_interface(struct l_dbus_interface *interface)
|
|||||||
l_dbus_interface_ro_property(interface, "Name", "s");
|
l_dbus_interface_ro_property(interface, "Name", "s");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *bss_address_to_string(const struct scan_bss *bss)
|
|
||||||
{
|
|
||||||
static char buf[32];
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X",
|
|
||||||
bss->addr[0], bss->addr[1], bss->addr[2],
|
|
||||||
bss->addr[3], bss->addr[4], bss->addr[5]);
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool bss_match(const void *a, const void *b)
|
static bool bss_match(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const struct scan_bss *bss_a = a;
|
const struct scan_bss *bss_a = a;
|
||||||
@ -986,7 +975,7 @@ static void netdev_autoconnect_next(struct netdev *netdev)
|
|||||||
while ((entry = l_queue_pop_head(netdev->autoconnect_list))) {
|
while ((entry = l_queue_pop_head(netdev->autoconnect_list))) {
|
||||||
l_debug("Considering autoconnecting to BSS '%s' with SSID: %s,"
|
l_debug("Considering autoconnecting to BSS '%s' with SSID: %s,"
|
||||||
" freq: %u, rank: %u, strength: %i",
|
" freq: %u, rank: %u, strength: %i",
|
||||||
bss_address_to_string(entry->bss),
|
scan_bss_address_to_string(entry->bss),
|
||||||
entry->network->ssid,
|
entry->network->ssid,
|
||||||
entry->bss->frequency, entry->rank,
|
entry->bss->frequency, entry->rank,
|
||||||
entry->bss->signal_strength);
|
entry->bss->signal_strength);
|
||||||
@ -1651,7 +1640,7 @@ static void process_bss(struct netdev *netdev, struct scan_bss *bss)
|
|||||||
|
|
||||||
l_debug("Found BSS '%s' with SSID: %s, freq: %u, rank: %u, "
|
l_debug("Found BSS '%s' with SSID: %s, freq: %u, rank: %u, "
|
||||||
"strength: %i",
|
"strength: %i",
|
||||||
bss_address_to_string(bss),
|
scan_bss_address_to_string(bss),
|
||||||
util_ssid_to_utf8(bss->ssid_len, bss->ssid),
|
util_ssid_to_utf8(bss->ssid_len, bss->ssid),
|
||||||
bss->frequency, bss->rank, bss->signal_strength);
|
bss->frequency, bss->rank, bss->signal_strength);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user