commit 606769dbeac082bd53db88f78bce1645ca8acdfb
parent c89c37378b8cb7c2f94bde7236271c82541293f0
Author: James Prestwood <prestwoj@gmail.com>
Date: Fri, 4 Nov 2022 09:37:55 -0700
ap: update Scanning property when AP starts
This wasn't being updated meaning the property is missing until a
scan is issued over DBus.
Rather than duplicate all the property changed calls they were all
factored out into a helper function.
Diffstat:
| M | src/ap.c | | | 55 | +++++++++++++++++++++++++------------------------------ |
1 file changed, 25 insertions(+), 30 deletions(-)
diff --git a/src/ap.c b/src/ap.c
@@ -3672,6 +3672,28 @@ struct ap_if_data {
struct l_dbus_message *pending;
};
+static void ap_properties_changed(struct ap_if_data *ap_if)
+{
+ l_dbus_property_changed(dbus_get_bus(),
+ netdev_get_path(ap_if->netdev),
+ IWD_AP_INTERFACE, "Started");
+ 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_dbus_property_changed(dbus_get_bus(),
+ netdev_get_path(ap_if->netdev),
+ IWD_AP_INTERFACE, "PairwiseCiphers");
+ l_dbus_property_changed(dbus_get_bus(),
+ netdev_get_path(ap_if->netdev),
+ IWD_AP_INTERFACE, "GroupCipher");
+ l_dbus_property_changed(dbus_get_bus(),
+ netdev_get_path(ap_if->netdev),
+ IWD_AP_INTERFACE, "Scanning");
+}
+
static void ap_if_event_func(enum ap_event_type type, const void *event_data,
void *user_data)
{
@@ -3703,21 +3725,8 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data,
reply = l_dbus_message_new_method_return(ap_if->pending);
dbus_pending_reply(&ap_if->pending, reply);
- l_dbus_property_changed(dbus_get_bus(),
- netdev_get_path(ap_if->netdev),
- IWD_AP_INTERFACE, "Started");
- 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_dbus_property_changed(dbus_get_bus(),
- netdev_get_path(ap_if->netdev),
- IWD_AP_INTERFACE, "PairwiseCiphers");
- l_dbus_property_changed(dbus_get_bus(),
- netdev_get_path(ap_if->netdev),
- IWD_AP_INTERFACE, "GroupCipher");
+
+ ap_properties_changed(ap_if);
l_rtnl_set_linkmode_and_operstate(rtnl,
netdev_get_ifindex(ap_if->netdev),
@@ -3730,21 +3739,7 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data,
netdev_get_path(ap_if->netdev),
IWD_AP_DIAGNOSTIC_INTERFACE);
- l_dbus_property_changed(dbus_get_bus(),
- netdev_get_path(ap_if->netdev),
- IWD_AP_INTERFACE, "Started");
- 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_dbus_property_changed(dbus_get_bus(),
- netdev_get_path(ap_if->netdev),
- IWD_AP_INTERFACE, "PairwiseCiphers");
- l_dbus_property_changed(dbus_get_bus(),
- netdev_get_path(ap_if->netdev),
- IWD_AP_INTERFACE, "GroupCipher");
+ ap_properties_changed(ap_if);
l_rtnl_set_linkmode_and_operstate(rtnl,
netdev_get_ifindex(ap_if->netdev),