summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rwxr-xr-x[-rw-r--r--]plugins/bluetooth.c76
-rwxr-xr-x[-rw-r--r--]plugins/bluetooth_legacy.c7
-rwxr-xr-x[-rw-r--r--]plugins/connman-nmcompat.conf0
-rwxr-xr-x[-rw-r--r--]plugins/dundee.c0
-rwxr-xr-x[-rw-r--r--]plugins/ethernet.c50
-rwxr-xr-x[-rw-r--r--]plugins/gadget.c0
-rwxr-xr-x[-rw-r--r--]plugins/hh2serial-gps.c0
-rwxr-xr-x[-rw-r--r--]plugins/iospm.c0
-rwxr-xr-x[-rw-r--r--]plugins/loopback.c0
-rwxr-xr-x[-rw-r--r--]plugins/mcc.h0
-rwxr-xr-x[-rw-r--r--]plugins/neard.c0
-rwxr-xr-x[-rw-r--r--]plugins/nmcompat.c0
-rwxr-xr-x[-rw-r--r--]plugins/ofono.c108
-rwxr-xr-x[-rw-r--r--]plugins/pacrunner.c0
-rwxr-xr-x[-rw-r--r--]plugins/polkit.c0
-rwxr-xr-x[-rw-r--r--]plugins/polkit.policy4
-rwxr-xr-x[-rw-r--r--]plugins/session_policy_local.c0
-rwxr-xr-x[-rw-r--r--]plugins/telephony.c0
-rwxr-xr-x[-rw-r--r--]plugins/tist.c0
-rwxr-xr-x[-rw-r--r--]plugins/vpn.c0
-rwxr-xr-x[-rw-r--r--]plugins/wifi.c119
21 files changed, 297 insertions, 67 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index f8abeac8..e1d4b599 100644..100755
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -36,7 +36,9 @@
#define BLUEZ_SERVICE "org.bluez"
#define BLUEZ_PATH "/org/bluez"
+#define BLUETOOTH_PAN_PANU "00001115-0000-1000-8000-00805f9b34fb"
#define BLUETOOTH_PAN_NAP "00001116-0000-1000-8000-00805f9b34fb"
+#define BLUETOOTH_PAN_GN "00001117-0000-1000-8000-00805f9b34fb"
#define BLUETOOTH_ADDR_LEN 6
@@ -50,6 +52,7 @@ struct bluetooth_pan {
struct connman_network *network;
GDBusProxy *btdevice_proxy;
GDBusProxy *btnetwork_proxy;
+ const char *pan_role;
};
static void address2ident(const char *address, char *ident)
@@ -85,28 +88,37 @@ static bool proxy_get_bool(GDBusProxy *proxy, const char *property)
return value;
}
-static bool proxy_get_nap(GDBusProxy *proxy)
+static const char *proxy_get_role(GDBusProxy *proxy)
{
- DBusMessageIter iter, value;
+ DBusMessageIter iter, value;
+ const char *pref = NULL;
if (!proxy)
- return false;
+ return NULL;
if (!g_dbus_proxy_get_property(proxy, "UUIDs", &iter))
- return false;
+ return NULL;
dbus_message_iter_recurse(&iter, &value);
while (dbus_message_iter_get_arg_type(&value) == DBUS_TYPE_STRING) {
const char *uuid;
- dbus_message_iter_get_basic(&value, &uuid);
- if (strcmp(uuid, BLUETOOTH_PAN_NAP) == 0)
- return true;
+ dbus_message_iter_get_basic(&value, &uuid);
+ /*
+ * If a device offers more than one role, we prefer NAP,
+ * then GN, then PANU.
+ */
+ if (!strcmp(uuid, BLUETOOTH_PAN_NAP))
+ return "nap";
+ if (!strcmp(uuid, BLUETOOTH_PAN_GN))
+ pref = "gn";
+ if (!strcmp(uuid, BLUETOOTH_PAN_PANU) && !pref)
+ pref = "panu";
dbus_message_iter_next(&value);
}
- return false;
+ return pref;
}
static int bluetooth_pan_probe(struct connman_network *network)
@@ -180,8 +192,14 @@ static bool pan_connect(struct bluetooth_pan *pan,
return false;
}
+#if defined TIZEN_EXT
+ if (pan->network) {
+#endif
connman_network_set_index(pan->network, index);
connman_network_set_connected(pan->network, true);
+#if defined TIZEN_EXT
+ }
+#endif
return true;
}
@@ -225,9 +243,11 @@ static void pan_connect_cb(DBusMessage *message, void *user_data)
static void pan_connect_append(DBusMessageIter *iter,
void *user_data)
{
- const char *role = BLUETOOTH_PAN_NAP;
+ const char *path = user_data;
+ struct bluetooth_pan *pan;
- dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &role);
+ pan = g_hash_table_lookup(networks, path);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &pan->pan_role);
}
static int bluetooth_pan_connect(struct connman_network *network)
@@ -247,6 +267,9 @@ static int bluetooth_pan_connect(struct connman_network *network)
g_strdup(path), g_free))
return -EIO;
+#if defined TIZEN_EXT
+ if (pan->network)
+#endif
connman_network_set_associating(pan->network, true);
return -EINPROGRESS;
@@ -271,6 +294,9 @@ static void pan_disconnect_cb(DBusMessage *message, void *user_data)
DBG("network %p", pan->network);
+#if defined TIZEN_EXT
+ if (pan->network)
+#endif
connman_network_set_connected(pan->network, false);
}
@@ -284,6 +310,11 @@ static int bluetooth_pan_disconnect(struct connman_network *network)
if (!pan)
return -EINVAL;
+#if defined TIZEN_EXT
+ if (connman_network_get_associating(network) == TRUE)
+ connman_network_clear_associating(network);
+#endif
+
path = g_dbus_proxy_get_path(pan->btnetwork_proxy);
if (!g_dbus_proxy_method_call(pan->btnetwork_proxy, "Disconnect",
@@ -322,8 +353,10 @@ static void btnetwork_property_change(GDBusProxy *proxy, const char *name,
static void pan_create_nap(struct bluetooth_pan *pan)
{
struct connman_device *device;
+ const char* role;
- if (!proxy_get_nap(pan->btdevice_proxy)) {
+ role = proxy_get_role(pan->btdevice_proxy);
+ if (!role) {
pan_remove_nap(pan);
return;
}
@@ -366,6 +399,7 @@ static void pan_create_nap(struct bluetooth_pan *pan)
connman_network_set_group(pan->network, ident);
}
+ pan->pan_role = role;
connman_device_add_network(device, pan->network);
if (pan_connect(pan, NULL))
@@ -376,9 +410,10 @@ static void btdevice_property_change(GDBusProxy *proxy, const char *name,
DBusMessageIter *iter, void *user_data)
{
struct bluetooth_pan *pan;
- bool pan_nap = false;
+ const char *old_role = NULL;
+ const char *new_role;
- if (strcmp(name, "UUIDs") != 0)
+ if (strcmp(name, "UUIDs"))
return;
pan = g_hash_table_lookup(networks, g_dbus_proxy_get_path(proxy));
@@ -387,12 +422,13 @@ static void btdevice_property_change(GDBusProxy *proxy, const char *name,
if (pan->network &&
connman_network_get_device(pan->network))
- pan_nap = true;
+ old_role = pan->pan_role;
+ new_role = proxy_get_role(pan->btdevice_proxy);
- DBG("network %p network nap %d proxy nap %d", pan->network, pan_nap,
- proxy_get_nap(pan->btdevice_proxy));
+ DBG("network %p network role %s proxy role %s", pan->network, old_role,
+ new_role);
- if (proxy_get_nap(pan->btdevice_proxy) == pan_nap)
+ if (old_role && new_role && !strcmp(old_role, new_role))
return;
pan_create_nap(pan);
@@ -447,7 +483,7 @@ static void pan_create(GDBusProxy *network_proxy)
g_dbus_proxy_set_property_watch(pan->btdevice_proxy,
btdevice_property_change, NULL);
- DBG("pan %p %s nap %d", pan, path, proxy_get_nap(pan->btdevice_proxy));
+ DBG("pan %p %s role %s", pan, path, proxy_get_role(pan->btdevice_proxy));
pan_create_nap(pan);
}
@@ -756,7 +792,7 @@ static void device_create(GDBusProxy *proxy)
powered = proxy_get_bool(proxy, "Powered");
connman_device_set_powered(device, powered);
- if (proxy_get_nap(proxy) && !bluetooth_tethering)
+ if (proxy_get_role(proxy) && !bluetooth_tethering)
tethering_create(path, NULL, NULL, false);
}
@@ -957,6 +993,8 @@ static void bluetooth_exit(void)
*/
device_driver.disable = NULL;
+ g_dbus_client_unref(client);
+
connman_network_driver_unregister(&network_driver);
g_hash_table_destroy(networks);
diff --git a/plugins/bluetooth_legacy.c b/plugins/bluetooth_legacy.c
index 5a9a3955..16d717ed 100644..100755
--- a/plugins/bluetooth_legacy.c
+++ b/plugins/bluetooth_legacy.c
@@ -256,6 +256,13 @@ static int pan_disconnect(struct connman_network *network)
if (!path)
return -EINVAL;
+#if defined TIZEN_EXT
+ if (connman_network_get_associating(network) == TRUE) {
+ connman_network_set_error(network,
+ CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL);
+ }
+#endif
+
message = dbus_message_new_method_call(BLUEZ_SERVICE, path,
BLUEZ_NETWORK_INTERFACE, DISCONNECT);
if (!message)
diff --git a/plugins/connman-nmcompat.conf b/plugins/connman-nmcompat.conf
index 5887a345..5887a345 100644..100755
--- a/plugins/connman-nmcompat.conf
+++ b/plugins/connman-nmcompat.conf
diff --git a/plugins/dundee.c b/plugins/dundee.c
index b5420acf..b5420acf 100644..100755
--- a/plugins/dundee.c
+++ b/plugins/dundee.c
diff --git a/plugins/ethernet.c b/plugins/ethernet.c
index 4e713461..73494f15 100644..100755
--- a/plugins/ethernet.c
+++ b/plugins/ethernet.c
@@ -25,6 +25,13 @@
#include <errno.h>
#include <net/if.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include <linux/if_vlan.h>
+#include <linux/sockios.h>
#ifndef IFF_LOWER_UP
#define IFF_LOWER_UP 0x10000
@@ -50,6 +57,32 @@ struct ethernet_data {
struct connman_network *network;
};
+
+static int get_vlan_vid(const char *ifname)
+{
+ struct vlan_ioctl_args vifr;
+ int vid;
+ int sk;
+
+ memset(&vifr, 0, sizeof(vifr));
+
+ sk = socket(AF_INET, SOCK_STREAM, 0);
+ if (sk < 0)
+ return -errno;
+
+ vifr.cmd = GET_VLAN_VID_CMD;
+ strncpy(vifr.device1, ifname, sizeof(vifr.device1));
+
+ if(ioctl(sk, SIOCSIFVLAN, &vifr) >= 0)
+ vid = vifr.u.VID;
+ else
+ vid = -errno;
+
+ close(sk);
+
+ return vid;
+}
+
static int eth_network_probe(struct connman_network *network)
{
DBG("network %p", network);
@@ -93,7 +126,8 @@ static void add_network(struct connman_device *device,
struct ethernet_data *ethernet)
{
struct connman_network *network;
- int index;
+ int index, vid;
+ char *ifname;
network = connman_network_create("carrier",
CONNMAN_NETWORK_TYPE_ETHERNET);
@@ -102,6 +136,10 @@ static void add_network(struct connman_device *device,
index = connman_device_get_index(device);
connman_network_set_index(network, index);
+ ifname = connman_inet_ifname(index);
+ if (!ifname)
+ return;
+ vid = get_vlan_vid(ifname);
connman_network_set_name(network, "Wired");
@@ -110,15 +148,21 @@ static void add_network(struct connman_device *device,
return;
}
- if (!eth_tethering)
+ if (!eth_tethering) {
+ char group[10] = "cable";
/*
* Prevent service from starting the reconnect
* procedure as we do not want the DHCP client
* to run when tethering.
*/
- connman_network_set_group(network, "cable");
+ if (vid >= 0)
+ snprintf(group, sizeof(group), "%03x_cable", vid);
+
+ connman_network_set_group(network, group);
+ }
ethernet->network = network;
+ g_free(ifname);
}
static void remove_network(struct connman_device *device,
diff --git a/plugins/gadget.c b/plugins/gadget.c
index 6bc37a7b..6bc37a7b 100644..100755
--- a/plugins/gadget.c
+++ b/plugins/gadget.c
diff --git a/plugins/hh2serial-gps.c b/plugins/hh2serial-gps.c
index 99394e1c..99394e1c 100644..100755
--- a/plugins/hh2serial-gps.c
+++ b/plugins/hh2serial-gps.c
diff --git a/plugins/iospm.c b/plugins/iospm.c
index fcb4cea1..fcb4cea1 100644..100755
--- a/plugins/iospm.c
+++ b/plugins/iospm.c
diff --git a/plugins/loopback.c b/plugins/loopback.c
index e113887d..e113887d 100644..100755
--- a/plugins/loopback.c
+++ b/plugins/loopback.c
diff --git a/plugins/mcc.h b/plugins/mcc.h
index 0e0407c9..0e0407c9 100644..100755
--- a/plugins/mcc.h
+++ b/plugins/mcc.h
diff --git a/plugins/neard.c b/plugins/neard.c
index 1a0fc1cd..1a0fc1cd 100644..100755
--- a/plugins/neard.c
+++ b/plugins/neard.c
diff --git a/plugins/nmcompat.c b/plugins/nmcompat.c
index 883ce9bd..883ce9bd 100644..100755
--- a/plugins/nmcompat.c
+++ b/plugins/nmcompat.c
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 7af551ba..5cd83029 100644..100755
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -277,13 +277,11 @@ static void set_connected(struct modem_data *modem)
if (!service)
return;
+ connman_service_create_ip4config(service, index);
+ connman_network_set_ipv4_method(modem->network, method);
+
if (method == CONNMAN_IPCONFIG_METHOD_FIXED ||
method == CONNMAN_IPCONFIG_METHOD_DHCP) {
- connman_service_create_ip4config(service, index);
- connman_network_set_index(modem->network, index);
-
- connman_network_set_ipv4_method(modem->network, method);
-
setip = true;
}
@@ -293,11 +291,10 @@ static void set_connected(struct modem_data *modem)
}
method = modem->context->ipv6_method;
- if (method == CONNMAN_IPCONFIG_METHOD_FIXED) {
- connman_service_create_ip6config(service, index);
- connman_network_set_ipv6_method(modem->network, method);
- connman_network_set_ipaddress(modem->network,
- modem->context->ipv6_address);
+ connman_service_create_ip6config(service, index);
+ connman_network_set_ipv6_method(modem->network, method);
+
+ if (method == CONNMAN_IPCONFIG_METHOD_AUTO) {
setip = true;
}
@@ -317,18 +314,32 @@ static void set_connected(struct modem_data *modem)
modem->context->ipv6_nameservers);
}
- if (setip)
+ if (setip) {
+ connman_network_set_index(modem->network, index);
connman_network_set_connected(modem->network, true);
+ }
}
static void set_disconnected(struct modem_data *modem)
{
DBG("%s", modem->path);
- if (!modem->network)
- return;
+ if (modem->network)
+ connman_network_set_connected(modem->network, false);
- connman_network_set_connected(modem->network, false);
+ if (modem->context) {
+ g_free(modem->context->ipv4_nameservers);
+ modem->context->ipv4_nameservers = NULL;
+ if (modem->context->ipv4_method != CONNMAN_IPCONFIG_METHOD_OFF)
+ modem->context->ipv4_method =
+ CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+
+ g_free(modem->context->ipv6_nameservers);
+ modem->context->ipv6_nameservers = NULL;
+ if (modem->context->ipv6_method != CONNMAN_IPCONFIG_METHOD_OFF)
+ modem->context->ipv6_method =
+ CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+ }
}
typedef void (*set_property_cb)(struct modem_data *data,
@@ -755,6 +766,10 @@ static void extract_ipv4_settings(DBusMessageIter *array,
const char *interface = NULL;
int index = -1;
+ connman_ipaddress_free(context->ipv4_address);
+ context->ipv4_address = NULL;
+ context->index = -1;
+
if (dbus_message_iter_get_arg_type(array) != DBUS_TYPE_ARRAY)
return;
@@ -854,6 +869,10 @@ static void extract_ipv6_settings(DBusMessageIter *array,
const char *interface = NULL;
int index = -1;
+ connman_ipaddress_free(context->ipv6_address);
+ context->ipv6_address = NULL;
+ context->index = -1;
+
if (dbus_message_iter_get_arg_type(array) != DBUS_TYPE_ARRAY)
return;
@@ -905,7 +924,7 @@ static void extract_ipv6_settings(DBusMessageIter *array,
if (index < 0)
goto out;
- context->ipv6_method = CONNMAN_IPCONFIG_METHOD_FIXED;
+ context->ipv6_method = CONNMAN_IPCONFIG_METHOD_AUTO;
context->ipv6_address =
connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV6);
@@ -1065,12 +1084,53 @@ static void remove_network(struct modem_data *modem)
modem->network = NULL;
}
+static int set_context_ipconfig(struct network_context *context,
+ const char *protocol)
+{
+ DBG("context %p protocol %s", context, protocol);
+
+ if (!context || !protocol)
+ return -EINVAL;
+
+ if (g_str_equal(protocol, "ip")) {
+ if (context->ipv4_method == CONNMAN_IPCONFIG_METHOD_OFF)
+ context->ipv4_method = CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+
+ context->ipv6_method = CONNMAN_IPCONFIG_METHOD_OFF;
+
+ connman_ipaddress_free(context->ipv6_address);
+ context->ipv6_address = NULL;
+
+ } else if (g_str_equal(protocol, "ipv6")) {
+ if (context->ipv6_method == CONNMAN_IPCONFIG_METHOD_OFF)
+ context->ipv6_method = CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+
+ context->ipv4_method = CONNMAN_IPCONFIG_METHOD_OFF;
+
+ connman_ipaddress_free(context->ipv4_address);
+ context->ipv4_address = NULL;
+
+ } else if (g_str_equal(protocol, "dual")) {
+ if (context->ipv4_method == CONNMAN_IPCONFIG_METHOD_OFF)
+ context->ipv4_method = CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+
+ if (context->ipv6_method == CONNMAN_IPCONFIG_METHOD_OFF)
+ context->ipv6_method = CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+ }
+
+ DBG("ipv4 method %d ipv6 method %d", context->ipv4_method,
+ context->ipv6_method);
+
+ return 0;
+}
+
static int add_cm_context(struct modem_data *modem, const char *context_path,
DBusMessageIter *dict)
{
const char *context_type = NULL;
struct network_context *context = NULL;
dbus_bool_t active = FALSE;
+ const char *ip_protocol = NULL;
DBG("%s context path %s", modem->path, context_path);
@@ -1123,7 +1183,14 @@ static int add_cm_context(struct modem_data *modem, const char *context_path,
modem->valid_apn = false;
DBG("%s AccessPointName '%s'", modem->path, apn);
+ } else if (g_str_equal(key, "Protocol") &&
+ dbus_message_iter_get_arg_type(&value) == DBUS_TYPE_STRING ) {
+
+ dbus_message_iter_get_basic(&value, &ip_protocol);
+
+ DBG("%s Protocol %s", modem->path, ip_protocol);
}
+
dbus_message_iter_next(dict);
}
@@ -1132,6 +1199,9 @@ static int add_cm_context(struct modem_data *modem, const char *context_path,
return -EINVAL;
}
+ if (ip_protocol)
+ set_context_ipconfig(context, ip_protocol);
+
modem->context = context;
modem->active = active;
@@ -1246,6 +1316,14 @@ static gboolean context_changed(DBusConnection *conn,
remove_network(modem);
}
+
+ } else if (g_str_equal(key, "Protocol") &&
+ dbus_message_iter_get_arg_type(&value) == DBUS_TYPE_STRING ) {
+ const char *ip_protocol;
+
+ dbus_message_iter_get_basic(&value, &ip_protocol);
+
+ set_context_ipconfig(modem->context, ip_protocol);
}
return TRUE;
diff --git a/plugins/pacrunner.c b/plugins/pacrunner.c
index 850139fd..850139fd 100644..100755
--- a/plugins/pacrunner.c
+++ b/plugins/pacrunner.c
diff --git a/plugins/polkit.c b/plugins/polkit.c
index ae38364a..ae38364a 100644..100755
--- a/plugins/polkit.c
+++ b/plugins/polkit.c
diff --git a/plugins/polkit.policy b/plugins/polkit.policy
index 0c2629a3..0de152ce 100644..100755
--- a/plugins/polkit.policy
+++ b/plugins/polkit.policy
@@ -13,7 +13,7 @@
<message>Policy prevents modification of settings</message>
<defaults>
<allow_inactive>no</allow_inactive>
- <allow_active>auth_self_keep_session</allow_active>
+ <allow_active>auth_self_keep</allow_active>
</defaults>
</action>
@@ -22,7 +22,7 @@
<message>Policy prevents modification of secrets</message>
<defaults>
<allow_inactive>no</allow_inactive>
- <allow_active>auth_admin_keep_session</allow_active>
+ <allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
diff --git a/plugins/session_policy_local.c b/plugins/session_policy_local.c
index b2369bdc..b2369bdc 100644..100755
--- a/plugins/session_policy_local.c
+++ b/plugins/session_policy_local.c
diff --git a/plugins/telephony.c b/plugins/telephony.c
index 459095db..459095db 100644..100755
--- a/plugins/telephony.c
+++ b/plugins/telephony.c
diff --git a/plugins/tist.c b/plugins/tist.c
index ad5ef79e..ad5ef79e 100644..100755
--- a/plugins/tist.c
+++ b/plugins/tist.c
diff --git a/plugins/vpn.c b/plugins/vpn.c
index e6e4c8e0..e6e4c8e0 100644..100755
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 7b1ccfd4..415447b7 100644..100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1007,7 +1007,7 @@ static int get_hidden_connections(GSupplicantScanParams *scan_data)
GKeyFile *keyfile;
gchar **services;
char *ssid, *name;
- int i, freq, ret;
+ int i, ret;
bool value;
int num_ssids = 0, add_param_failed = 0;
@@ -1046,13 +1046,10 @@ static int get_hidden_connections(GSupplicantScanParams *scan_data)
ssid = g_key_file_get_string(keyfile,
services[i], "SSID", NULL);
- freq = g_key_file_get_integer(keyfile, services[i],
- "Frequency", NULL);
-
name = g_key_file_get_string(keyfile, services[i], "Name",
NULL);
- ret = add_scan_param(ssid, NULL, 0, freq, scan_data, 0, name);
+ ret = add_scan_param(ssid, NULL, 0, 0, scan_data, 0, name);
if (ret < 0)
add_param_failed++;
else if (ret > 0)
@@ -1393,7 +1390,11 @@ static gboolean autoscan_timeout(gpointer data)
} else
interval = autoscan->interval * autoscan->base;
+#if defined TIZEN_EXT
if (autoscan->interval >= autoscan->limit)
+#else
+ if (interval > autoscan->limit)
+#endif
interval = autoscan->limit;
throw_wifi_scan(wifi->device, scan_callback_hidden);
@@ -1422,6 +1423,9 @@ static void start_autoscan(struct connman_device *device)
if (wifi->p2p_device)
return;
+ if (wifi->connected)
+ return;
+
autoscan = wifi->autoscan;
if (!autoscan)
return;
@@ -1478,22 +1482,8 @@ static void setup_autoscan(struct wifi_data *wifi)
start_autoscan(wifi->device);
}
-static void interface_autoscan_callback(int result,
- GSupplicantInterface *interface,
- void *user_data)
-{
- struct wifi_data *wifi = user_data;
-
- if (result < 0) {
- DBG("Could not enable Autoscan, falling back...");
- setup_autoscan(wifi);
- }
-}
-
static void finalize_interface_creation(struct wifi_data *wifi)
{
- GSupplicantInterface *interface = wifi->interface;
-
DBG("interface is ready wifi %p tethering %d", wifi, wifi->tethering);
if (!wifi->device) {
@@ -1509,12 +1499,7 @@ static void finalize_interface_creation(struct wifi_data *wifi)
if (wifi->p2p_device)
return;
- /* Setting up automatic scanning */
- if (g_supplicant_interface_autoscan(interface, AUTOSCAN_DEFAULT,
- interface_autoscan_callback, wifi) < 0) {
- DBG("Could not enable Autoscan, falling back...");
- setup_autoscan(wifi);
- }
+ setup_autoscan(wifi);
}
static void interface_create_callback(int result,
@@ -1931,6 +1916,9 @@ static int wifi_scan(enum connman_service_type type,
return 0;
}
+ } else if (wifi->connected) {
+ g_supplicant_free_scan_params(scan_params);
+ return wifi_scan_simple(device);
} else {
ret = get_latest_connections(driver_max_ssids, scan_params);
if (ret <= 0) {
@@ -2961,7 +2949,11 @@ static void network_added(GSupplicantNetwork *supplicant_network)
connman_network_set_available(network, true);
connman_network_set_string(network, "WiFi.Mode", mode);
+#if defined TIZEN_EXT
+ if (group)
+#else
if (ssid)
+#endif
connman_network_set_group(network, group);
#if defined TIZEN_EXT
@@ -3176,9 +3168,8 @@ static void peer_changed(GSupplicantPeer *peer, GSupplicantPeerState state)
p_state = CONNMAN_PEER_STATE_IDLE;
break;
case G_SUPPLICANT_PEER_GROUP_JOINED:
- if (!g_supplicant_peer_is_in_a_group(peer))
- break;
- p_state = CONNMAN_PEER_STATE_READY;
+ connman_peer_set_iface_address(connman_peer,
+ g_supplicant_peer_get_iface_address(peer));
break;
case G_SUPPLICANT_PEER_GROUP_DISCONNECTED:
p_state = CONNMAN_PEER_STATE_IDLE;
@@ -3241,6 +3232,75 @@ static void peer_request(GSupplicantPeer *peer)
connman_peer_request_connection(connman_peer);
}
+#if defined TIZEN_EXT
+static void network_merged(GSupplicantNetwork *network)
+{
+ GSupplicantInterface *interface;
+ GSupplicantState state;
+ struct wifi_data *wifi;
+ const char *identifier;
+ struct connman_network *connman_network;
+ unsigned int ishs20AP = 0;
+ char *temp = NULL;
+
+ interface = g_supplicant_network_get_interface(network);
+ if (!interface)
+ return;
+
+ state = g_supplicant_interface_get_state(interface);
+ if (state < G_SUPPLICANT_STATE_AUTHENTICATING)
+ return;
+
+ wifi = g_supplicant_interface_get_data(interface);
+ if (!wifi)
+ return;
+
+ identifier = g_supplicant_network_get_identifier(network);
+
+ connman_network = connman_device_get_network(wifi->device, identifier);
+ if (!connman_network)
+ return;
+
+ DBG("merged identifier %s", identifier);
+
+ if (wifi->connected == FALSE) {
+ switch (state) {
+ case G_SUPPLICANT_STATE_AUTHENTICATING:
+ case G_SUPPLICANT_STATE_ASSOCIATING:
+ case G_SUPPLICANT_STATE_ASSOCIATED:
+ case G_SUPPLICANT_STATE_4WAY_HANDSHAKE:
+ case G_SUPPLICANT_STATE_GROUP_HANDSHAKE:
+ connman_network_set_associating(connman_network, TRUE);
+ break;
+ case G_SUPPLICANT_STATE_COMPLETED:
+ connman_network_set_connected(connman_network, TRUE);
+ break;
+ default:
+ DBG("Not handled the state : %d", state);
+ break;
+ }
+ }
+
+ ishs20AP = g_supplicant_network_is_hs20AP(network);
+ connman_network_set_is_hs20AP(connman_network, ishs20AP);
+
+ if (ishs20AP &&
+ g_strcmp0(g_supplicant_network_get_security(network), "ieee8021x") == 0) {
+ temp = g_ascii_strdown(g_supplicant_network_get_eap(network), -1);
+ connman_network_set_string(connman_network, "WiFi.EAP",
+ temp);
+ connman_network_set_string(connman_network, "WiFi.Identity",
+ g_supplicant_network_get_identity(network));
+ connman_network_set_string(connman_network, "WiFi.Phase2",
+ g_supplicant_network_get_phase2(network));
+
+ g_free(temp);
+ }
+
+ wifi->network = connman_network;
+}
+#endif
+
static void debug(const char *str)
{
if (getenv("CONNMAN_SUPPLICANT_DEBUG"))
@@ -3265,6 +3325,9 @@ static const GSupplicantCallbacks callbacks = {
.peer_lost = peer_lost,
.peer_changed = peer_changed,
.peer_request = peer_request,
+#if defined TIZEN_EXT
+ .network_merged = network_merged,
+#endif
.debug = debug,
};