All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 1/2] station: tie diagnostic interface cleanup to DISCONNECTING
@ 2021-04-28 19:40 James Prestwood
  2021-04-28 19:40 ` [PATCH v5 2/2] station: remove diagnostic interface on station_free James Prestwood
  0 siblings, 1 reply; 3+ messages in thread
From: James Prestwood @ 2021-04-28 19:40 UTC (permalink / raw)
  To: iwd

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

Prior to this the diagnostic interface was taken down when station
transitioned to DISCONNECTED. This worked but once station is in
a DISCONNECTING state it then calls netdev_disconnect(). Trying to
get any diagnostic data during this time may not work as its
unknown what state exactly the kernel is in. To be safe take the
interface down when station is DISCONNECTING.
---
 src/station.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/station.c b/src/station.c
index 9c2b4e64..0cee3525 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1229,9 +1229,6 @@ static void station_enter_state(struct station *station,
 		periodic_scan_stop(station);
 		break;
 	case STATION_STATE_DISCONNECTED:
-		l_dbus_object_remove_interface(dbus_get_bus(),
-					netdev_get_path(station->netdev),
-					IWD_STATION_DIAGNOSTIC_INTERFACE);
 		periodic_scan_stop(station);
 		break;
 	case STATION_STATE_CONNECTED:
@@ -1242,6 +1239,10 @@ static void station_enter_state(struct station *station,
 		periodic_scan_stop(station);
 		break;
 	case STATION_STATE_DISCONNECTING:
+		l_dbus_object_remove_interface(dbus_get_bus(),
+					netdev_get_path(station->netdev),
+					IWD_STATION_DIAGNOSTIC_INTERFACE);
+		break;
 	case STATION_STATE_ROAMING:
 		break;
 	}
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v5 2/2] station: remove diagnostic interface on station_free
  2021-04-28 19:40 [PATCH v5 1/2] station: tie diagnostic interface cleanup to DISCONNECTING James Prestwood
@ 2021-04-28 19:40 ` James Prestwood
  2021-04-28 19:46   ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: James Prestwood @ 2021-04-28 19:40 UTC (permalink / raw)
  To: iwd

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

If station gets removed ungracefully (e.g. rfkill/hotplug) it
may not have a chance to disconnect, meaning the diagnostic
interface would remain up.
---
 src/station.c | 4 ++++
 1 file changed, 4 insertions(+)

v5:
 * called remove_interface directly as this is all we needed with
   the state transition anyways.

diff --git a/src/station.c b/src/station.c
index 0cee3525..a3a49fc9 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3487,6 +3487,10 @@ static void station_free(struct station *station)
 	if (station->connected_bss)
 		netdev_disconnect(station->netdev, NULL, NULL);
 
+	l_dbus_object_remove_interface(dbus_get_bus(),
+					netdev_get_path(station->netdev),
+					IWD_STATION_DIAGNOSTIC_INTERFACE);
+
 	if (station->netconfig) {
 		netconfig_destroy(station->netconfig);
 		station->netconfig = NULL;
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v5 2/2] station: remove diagnostic interface on station_free
  2021-04-28 19:40 ` [PATCH v5 2/2] station: remove diagnostic interface on station_free James Prestwood
@ 2021-04-28 19:46   ` Denis Kenzior
  0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2021-04-28 19:46 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 4/28/21 2:40 PM, James Prestwood wrote:
> If station gets removed ungracefully (e.g. rfkill/hotplug) it
> may not have a chance to disconnect, meaning the diagnostic
> interface would remain up.
> ---
>   src/station.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> v5:
>   * called remove_interface directly as this is all we needed with
>     the state transition anyways.
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-28 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 19:40 [PATCH v5 1/2] station: tie diagnostic interface cleanup to DISCONNECTING James Prestwood
2021-04-28 19:40 ` [PATCH v5 2/2] station: remove diagnostic interface on station_free James Prestwood
2021-04-28 19:46   ` Denis Kenzior

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.