summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Sansanwal <abhishek.s94@samsung.com>2018-12-13 05:21:58 (GMT)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>2018-12-17 10:48:23 (GMT)
commit48e25ec7f60ffcba067708732298fd85a2b3ed47 (patch)
treec28087ff852425f2cfa0e5914982ad8f7e16d26f
parentbf7dbf8354f076ec768ae24e61d6fb1e46c623af (diff)
downloadconnman-submit/tizen/20181217.121131.zip
connman-submit/tizen/20181217.121131.tar.gz
connman-submit/tizen/20181217.121131.tar.bz2
Change-Id: Ib3b189615648a35aa876eab3e3f61c47ac0c1e68 Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
-rw-r--r--gsupplicant/gsupplicant.h3
-rw-r--r--gsupplicant/supplicant.c17
-rwxr-xr-xinclude/technology.h4
-rw-r--r--plugins/wifi.c7
-rw-r--r--src/connman.conf1
-rw-r--r--src/technology.c42
6 files changed, 74 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 597fe75..c3ef5a0 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -368,6 +368,9 @@ void g_supplicant_interface_set_data(GSupplicantInterface *interface,
void *data);
void *g_supplicant_interface_get_data(GSupplicantInterface *interface);
const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface);
+#if defined TIZEN_EXT
+bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface);
+#endif
const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface);
GSupplicantState g_supplicant_interface_get_state(GSupplicantInterface *interface);
const char *g_supplicant_interface_get_wps_key(GSupplicantInterface *interface);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index e7dfcb2..bafe478 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -214,6 +214,7 @@ struct _GSupplicantInterface {
GSupplicantNetwork *current_network;
struct added_network_information network_info;
#if defined TIZEN_EXT
+ dbus_bool_t is_5_0_Ghz_supported;
int disconnect_reason;
#endif
#if defined TIZEN_EXT_WIFI_MESH
@@ -1113,7 +1114,13 @@ static void interface_capability(const char *key, DBusMessageIter *iter,
if (max_scan_ssid < 2)
max_scan_ssid = 0;
interface->max_scan_ssids = max_scan_ssid;
+#if defined TIZEN_EXT
+ } else if (g_strcmp0(key, "Is5GhzSupported") == 0) {
+ dbus_bool_t is_5_0_Ghz_supported;
+ dbus_message_iter_get_basic(iter, &is_5_0_Ghz_supported);
+ interface->is_5_0_Ghz_supported = is_5_0_Ghz_supported;
+#endif
} else
SUPPLICANT_DBG("key %s type %c",
key, dbus_message_iter_get_arg_type(iter));
@@ -1202,6 +1209,16 @@ const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface)
return interface->ifname;
}
+#if defined TIZEN_EXT
+bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface)
+{
+ if (!interface)
+ return NULL;
+
+ return interface->is_5_0_Ghz_supported;
+}
+#endif
+
const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface)
{
if (!interface)
diff --git a/include/technology.h b/include/technology.h
index 73cd8e7..29cdddf 100755
--- a/include/technology.h
+++ b/include/technology.h
@@ -83,6 +83,10 @@ struct connman_technology_driver {
int connman_technology_driver_register(struct connman_technology_driver *driver);
void connman_technology_driver_unregister(struct connman_technology_driver *driver);
+#if defined TIZEN_EXT
+void connman_techonology_wifi_set_5ghz_supported(struct connman_technology *technology,
+ bool is_5_0_Ghz_supported);
+#endif
#ifdef __cplusplus
}
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 33425e0..71727e6 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3566,6 +3566,10 @@ static void interface_added(GSupplicantInterface *interface)
{
const char *ifname = g_supplicant_interface_get_ifname(interface);
const char *driver = g_supplicant_interface_get_driver(interface);
+#if defined TIZEN_EXT
+ bool is_5_0_ghz_supported = g_supplicant_interface_get_is_5_0_ghz_supported(interface);
+#endif
+
struct wifi_data *wifi;
wifi = g_supplicant_interface_get_data(interface);
@@ -3589,6 +3593,9 @@ static void interface_added(GSupplicantInterface *interface)
}
connman_device_set_powered(wifi->device, true);
+#if defined TIZEN_EXT
+ connman_techonology_wifi_set_5ghz_supported(wifi_technology, is_5_0_ghz_supported);
+#endif
}
static bool is_idle(struct wifi_data *wifi)
diff --git a/src/connman.conf b/src/connman.conf
index e092235..cd9eefb 100644
--- a/src/connman.conf
+++ b/src/connman.conf
@@ -14,6 +14,7 @@
<deny send_destination="net.connman"/>
<allow send_destination="net.connman" send_type="signal"/>
<allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="GetScanState" />
+ <allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="Get5GhzSupported" />
<check send_destination="net.connman" send_interface="net.connman.Manager" send_member="GetTechnologies" privilege="http://tizen.org/privilege/network.get" />
<check send_destination="net.connman" send_interface="net.connman.Manager" send_member="GetProperties" privilege="http://tizen.org/privilege/network.get" />
diff --git a/src/technology.c b/src/technology.c
index 6604599..05ec0c0 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -98,6 +98,9 @@ struct connman_technology {
#if defined TIZEN_EXT_WIFI_MESH
DBusMessage *mesh_dbus_msg;
#endif
+#if defined TIZEN_EXT
+ bool is_5_0_ghz_supported;
+#endif
};
static GSList *driver_list = NULL;
@@ -394,6 +397,16 @@ bool connman_technology_get_wifi_tethering(const char **ssid,
return true;
}
+#if defined TIZEN_EXT
+void connman_techonology_wifi_set_5ghz_supported(struct connman_technology *wifi_technology,
+ bool is_5_0_ghz_supported)
+{
+ DBG("");
+
+ wifi_technology->is_5_0_ghz_supported = is_5_0_ghz_supported;
+}
+#endif
+
static void free_rfkill(gpointer data)
{
struct connman_rfkill *rfkill = data;
@@ -1410,6 +1423,33 @@ static DBusMessage *specific_scan(DBusConnection *conn, DBusMessage *msg, void *
return NULL;
}
+#if defined TIZEN_EXT
+static DBusMessage *get_5ghz_supported(DBusConnection *conn, DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ DBusMessageIter iter, dict;
+ struct connman_technology *technology = data;
+ dbus_bool_t supported = technology->is_5_0_ghz_supported;
+
+ DBG("technology %p", technology);
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return NULL;
+
+ dbus_message_iter_init_append(reply, &iter);
+
+ connman_dbus_dict_open(&iter, &dict);
+ connman_dbus_dict_append_basic(&dict, "Is5GhzSupported",
+ DBUS_TYPE_BOOLEAN,
+ &supported);
+
+ connman_dbus_dict_close(&iter, &dict);
+
+ return reply;
+}
+#endif
+
static DBusMessage *get_scan_state(DBusConnection *conn, DBusMessage *msg, void *data)
{
DBusMessage *reply;
@@ -1923,6 +1963,8 @@ static const GDBusMethodTable technology_methods[] = {
NULL, specific_scan) },
{ GDBUS_METHOD("GetScanState", NULL, GDBUS_ARGS({ "scan_state", "a{sv}" }),
get_scan_state) },
+ { GDBUS_METHOD("Get5GhzSupported", NULL, GDBUS_ARGS({ "supported", "a{sv}" }),
+ get_5ghz_supported) },
#endif
#if defined TIZEN_EXT_WIFI_MESH
{ GDBUS_ASYNC_METHOD("MeshCommands",