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. avoid redundant saving to the file system
      (Nakamura, Yusuke (ADITJ/SWG))
   2. [PATCH] supplicant: Do not set ProcessCredentials each time
      WPS is started (Jose Blanquicet)


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

Message: 1
Date: Wed, 22 Jun 2016 05:09:10 +0000
From: "Nakamura, Yusuke (ADITJ/SWG)" <[email protected]>
To: "[email protected]" <[email protected]>
Cc: "Ishikawa, Tetsuri (ADITJ/SWG)" <[email protected]>,
        "Hoyer, Marko (ADITG/SW2)" <[email protected]>
Subject: avoid redundant saving to the file system
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi all,

I had a looked at the piece of code in technology.c and found there was a 
redundant data saving.
connman_technology_save_offline() always loads the keyfile and saves it even if 
OfflineMode is not changed.
In order to avoid this I'd like to save the keyfile only when OfflineMode is 
actually changed.
Do you agree with this ? If yes, I'll send a patch to review.

Best Regards,
Yusuke

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20160622/6d4e6268/attachment-0001.html>

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

Message: 2
Date: Wed, 22 Jun 2016 17:58:26 +0200
From: Jose Blanquicet <[email protected]>
To: [email protected]
Cc: [email protected],
        [email protected]
Subject: [PATCH] supplicant: Do not set ProcessCredentials each time
        WPS is started
Message-ID: <[email protected]>

The property ProcessCredentials of WPS is set each time a WPS session is 
started. This patch aims to avoid such a redundancy and do it just once 
when the interface is initialized and WPS capabilities are known.

Additionally, with this change the returned value by the function 
g_supplicant_interface_connect will be the actual returned value of the 
WPS.Start method, because currently it is the one returned by the 
SetProperty method.

---
 gsupplicant/supplicant.c | 65 +++++++++++++++++++-----------------------------
 1 file changed, 25 insertions(+), 40 deletions(-)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 09a3ac5..acad111 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2107,6 +2107,15 @@ static void interface_bss_removed(DBusMessageIter *iter, 
void *user_data)
                g_hash_table_remove(interface->network_table, network->group);
 }
 
+static void wps_process_credentials(DBusMessageIter *iter, void *user_data)
+{
+       dbus_bool_t credentials = TRUE;
+
+       SUPPLICANT_DBG("");
+
+       dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &credentials);
+}
+
 static void set_config_methods(DBusMessageIter *iter, void *user_data)
 {
        const char *config_methods = "push_button";
@@ -2141,12 +2150,6 @@ static void interface_property(const char *key, 
DBusMessageIter *iter,
                debug_strvalmap("Mode capability", mode_capa_map,
                                                interface->mode_capa);
 
-
-               supplicant_dbus_property_set(interface->path,
-                               SUPPLICANT_INTERFACE ".Interface.WPS",
-                               "ConfigMethods", DBUS_TYPE_STRING_AS_STRING,
-                               set_config_methods, NULL, NULL, NULL);
-
                if (interface->ready)
                        callback_interface_added(interface);
 
@@ -2158,6 +2161,18 @@ static void interface_property(const char *key, 
DBusMessageIter *iter,
                                                                interface);
                if (interface->mode_capa & G_SUPPLICANT_CAPABILITY_MODE_P2P)
                        interface->p2p_support = true;
+
+               if (interface->keymgmt_capa & G_SUPPLICANT_KEYMGMT_WPS) {
+                       supplicant_dbus_property_set(interface->path,
+                               SUPPLICANT_INTERFACE ".Interface.WPS",
+                               "ProcessCredentials", 
DBUS_TYPE_BOOLEAN_AS_STRING,
+                               wps_process_credentials, NULL, NULL, NULL);
+
+                       supplicant_dbus_property_set(interface->path,
+                               SUPPLICANT_INTERFACE ".Interface.WPS",
+                               "ConfigMethods", DBUS_TYPE_STRING_AS_STRING,
+                               set_config_methods, NULL, NULL, NULL);
+               }
        } else if (g_strcmp0(key, "State") == 0) {
                const char *str = NULL;
 
@@ -4738,36 +4753,6 @@ static void interface_add_wps_params(DBusMessageIter 
*iter, void *user_data)
        supplicant_dbus_dict_close(iter, &dict);
 }
 
-static void wps_start(const char *error, DBusMessageIter *iter, void 
*user_data)
-{
-       struct interface_connect_data *data = user_data;
-
-       SUPPLICANT_DBG("");
-
-       if (error) {
-               SUPPLICANT_DBG("error: %s", error);
-               g_free(data->path);
-               g_free(data->ssid);
-               dbus_free(data);
-               return;
-       }
-
-       supplicant_dbus_method_call(data->interface->path,
-                       SUPPLICANT_INTERFACE ".Interface.WPS", "Start",
-                       interface_add_wps_params,
-                       interface_wps_start_result, data, NULL);
-}
-
-static void wps_process_credentials(DBusMessageIter *iter, void *user_data)
-{
-       dbus_bool_t credentials = TRUE;
-
-       SUPPLICANT_DBG("");
-
-       dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &credentials);
-}
-
-
 int g_supplicant_interface_connect(GSupplicantInterface *interface,
                                GSupplicantSSID *ssid,
                                GSupplicantInterfaceCallback callback,
@@ -4800,10 +4785,10 @@ int g_supplicant_interface_connect(GSupplicantInterface 
*interface,
                memset(&interface->wps_cred, 0,
                                sizeof(struct _GSupplicantWpsCredentials));
 
-               ret = supplicant_dbus_property_set(interface->path,
-                       SUPPLICANT_INTERFACE ".Interface.WPS",
-                       "ProcessCredentials", DBUS_TYPE_BOOLEAN_AS_STRING,
-                       wps_process_credentials, wps_start, data, interface);
+               ret = supplicant_dbus_method_call(data->interface->path,
+                               SUPPLICANT_INTERFACE ".Interface.WPS", "Start",
+                               interface_add_wps_params,
+                               interface_wps_start_result, data, NULL);
        } else {
                /* By the time there is a request for connect and the network
                 * path is not NULL it means that connman has not removed the
-- 
1.9.1



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

Subject: Digest Footer

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


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

End of connman Digest, Vol 8, Issue 30
**************************************

Reply via email to