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

station: add channel number to diagnostics message

As a small convenience to the user.
This commit is contained in:
Ram Subramanian 2024-02-23 12:09:07 -08:00 committed by Denis Kenzior
parent d4c68d7d83
commit 793228028d

View File

@ -4722,12 +4722,16 @@ static void station_get_diagnostic_cb(
struct l_dbus_message *reply; struct l_dbus_message *reply;
struct l_dbus_message_builder *builder; struct l_dbus_message_builder *builder;
struct handshake_state *hs = netdev_get_handshake(station->netdev); struct handshake_state *hs = netdev_get_handshake(station->netdev);
uint16_t channel_num;
if (!info) { if (!info) {
reply = dbus_error_aborted(station->get_station_pending); reply = dbus_error_aborted(station->get_station_pending);
goto done; goto done;
} }
channel_num = band_freq_to_channel(station->connected_bss->frequency,
NULL);
reply = l_dbus_message_new_method_return(station->get_station_pending); reply = l_dbus_message_new_method_return(station->get_station_pending);
builder = l_dbus_message_builder_new(reply); builder = l_dbus_message_builder_new(reply);
@ -4738,6 +4742,10 @@ static void station_get_diagnostic_cb(
util_address_to_string(info->addr)); util_address_to_string(info->addr));
dbus_append_dict_basic(builder, "Frequency", 'u', dbus_append_dict_basic(builder, "Frequency", 'u',
&station->connected_bss->frequency); &station->connected_bss->frequency);
if (channel_num != 0)
dbus_append_dict_basic(builder, "Channel", 'q', &channel_num);
dbus_append_dict_basic(builder, "Security", 's', dbus_append_dict_basic(builder, "Security", 's',
diagnostic_akm_suite_to_security(hs->akm_suite, diagnostic_akm_suite_to_security(hs->akm_suite,
hs->wpa_ie)); hs->wpa_ie));