mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 13:59:24 +01:00
ap: tie diagnostic interface to AP Start/Stop
The diagnostic interface serves no purpose until the AP has been started. Any calls on it will return an error so instead it makes more sense to bring it up when the AP is started, and down when the AP is stopped.
This commit is contained in:
parent
479506013c
commit
676ee1e4d2
13
src/ap.c
13
src/ap.c
@ -2966,6 +2966,11 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data,
|
|||||||
if (L_WARN_ON(!ap_if->pending))
|
if (L_WARN_ON(!ap_if->pending))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
l_dbus_object_add_interface(dbus_get_bus(),
|
||||||
|
netdev_get_path(ap_if->netdev),
|
||||||
|
IWD_AP_DIAGNOSTIC_INTERFACE,
|
||||||
|
ap_if);
|
||||||
|
|
||||||
reply = l_dbus_message_new_method_return(ap_if->pending);
|
reply = l_dbus_message_new_method_return(ap_if->pending);
|
||||||
dbus_pending_reply(&ap_if->pending, reply);
|
dbus_pending_reply(&ap_if->pending, reply);
|
||||||
l_dbus_property_changed(dbus_get_bus(),
|
l_dbus_property_changed(dbus_get_bus(),
|
||||||
@ -2977,6 +2982,10 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AP_EVENT_STOPPING:
|
case AP_EVENT_STOPPING:
|
||||||
|
l_dbus_object_remove_interface(dbus_get_bus(),
|
||||||
|
netdev_get_path(ap_if->netdev),
|
||||||
|
IWD_AP_DIAGNOSTIC_INTERFACE);
|
||||||
|
|
||||||
l_dbus_property_changed(dbus_get_bus(),
|
l_dbus_property_changed(dbus_get_bus(),
|
||||||
netdev_get_path(ap_if->netdev),
|
netdev_get_path(ap_if->netdev),
|
||||||
IWD_AP_INTERFACE, "Started");
|
IWD_AP_INTERFACE, "Started");
|
||||||
@ -3265,16 +3274,12 @@ static void ap_add_interface(struct netdev *netdev)
|
|||||||
/* setup ap dbus interface */
|
/* setup ap dbus interface */
|
||||||
l_dbus_object_add_interface(dbus_get_bus(),
|
l_dbus_object_add_interface(dbus_get_bus(),
|
||||||
netdev_get_path(netdev), IWD_AP_INTERFACE, ap_if);
|
netdev_get_path(netdev), IWD_AP_INTERFACE, ap_if);
|
||||||
l_dbus_object_add_interface(dbus_get_bus(), netdev_get_path(netdev),
|
|
||||||
IWD_AP_DIAGNOSTIC_INTERFACE, ap_if);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ap_remove_interface(struct netdev *netdev)
|
static void ap_remove_interface(struct netdev *netdev)
|
||||||
{
|
{
|
||||||
l_dbus_object_remove_interface(dbus_get_bus(),
|
l_dbus_object_remove_interface(dbus_get_bus(),
|
||||||
netdev_get_path(netdev), IWD_AP_INTERFACE);
|
netdev_get_path(netdev), IWD_AP_INTERFACE);
|
||||||
l_dbus_object_remove_interface(dbus_get_bus(), netdev_get_path(netdev),
|
|
||||||
IWD_AP_DIAGNOSTIC_INTERFACE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ap_netdev_watch(struct netdev *netdev,
|
static void ap_netdev_watch(struct netdev *netdev,
|
||||||
|
Loading…
Reference in New Issue
Block a user