diff mbox series

[06/17] ap: add frequency to AP interface

Message ID 20221101201747.143379-6-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [01/17] wiphy: add wiphy_get_supported_ciphers | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Nov. 1, 2022, 8:17 p.m. UTC
---
 src/ap.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Denis Kenzior Nov. 1, 2022, 8:50 p.m. UTC | #1
Hi James,

On 11/1/22 15:17, James Prestwood wrote:
> ---
>   src/ap.c | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
> 

Looks like you forgot the doc commit for this change.  I added this and applied 
patch 6 and 7.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/ap.c b/src/ap.c
index 834fa089..baf90c1b 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -3676,6 +3676,9 @@  static void ap_if_event_func(enum ap_event_type type, const void *event_data,
 		l_dbus_property_changed(dbus_get_bus(),
 					netdev_get_path(ap_if->netdev),
 					IWD_AP_INTERFACE, "Name");
+		l_dbus_property_changed(dbus_get_bus(),
+					netdev_get_path(ap_if->netdev),
+					IWD_AP_INTERFACE, "Frequency");
 
 		l_rtnl_set_linkmode_and_operstate(rtnl,
 					netdev_get_ifindex(ap_if->netdev),
@@ -4026,6 +4029,24 @@  static bool ap_dbus_property_get_scanning(struct l_dbus *dbus,
 	return true;
 }
 
+static bool ap_dbus_property_get_freq(struct l_dbus *dbus,
+					struct l_dbus_message *message,
+					struct l_dbus_message_builder *builder,
+					void *user_data)
+{
+	struct ap_if_data *ap_if = user_data;
+	uint32_t freq;
+
+	if (!ap_if->ap || !ap_if->ap->started)
+		return false;
+
+	freq = band_channel_to_freq(ap_if->ap->channel, BAND_FREQ_2_4_GHZ);
+
+	l_dbus_message_builder_append_basic(builder, 'u', &freq);
+
+	return true;
+}
+
 static void ap_setup_interface(struct l_dbus_interface *interface)
 {
 	l_dbus_interface_method(interface, "Start", 0, ap_dbus_start, "",
@@ -4045,6 +4066,8 @@  static void ap_setup_interface(struct l_dbus_interface *interface)
 					ap_dbus_property_get_name, NULL);
 	l_dbus_interface_property(interface, "Scanning", 0, "b",
 					ap_dbus_property_get_scanning, NULL);
+	l_dbus_interface_property(interface, "Frequency", 0, "u",
+					ap_dbus_property_get_freq, NULL);
 }
 
 static void ap_destroy_interface(void *user_data)