Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-08 Thread Patrik Flykt
On Wed, 2014-08-06 at 23:51 -0400, Eduardo Abinader wrote:
 When interface was already created in wpa_supplicant,
 p2p detection was failing. Thus, calling p2p detection
 after interface property has been signaled fixes this
 detection failure.

Applied, thanks!

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-07 Thread Tomasz Bursztyka

Hi Eduardo,


When interface was already created in wpa_supplicant,
p2p detection was failing. Thus, calling p2p detection
after interface property has been signaled fixes this
detection failure.


Wpa_supplicant should not create interface before ConnMan asks for it.
The only case when it does so, is when it creates the virtual p2p interface,
on that one we don't care to check any support.

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-07 Thread Richard Röjfors
On Thu, Aug 7, 2014 at 8:21 AM, Tomasz Bursztyka
tomasz.burszt...@linux.intel.com wrote:

 When interface was already created in wpa_supplicant,
 p2p detection was failing. Thus, calling p2p detection
 after interface property has been signaled fixes this
 detection failure.


 Wpa_supplicant should not create interface before ConnMan asks for it.
 The only case when it does so, is when it creates the virtual p2p interface,
 on that one we don't care to check any support.

What if connman is restarted while wpa_supplicant is still running?

--Richard
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-07 Thread Tomasz Bursztyka

Hi Richard,


Wpa_supplicant should not create interface before ConnMan asks for it.
The only case when it does so, is when it creates the virtual p2p interface,
on that one we don't care to check any support.

What if connman is restarted while wpa_supplicant is still running?


When connman restarts properly, it will first remove the interfaces on 
wpa_supplicant thus

letting wpa_supplicant in a clean state.

If connman is restarted after a non-clean stop, well that's another 
issue. It would be nice
to restart wpa_supplicant as well, or better: to stop wpa_supplicant 
when connman disappears.
After all, wpa_supplicant is started through dbus by ConnMan requesting 
its dbus interface.


Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-07 Thread Tomasz Bursztyka

Hi Eduardo,

Finally it seems possible for connman to sync up with wpa_supplicant and 
existing interface
(see patch [PATCH v2] device: Make sure the device is up and running 
before enabling it and logs

from Richard Röjfors http://pastebin.com/4Bsk5B2N )

So ACK to this patch!

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-07 Thread Eduardo Abinader
Good news!

Thanks, Tomasz.

On Thu, Aug 7, 2014 at 7:43 AM, Tomasz Bursztyka
tomasz.burszt...@linux.intel.com wrote:
 Hi Eduardo,

 Finally it seems possible for connman to sync up with wpa_supplicant and
 existing interface
 (see patch [PATCH v2] device: Make sure the device is up and running before
 enabling it and logs
 from Richard Röjfors http://pastebin.com/4Bsk5B2N )

 So ACK to this patch!

 Tomasz
 ___
 connman mailing list
 connman@connman.net
 https://lists.connman.net/mailman/listinfo/connman
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

[PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-06 Thread Eduardo Abinader
When interface was already created in wpa_supplicant,
p2p detection was failing. Thus, calling p2p detection
after interface property has been signaled fixes this
detection failure.
---
 gsupplicant/supplicant.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index b8ad5a2..715bac2 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1874,6 +1874,15 @@ static void interface_bss_removed(DBusMessageIter *iter, 
void *user_data)
g_hash_table_remove(interface-network_table, network-group);
 }
 
+static void interface_detect_p2p_support(GSupplicantInterface *interface)
+{
+   SUPPLICANT_DBG(p2p detect);
+   if (interface-mode_capa  G_SUPPLICANT_CAPABILITY_MODE_P2P) {
+   interface-p2p_support = true;
+   callback_p2p_support(interface);
+   }
+}
+
 static void interface_property(const char *key, DBusMessageIter *iter,
void *user_data)
 {
@@ -1909,6 +1918,7 @@ static void interface_property(const char *key, 
DBusMessageIter *iter,
if (g_strcmp0(key, Capabilities) == 0) {
supplicant_dbus_property_foreach(iter, interface_capability,
interface);
+   interface_detect_p2p_support(interface);
} else if (g_strcmp0(key, State) == 0) {
const char *str = NULL;
 
@@ -2075,22 +2085,13 @@ static void interface_added(DBusMessageIter *iter, void 
*user_data)
supplicant_dbus_property_foreach(iter, interface_property,
interface);
interface_property(NULL, NULL, interface);
-   goto p2p_detection;
+   return;
}
 
supplicant_dbus_property_get_all(path,
SUPPLICANT_INTERFACE .Interface,
interface_property, interface,
interface);
-
-p2p_detection:
-
-   if (interface-mode_capa  G_SUPPLICANT_CAPABILITY_MODE_P2P) {
-   interface-p2p_support = true;
-   callback_p2p_support(interface);
-   }
-
-   return;
 }
 
 static void interface_removed(DBusMessageIter *iter, void *user_data)
-- 
1.9.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman