connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iwd: Set the network index add_network
@ 2021-10-01 12:26 Michael Trimarchi
  2021-10-01 12:26 ` [PATCH 2/2] manager: Add TetheringClientsChanged GBUS_SIGNAL Michael Trimarchi
  2021-10-04  6:32 ` [PATCH 1/2] iwd: Set the network index add_network Daniel Wagner
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Trimarchi @ 2021-10-01 12:26 UTC (permalink / raw)
  To: connman

In order to have compatibility with wpa_supplicant
configuration and fill the dictionary as was before
we need to set index not when the wireless is connected
but when it's registered. This allow to understand
what wireless card is using each services

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 plugins/iwd.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index 14a442a7..48097a1f 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -208,19 +208,6 @@ static int cm_network_probe(struct connman_network *network)
 
 static void update_network_connected(struct iwd_network *iwdn)
 {
-	struct iwd_device *iwdd;
-	int index;
-
-	iwdd = g_hash_table_lookup(devices, iwdn->device);
-	if (!iwdd)
-		return;
-
-	index = connman_inet_ifindex(iwdd->name);
-	if (index < 0)
-		return;
-
-	DBG("interface name %s index %d", iwdd->name, index);
-	connman_network_set_index(iwdn->network, index);
 	connman_network_set_connected(iwdn->network, true);
 }
 
@@ -911,6 +898,7 @@ static char *create_identifier(const char *path, const char *security)
 static void add_network(const char *path, struct iwd_network *iwdn)
 {
 	struct iwd_device *iwdd;
+	int index;
 	char *identifier;
 
 	iwdd = g_hash_table_lookup(devices, iwdn->device);
@@ -920,6 +908,12 @@ static void add_network(const char *path, struct iwd_network *iwdn)
 	identifier = create_identifier(path, iwdn->type);
 	iwdn->network = connman_network_create(identifier,
 					CONNMAN_NETWORK_TYPE_WIFI);
+
+	index = connman_inet_ifindex(iwdd->name);
+	if (index < 0)
+		return;
+
+	connman_network_set_index(iwdn->network, index);
 	connman_network_set_data(iwdn->network, iwdn);
 
 	connman_network_set_name(iwdn->network, iwdn->name);
-- 
2.25.1


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

* [PATCH 2/2] manager: Add TetheringClientsChanged GBUS_SIGNAL
  2021-10-01 12:26 [PATCH 1/2] iwd: Set the network index add_network Michael Trimarchi
@ 2021-10-01 12:26 ` Michael Trimarchi
  2021-10-04  6:34   ` Daniel Wagner
  2021-10-04  6:32 ` [PATCH 1/2] iwd: Set the network index add_network Daniel Wagner
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Trimarchi @ 2021-10-01 12:26 UTC (permalink / raw)
  To: connman

Add TetheringClientsChanged as dbus signal. This can be
seen using d-feet or other tool

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 src/manager.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/manager.c b/src/manager.c
index 3bf8f4e4..892d3a42 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -600,6 +600,9 @@ static const GDBusSignalTable manager_signals[] = {
 	{ GDBUS_SIGNAL("PeersChanged",
 			GDBUS_ARGS({ "changed", "a(oa{sv})" },
 					{ "removed", "ao" })) },
+	{ GDBUS_SIGNAL("TetheringClientsChanged",
+			GDBUS_ARGS({ "registered", "as" },
+					{ "removed", "as" })) },
 	{ },
 };
 
-- 
2.25.1


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

* Re: [PATCH 1/2] iwd: Set the network index add_network
  2021-10-01 12:26 [PATCH 1/2] iwd: Set the network index add_network Michael Trimarchi
  2021-10-01 12:26 ` [PATCH 2/2] manager: Add TetheringClientsChanged GBUS_SIGNAL Michael Trimarchi
@ 2021-10-04  6:32 ` Daniel Wagner
  2021-10-04  6:35   ` Michael Nazzareno Trimarchi
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Wagner @ 2021-10-04  6:32 UTC (permalink / raw)
  To: Michael Trimarchi; +Cc: connman

Hi Michael,

On Fri, Oct 01, 2021 at 12:26:06PM +0000, Michael Trimarchi wrote:
> In order to have compatibility with wpa_supplicant
> configuration and fill the dictionary as was before
> we need to set index not when the wireless is connected
> but when it's registered. This allow to understand
> what wireless card is using each services

I've applied the version from Emmanuel. Hope that is okay.

Thanks,
Daniel

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

* Re: [PATCH 2/2] manager: Add TetheringClientsChanged GBUS_SIGNAL
  2021-10-01 12:26 ` [PATCH 2/2] manager: Add TetheringClientsChanged GBUS_SIGNAL Michael Trimarchi
@ 2021-10-04  6:34   ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-10-04  6:34 UTC (permalink / raw)
  To: Michael Trimarchi; +Cc: connman

On Fri, Oct 01, 2021 at 12:26:07PM +0000, Michael Trimarchi wrote:
> Add TetheringClientsChanged as dbus signal. This can be
> seen using d-feet or other tool

Patch applied.

Thanks,
Daniel

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

* Re: [PATCH 1/2] iwd: Set the network index add_network
  2021-10-04  6:32 ` [PATCH 1/2] iwd: Set the network index add_network Daniel Wagner
@ 2021-10-04  6:35   ` Michael Nazzareno Trimarchi
  2021-10-04  6:38     ` Daniel Wagner
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-10-04  6:35 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: connman

Hi

On Mon, Oct 4, 2021 at 8:32 AM Daniel Wagner <wagi@monom.org> wrote:
>
> Hi Michael,
>
> On Fri, Oct 01, 2021 at 12:26:06PM +0000, Michael Trimarchi wrote:
> > In order to have compatibility with wpa_supplicant
> > configuration and fill the dictionary as was before
> > we need to set index not when the wireless is connected
> > but when it's registered. This allow to understand
> > what wireless card is using each services
>
> I've applied the version from Emmanuel. Hope that is okay.

Better commit message (aka better english) and 6 minutes before :)

Michael
>
> Thanks,
> Daniel



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 1/2] iwd: Set the network index add_network
  2021-10-04  6:35   ` Michael Nazzareno Trimarchi
@ 2021-10-04  6:38     ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-10-04  6:38 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi; +Cc: connman

On Mon, Oct 04, 2021 at 08:35:47AM +0200, Michael Nazzareno Trimarchi wrote:
> > I've applied the version from Emmanuel. Hope that is okay.
> 
> Better commit message (aka better english) and 6 minutes before :)

The 6 minutes did win the race :)

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

end of thread, other threads:[~2021-10-04  6:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 12:26 [PATCH 1/2] iwd: Set the network index add_network Michael Trimarchi
2021-10-01 12:26 ` [PATCH 2/2] manager: Add TetheringClientsChanged GBUS_SIGNAL Michael Trimarchi
2021-10-04  6:34   ` Daniel Wagner
2021-10-04  6:32 ` [PATCH 1/2] iwd: Set the network index add_network Daniel Wagner
2021-10-04  6:35   ` Michael Nazzareno Trimarchi
2021-10-04  6:38     ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).