Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities. (Robert Tiemann)
2. Re: [PATCH 2/3] gsupplicant: Fix WPS capabilities updates.
(Daniel Wagner)
3. Re: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities. (Daniel Wagner)
4. Re: [PATCH 0/3] Fixes and extensions for WPS support
(Daniel Wagner)
5. Re: Fixes and extensions for WPS support (Robert Tiemann)
6. Re: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities. (Robert Tiemann)
7. Re: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities. (Daniel Wagner)
8. Re: [PATCH 2/3] gsupplicant: Fix WPS capabilities updates.
(Robert Tiemann)
----------------------------------------------------------------------
Message: 1
Date: Fri, 12 Jan 2018 12:41:51 +0100
From: Robert Tiemann <[email protected]>
To: [email protected]
Subject: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
---
gsupplicant/supplicant.c | 11 ++++++++++-
plugins/wifi.c | 36 +++++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 8f6da41..5246c80 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1577,6 +1577,7 @@ static int add_or_replace_bss_to_network(struct
g_supplicant_bss *bss)
GSupplicantInterface *interface = bss->interface;
GSupplicantNetwork *network;
char *group;
+ bool is_new_network;
group = create_group(bss);
SUPPLICANT_DBG("New group created: %s", group);
@@ -1588,10 +1589,13 @@ static int add_or_replace_bss_to_network(struct
g_supplicant_bss *bss)
if (network) {
g_free(group);
SUPPLICANT_DBG("Network %s already exist", network->name);
+ is_new_network = false;
goto done;
}
+ is_new_network = true;
+
network = g_try_new0(GSupplicantNetwork, 1);
if (!network) {
g_free(group);
@@ -1634,6 +1638,9 @@ done:
if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
network->wps = TRUE;
network->wps_capabilities = bss->wps_capabilities;
+
+ if (!is_new_network)
+ callback_network_changed(network, "WPSCapabilities");
}
/*
@@ -2807,8 +2814,10 @@ static void signal_bss_changed(const char *path,
DBusMessageIter *iter)
old_wps_capabilities = network->wps_capabilities;
- if (old_wps_capabilities != bss->wps_capabilities)
+ if (old_wps_capabilities != bss->wps_capabilities) {
network->wps_capabilities = bss->wps_capabilities;
+ callback_network_changed(network, "WPSCapabilities");
+ }
/* Consider only property changes of the connected BSS */
if (network == interface->current_network && bss != network->best_bss)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 0bd8134..7e4a0f7 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2880,6 +2880,7 @@ static void network_changed(GSupplicantNetwork *network,
const char *property)
struct wifi_data *wifi;
const char *name, *identifier;
struct connman_network *connman_network;
+ bool update_needed;
interface = g_supplicant_network_get_interface(network);
wifi = g_supplicant_interface_get_data(interface);
@@ -2895,11 +2896,40 @@ static void network_changed(GSupplicantNetwork
*network, const char *property)
if (!connman_network)
return;
- if (g_str_equal(property, "Signal")) {
- connman_network_set_strength(connman_network,
+ if (g_str_equal(property, "WPSCapabilities")) {
+ bool wps;
+ bool wps_pbc;
+ bool wps_ready;
+ bool wps_advertizing;
+
+ wps = g_supplicant_network_get_wps(network);
+ wps_pbc = g_supplicant_network_is_wps_pbc(network);
+ wps_ready = g_supplicant_network_is_wps_active(network);
+ wps_advertizing =
+ g_supplicant_network_is_wps_advertizing(network);
+
+ connman_network_set_bool(connman_network, "WiFi.WPS", wps);
+ connman_network_set_bool(connman_network,
"WiFi.WPSAdvertising", wps_advertizing);
+
+ if (wps) {
+ /* Is AP advertizing for WPS association?
+ * If so, we decide to use WPS by default */
+ if (wps_ready && wps_pbc && wps_advertizing)
+ connman_network_set_bool(connman_network,
"WiFi.UseWPS", true);
+ }
+
+ update_needed = true;
+ }
+ else if (g_str_equal(property, "Signal")) {
+ connman_network_set_strength(connman_network,
calculate_strength(network));
- connman_network_update(connman_network);
+ update_needed = true;
}
+ else
+ update_needed = false;
+
+ if (update_needed)
+ connman_network_update(connman_network);
}
static void network_associated(GSupplicantNetwork *network)
--
1.9.1
------------------------------
Message: 2
Date: Fri, 12 Jan 2018 12:54:15 +0100
From: Daniel Wagner <[email protected]>
To: Robert Tiemann <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 2/3] gsupplicant: Fix WPS capabilities updates.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Hi Robert,
Can you add a commit message what was wrong? Helps to understand what
you are fixing.
Thanks,
Daniel
On 01/12/2018 12:40 PM, Robert Tiemann wrote:
>
> ---
> gsupplicant/supplicant.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
> index 3994bfe..8f6da41 100644
> --- a/gsupplicant/supplicant.c
> +++ b/gsupplicant/supplicant.c
> @@ -1611,6 +1611,11 @@ static int add_or_replace_bss_to_network(struct
> g_supplicant_bss *bss)
> network->frequency = bss->frequency;
> network->best_bss = bss;
>
> + if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
> + network->wps = TRUE;
> + network->wps_capabilities = bss->wps_capabilities;
> + }
> +
> SUPPLICANT_DBG("New network %s created", network->name);
>
> network->bss_table = g_hash_table_new_full(g_str_hash, g_str_equal,
> @@ -1628,7 +1633,7 @@ done:
> /* We update network's WPS properties if only bss provides WPS. */
> if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
> network->wps = TRUE;
> - network->wps_capabilities |= bss->wps_capabilities;
> + network->wps_capabilities = bss->wps_capabilities;
> }
>
> /*
> @@ -2725,6 +2730,7 @@ static void signal_bss_changed(const char *path,
> DBusMessageIter *iter)
> GSupplicantInterface *interface;
> GSupplicantNetwork *network;
> GSupplicantSecurity old_security;
> + unsigned int old_wps_capabilities;
> struct g_supplicant_bss *bss;
>
> SUPPLICANT_DBG("");
> @@ -2799,6 +2805,11 @@ static void signal_bss_changed(const char *path,
> DBusMessageIter *iter)
> return;
> }
>
> + old_wps_capabilities = network->wps_capabilities;
> +
> + if (old_wps_capabilities != bss->wps_capabilities)
> + network->wps_capabilities = bss->wps_capabilities;
> +
> /* Consider only property changes of the connected BSS */
> if (network == interface->current_network && bss != network->best_bss)
> return;
>
------------------------------
Message: 3
Date: Fri, 12 Jan 2018 12:56:43 +0100
From: Daniel Wagner <[email protected]>
To: Robert Tiemann <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
> + wps = g_supplicant_network_get_wps(network);
> + wps_pbc = g_supplicant_network_is_wps_pbc(network);
> + wps_ready = g_supplicant_network_is_wps_active(network);
> + wps_advertizing =
> + g_supplicant_network_is_wps_advertizing(network);
> +
> + connman_network_set_bool(connman_network, "WiFi.WPS", wps);
> + connman_network_set_bool(connman_network,
> "WiFi.WPSAdvertising", wps_advertizing);
> +
> + if (wps) {
> + /* Is AP advertizing for WPS association?
> + * If so, we decide to use WPS by default */
Just a nitpick: please do
/*
*
*
*/
comment style.
------------------------------
Message: 4
Date: Fri, 12 Jan 2018 12:58:29 +0100
From: Daniel Wagner <[email protected]>
To: Robert Tiemann <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 0/3] Fixes and extensions for WPS support
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Hi Robert,
On 01/12/2018 12:38 PM, Robert Tiemann wrote:
> Allow clients to identify WPS registrars.
>
> Note that I am actually not quite happy with patch 3 because I have
> copied some parts from network_added() to network_changed() in
> plugins/wifi.c. Maybe it would be good to refactor it later to avoid
> code duplication.
Apart the two nitpicks from me, the code looks good. Pretty neat
actually :) Nice work.
Thanks,
Daniel
------------------------------
Message: 5
Date: Fri, 12 Jan 2018 13:03:44 +0100
From: Robert Tiemann <[email protected]>
To: Marcel Holtmann <[email protected]>
Cc: [email protected]
Subject: Re: Fixes and extensions for WPS support
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 01/12/2018 10:46 AM, Marcel Holtmann wrote:
>> All in all, I have three patches against master ready now which seem
>> to work pretty well to fix my use case. Would you guys be interested
>> to review these patches?
>
> please go ahead and send them.
Done.
> On a different note, have you tried iwd instead of wpa_supplicant? It has a
> way better WPS implementation and we would also like to get feedback on it.
No, I've never tried it.
What do you mean by "better WPS implementation"? Is it more reliable
or more correct or just faster?
I have observed occasional problems with an old Netgear WiFi router in
the past to the point I had to restart the router after a failed WPS
connection attempt, and I always thought its a problem with that
router (it clearly is in part because it is not supposed to crash).
Other routers I've tried stopped doing WPS after one or a few
successful connection attempts, also requiring a restart.
Maybe would be doing better with iwd?
> Regards
>
> Marcel
Best regards,
Robert
------------------------------
Message: 6
Date: Fri, 12 Jan 2018 13:25:12 +0100
From: Robert Tiemann <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 01/12/2018 12:56 PM, Daniel Wagner wrote:
>
>> + if (wps) {
>> + /* Is AP advertizing for WPS association?
>> + * If so, we decide to use WPS by default */
>
> Just a nitpick: please do
>
> /*
> *
> *
> */
>
> comment style.
This comment is part of what I've copied from function network_added()
in the same file. Should I fix the comment style in the original place
as well?
------------------------------
Message: 7
Date: Fri, 12 Jan 2018 13:30:10 +0100
From: Daniel Wagner <[email protected]>
To: Robert Tiemann <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 3/3] gsupplicant: Report changes of network WPS
capabilities.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 01/12/2018 01:25 PM, Robert Tiemann wrote:
> On 01/12/2018 12:56 PM, Daniel Wagner wrote:
>>
>>> + if (wps) {
>>> + /* Is AP advertizing for WPS association?
>>> + * If so, we decide to use WPS by default */
>>
>> Just a nitpick: please do
>>
>> /*
>> *
>> *
>> */
>>
>> comment style.
>
> This comment is part of what I've copied from function network_added()
> in the same file. Should I fix the comment style in the original place
> as well?
Ah I see. No, leave the old comment as it is. It would just introduce
unnecessary white space changes in the commit history. There are a few
other places which have the other comment style. So we either change all
of them or leave them as they are. But it's just not worth the extra
noise in the commit history in my opinion.
------------------------------
Message: 8
Date: Fri, 12 Jan 2018 13:59:17 +0100
From: Robert Tiemann <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 2/3] gsupplicant: Fix WPS capabilities updates.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
WPS capabilities for newly added networks were written to the network
object only after the callback for reporting new networks has been
called. This caused the callee to pick up wrong initial WPS
information. Now, capabilities are assigned before the callback is
called.
Along the same lines, WPS capabilities for existing, updated networks
are updated using an assignment instead of OR'ing them into the
previous capability flags. This allows clearing previously set flags
such as the G_SUPPLICANT_WPS_REGISTRAR flag (WPS active).
The WPS capabilities are updated in the
fi.w1.wpa_supplicant1.Interface.BSS.PropertiesChanged handler as well
now.
---
gsupplicant/supplicant.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 3994bfe..8f6da41 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1611,6 +1611,11 @@ static int add_or_replace_bss_to_network(struct
g_supplicant_bss *bss)
network->frequency = bss->frequency;
network->best_bss = bss;
+ if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
+ network->wps = TRUE;
+ network->wps_capabilities = bss->wps_capabilities;
+ }
+
SUPPLICANT_DBG("New network %s created", network->name);
network->bss_table = g_hash_table_new_full(g_str_hash, g_str_equal,
@@ -1628,7 +1633,7 @@ done:
/* We update network's WPS properties if only bss provides WPS. */
if ((bss->keymgmt & G_SUPPLICANT_KEYMGMT_WPS) != 0) {
network->wps = TRUE;
- network->wps_capabilities |= bss->wps_capabilities;
+ network->wps_capabilities = bss->wps_capabilities;
}
/*
@@ -2725,6 +2730,7 @@ static void signal_bss_changed(const char *path,
DBusMessageIter *iter)
GSupplicantInterface *interface;
GSupplicantNetwork *network;
GSupplicantSecurity old_security;
+ unsigned int old_wps_capabilities;
struct g_supplicant_bss *bss;
SUPPLICANT_DBG("");
@@ -2799,6 +2805,11 @@ static void signal_bss_changed(const char *path,
DBusMessageIter *iter)
return;
}
+ old_wps_capabilities = network->wps_capabilities;
+
+ if (old_wps_capabilities != bss->wps_capabilities)
+ network->wps_capabilities = bss->wps_capabilities;
+
/* Consider only property changes of the connected BSS */
if (network == interface->current_network && bss != network->best_bss)
return;
--
1.9.1
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 27, Issue 7
**************************************