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 v2 2/3] gsupplicant: Fix WPS capabilities updates.
      (Robert Tiemann)
   2. [PATCH v2 3/3] gsupplicant: Report changes of network WPS
      capabilities. (Robert Tiemann)
   3. Re: [PATCH 0/3] Fixes and extensions for WPS support
      (Robert Tiemann)


----------------------------------------------------------------------

Message: 1
Date: Mon, 15 Jan 2018 10:20:15 +0100
From: Robert Tiemann <[email protected]>
To: [email protected]
Subject: [PATCH v2 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




------------------------------

Message: 2
Date: Mon, 15 Jan 2018 10:21:28 +0100
From: Robert Tiemann <[email protected]>
To: [email protected]
Subject: [PATCH v2 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           | 38 ++++++++++++++++++++++++++++++++++----
 2 files changed, 44 insertions(+), 5 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 e8e66d0..58b6060 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2881,6 +2881,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);
@@ -2896,11 +2897,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: 3
Date: Mon, 15 Jan 2018 10:28:30 +0100
From: Robert Tiemann <[email protected]>
To: Jose Blanquicet <[email protected]>
Cc: [email protected], Daniel Wagner <[email protected]>
Subject: Re: [PATCH 0/3] Fixes and extensions for WPS support
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8



On 01/15/2018 12:42 AM, Jose Blanquicet wrote:
> I would just suggest, as usual, to check the patch with checkpatch.pl
> for style errors like "line over 80 characters" and others. We use
> Linux kernel coding style.

OK, I've sent another patch series. There is still one warning for the
the third patch about the comment style in plugins/wifi.c.


------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 27, Issue 10
***************************************

Reply via email to