All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] station: transition to disconnected on DOWN/DEL events
@ 2021-04-27 20:58 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2021-04-27 20:58 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]

This allows station to gracefully clean up things like the diagnostic
interface which is directly tied to stations CONNECTED/DISCONNECTED
states.
---
 src/station.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/station.c b/src/station.c
index 9c2b4e64..f2a6a56e 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3695,6 +3695,8 @@ static void add_frame_watches(struct netdev *netdev)
 static void station_netdev_watch(struct netdev *netdev,
 				enum netdev_watch_event event, void *userdata)
 {
+	struct station *station = station_find(netdev_get_ifindex(netdev));
+
 	switch (event) {
 	case NETDEV_WATCH_EVENT_NEW:
 		if (netdev_get_iftype(netdev) == NETDEV_IFTYPE_STATION) {
@@ -3711,6 +3713,10 @@ static void station_netdev_watch(struct netdev *netdev,
 		break;
 	case NETDEV_WATCH_EVENT_DOWN:
 	case NETDEV_WATCH_EVENT_DEL:
+		if (netdev_get_iftype(netdev) == NETDEV_IFTYPE_STATION)
+			station_enter_state(station,
+						STATION_STATE_DISCONNECTED);
+
 		l_dbus_object_remove_interface(dbus_get_bus(),
 						netdev_get_path(netdev),
 						IWD_STATION_INTERFACE);
-- 
2.26.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-27 20:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 20:58 [PATCH] station: transition to disconnected on DOWN/DEL events James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.