All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING
@ 2021-04-28 19:27 James Prestwood
  2021-04-28 19:27 ` [PATCH v4 2/2] station: transition to disconnecting on station_free James Prestwood
  2021-04-28 19:32 ` [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: James Prestwood @ 2021-04-28 19:27 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1428 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(-)

v4:
 * Added this patch since the diagnostic data really only is
   relavant when station is connected.

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] 4+ messages in thread

* [PATCH v4 2/2] station: transition to disconnecting on station_free
  2021-04-28 19:27 [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING James Prestwood
@ 2021-04-28 19:27 ` James Prestwood
  2021-04-28 19:32   ` Denis Kenzior
  2021-04-28 19:32 ` [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING Denis Kenzior
  1 sibling, 1 reply; 4+ messages in thread
From: James Prestwood @ 2021-04-28 19:27 UTC (permalink / raw)
  To: iwd

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

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

v4:
 * Changed to DISCONNECTING due to new patch.

diff --git a/src/station.c b/src/station.c
index 0cee3525..c81c9a45 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3487,6 +3487,8 @@ static void station_free(struct station *station)
 	if (station->connected_bss)
 		netdev_disconnect(station->netdev, NULL, NULL);
 
+	station_enter_state(station, STATION_STATE_DISCONNECTING);
+
 	if (station->netconfig) {
 		netconfig_destroy(station->netconfig);
 		station->netconfig = NULL;
-- 
2.26.2

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

* Re: [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING
  2021-04-28 19:27 [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING James Prestwood
  2021-04-28 19:27 ` [PATCH v4 2/2] station: transition to disconnecting on station_free James Prestwood
@ 2021-04-28 19:32 ` Denis Kenzior
  1 sibling, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2021-04-28 19:32 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 4/28/21 2:27 PM, James Prestwood wrote:
> 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(-)
> 
> v4:
>   * Added this patch since the diagnostic data really only is
>     relavant when station is connected.
> 

Applied, thanks.

Regards,
-Denis

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

* Re: [PATCH v4 2/2] station: transition to disconnecting on station_free
  2021-04-28 19:27 ` [PATCH v4 2/2] station: transition to disconnecting on station_free James Prestwood
@ 2021-04-28 19:32   ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2021-04-28 19:32 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 4/28/21 2:27 PM, James Prestwood wrote:
> This allows station to gracefully clean up things like the diagnostic
> interface which is directly tied to stations CONNECTED/DISCONNECTING
> states.
> ---
>   src/station.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> v4:
>   * Changed to DISCONNECTING due to new patch.
> 
> diff --git a/src/station.c b/src/station.c
> index 0cee3525..c81c9a45 100644
> --- a/src/station.c
> +++ b/src/station.c
> @@ -3487,6 +3487,8 @@ static void station_free(struct station *station)
>   	if (station->connected_bss)
>   		netdev_disconnect(station->netdev, NULL, NULL);
>   
> +	station_enter_state(station, STATION_STATE_DISCONNECTING);
> +

I keep going back and forth on this, but I think it would be safer if we invoked 
unregister_interface directly.

>   	if (station->netconfig) {
>   		netconfig_destroy(station->netconfig);
>   		station->netconfig = NULL;
> 

Regards,
-Denis

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 19:27 [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING James Prestwood
2021-04-28 19:27 ` [PATCH v4 2/2] station: transition to disconnecting on station_free James Prestwood
2021-04-28 19:32   ` Denis Kenzior
2021-04-28 19:32 ` [PATCH v4 1/2] station: tie diagnostic interface cleanup to DISCONNECTING 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.