[PATCH] dbus: Add getter for Channel property
Jouni Malinen
j at w1.fi
Fri Dec 27 02:37:10 PST 2024
On Fri, Dec 06, 2024 at 02:50:34PM +0100, Stefan Ursella wrote:
> Add "Channel" property to the DBus interface
> that allows to get the channel of a BSS.
Why? The existing Frequency property provides a more unique
identification of the operating channel. The channel number itself is
not unique identification and would need to be combined with the
operating class (and even country code if global operating classes are
not used).
> diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
> +dbus_bool_t wpas_dbus_getter_bss_channel(
> + const struct wpa_dbus_property_desc *property_desc,
> + DBusMessageIter *iter, DBusError *error, void *user_data)
> +{
> + u16 channel = 0, op_class = 0;
Those are not 16-bit values..
> + if (ieee80211_freq_to_channel_ext(res->freq, sec_chan, vht, (u8 *)&op_class,
> + (u8 *)&channel) == NUM_HOSTAPD_MODES)
And that type of type casting does not work in general (e.g., with big
endian CPUs).
> + return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16,
> + &channel, error);
Why would this be UINT16?
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list