summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2023-09-13 09:27:33 +0000
committerGerrit Code Review <gerrit@review>2023-09-13 09:27:33 +0000
commit497785eb5e7548f3b2fc58f4ff0773624939f913 (patch)
tree4b1dae515636e504ede3c3101f2e3c672a01d7ed
parent5b48a4bfc100eab55984e53705322afb7ce20e0e (diff)
parentcdc5af313099c6862fa7632c4807b85939c88169 (diff)
downloadconnman-497785eb5e7548f3b2fc58f4ff0773624939f913.tar.gz
connman-497785eb5e7548f3b2fc58f4ff0773624939f913.tar.bz2
connman-497785eb5e7548f3b2fc58f4ff0773624939f913.zip
Merge "Added dbus method to get whether 6GHz band is supported" into tizen
-rwxr-xr-xgsupplicant/gsupplicant.h1
-rwxr-xr-xgsupplicant/supplicant.c16
-rwxr-xr-xinclude/device.h3
-rwxr-xr-xplugins/wifi.c12
-rw-r--r--src/connman-robot.conf1
-rw-r--r--src/connman.conf1
-rwxr-xr-xsrc/device.c12
-rw-r--r--src/technology.c37
8 files changed, 82 insertions, 1 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 7f8a7a48..f49ad803 100755
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -427,6 +427,7 @@ 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);
+bool g_supplicant_interface_get_is_6_0_ghz_supported(GSupplicantInterface *interface);
unsigned char *g_supplicant_interface_get_add_network_bssid(GSupplicantInterface *interface);
typedef void (*GSupplicantMacPolicyCallback) (int result, unsigned int policy, void *user_data);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index c2687035..0f44766d 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -265,6 +265,7 @@ struct _GSupplicantInterface {
struct added_network_information network_info;
#if defined TIZEN_EXT
dbus_bool_t is_5_0_Ghz_supported;
+ dbus_bool_t is_6_0_Ghz_supported;
int disconnect_reason;
#endif
#if defined TIZEN_EXT
@@ -1314,6 +1315,11 @@ static void interface_capability(const char *key, DBusMessageIter *iter,
dbus_message_iter_get_basic(iter, &is_5_0_Ghz_supported);
interface->is_5_0_Ghz_supported = is_5_0_Ghz_supported;
+ } else if (g_strcmp0(key, "Is6GhzSupported") == 0) {
+ dbus_bool_t is_6_0_Ghz_supported;
+
+ dbus_message_iter_get_basic(iter, &is_6_0_Ghz_supported);
+ interface->is_6_0_Ghz_supported = is_6_0_Ghz_supported;
#endif
} else
SUPPLICANT_DBG("key %s type %c",
@@ -1425,11 +1431,19 @@ const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface)
bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface)
{
if (!interface)
- return NULL;
+ return false;
return interface->is_5_0_Ghz_supported;
}
+bool g_supplicant_interface_get_is_6_0_ghz_supported(GSupplicantInterface *interface)
+{
+ if (!interface)
+ return false;
+
+ return interface->is_6_0_Ghz_supported;
+}
+
unsigned char *g_supplicant_interface_get_add_network_bssid(GSupplicantInterface *interface)
{
if (!interface)
diff --git a/include/device.h b/include/device.h
index 8cc8ccef..acbd1d54 100755
--- a/include/device.h
+++ b/include/device.h
@@ -118,7 +118,10 @@ void connman_device_set_max_scan_ssids(struct connman_device *device,
int connman_device_get_max_scan_ssids(struct connman_device *device);
void connman_device_set_wifi_5ghz_supported(struct connman_device *device,
bool is_5_0_ghz_supported);
+void connman_device_set_wifi_6ghz_supported(struct connman_device *device,
+ bool is_6_0_ghz_supported);
bool connman_device_get_wifi_5ghz_supported(struct connman_device *device);
+bool connman_device_get_wifi_6ghz_supported(struct connman_device *device);
#endif
int connman_device_remove_network(struct connman_device *device,
struct connman_network *network);
diff --git a/plugins/wifi.c b/plugins/wifi.c
index befc7e2a..36e22620 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2718,7 +2718,17 @@ static void interface_create_callback(int result,
wifi->interface = interface;
g_supplicant_interface_set_data(interface, wifi);
+#ifdef TIZEN_EXT
+ if (interface && wifi->device &&
+ !connman_device_get_wifi_5ghz_supported(wifi->device) &&
+ !connman_device_get_wifi_6ghz_supported(wifi->device)) {
+ bool is_5_0_ghz_supported = g_supplicant_interface_get_is_5_0_ghz_supported(interface);
+ bool is_6_0_ghz_supported = g_supplicant_interface_get_is_6_0_ghz_supported(interface);
+ connman_device_set_wifi_5ghz_supported(wifi->device, is_5_0_ghz_supported);
+ connman_device_set_wifi_6ghz_supported(wifi->device, is_6_0_ghz_supported);
+ }
+#endif
if (g_supplicant_interface_get_ready(interface)) {
wifi->interface_ready = true;
finalize_interface_creation(wifi);
@@ -4485,6 +4495,7 @@ static void interface_added(GSupplicantInterface *interface)
#if defined TIZEN_EXT
bool is_5_0_ghz_supported = g_supplicant_interface_get_is_5_0_ghz_supported(interface);
+ bool is_6_0_ghz_supported = g_supplicant_interface_get_is_6_0_ghz_supported(interface);
#endif
struct wifi_data *wifi;
@@ -4512,6 +4523,7 @@ static void interface_added(GSupplicantInterface *interface)
connman_device_set_powered(wifi->device, true);
#if defined TIZEN_EXT
connman_device_set_wifi_5ghz_supported(wifi->device, is_5_0_ghz_supported);
+ connman_device_set_wifi_6ghz_supported(wifi->device, is_6_0_ghz_supported);
/* Max number of SSIDs supported by wlan chipset that can be scanned */
int max_scan_ssids = g_supplicant_interface_get_max_scan_ssids(interface);
connman_device_set_max_scan_ssids(wifi->device, max_scan_ssids);
diff --git a/src/connman-robot.conf b/src/connman-robot.conf
index b089f404..f123c25e 100644
--- a/src/connman-robot.conf
+++ b/src/connman-robot.conf
@@ -15,6 +15,7 @@
<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" />
+ <allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="Get6GHzSupported" />
<allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="GetMaxScanSsid" />
<allow send_destination="net.connman" send_interface="net.connman.Manager" send_member="GetTechnologies" />
diff --git a/src/connman.conf b/src/connman.conf
index 2b967138..997c1ea9 100644
--- a/src/connman.conf
+++ b/src/connman.conf
@@ -15,6 +15,7 @@
<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" />
+ <allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="Get6GHzSupported" />
<allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="GetMaxScanSsid" />
<check send_destination="net.connman" send_interface="net.connman.Manager" send_member="GetTechnologies" privilege="http://tizen.org/privilege/network.get" />
diff --git a/src/device.c b/src/device.c
index 51169001..1e3924b9 100755
--- a/src/device.c
+++ b/src/device.c
@@ -82,6 +82,7 @@ struct connman_device {
*/
int max_scan_ssids;
bool is_5_0_ghz_supported;
+ bool is_6_0_ghz_supported;
unsigned int mac_policy;
unsigned int preassoc_mac_policy;
unsigned int random_mac_lifetime;
@@ -1281,10 +1282,21 @@ void connman_device_set_wifi_5ghz_supported(struct connman_device *device,
device->is_5_0_ghz_supported = is_5_0_ghz_supported;
}
+void connman_device_set_wifi_6ghz_supported(struct connman_device *device,
+ bool is_6_0_ghz_supported)
+{
+ device->is_6_0_ghz_supported = is_6_0_ghz_supported;
+}
+
bool connman_device_get_wifi_5ghz_supported(struct connman_device *device)
{
return device->is_5_0_ghz_supported;
}
+
+bool connman_device_get_wifi_6ghz_supported(struct connman_device *device)
+{
+ return device->is_6_0_ghz_supported;
+}
#endif
/**
diff --git a/src/technology.c b/src/technology.c
index 44cd1169..4cc540bb 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -2104,6 +2104,41 @@ static DBusMessage *get_5ghz_supported(DBusConnection *conn, DBusMessage *msg, v
return reply;
}
+static DBusMessage *get_6ghz_supported(DBusConnection *conn, DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ DBusMessageIter iter, dict;
+ GSList *list;
+ struct connman_technology *technology = data;
+ dbus_bool_t supported = false;
+ const char *ifname = NULL;
+
+ 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);
+
+ for (list = technology->device_list; list; list = list->next) {
+ struct connman_device *device = list->data;
+
+ supported = connman_device_get_wifi_6ghz_supported(device);
+ ifname = connman_device_get_string(device, "Interface");
+
+ DBG("ifname %s supported : %d", ifname, supported);
+ connman_dbus_dict_append_basic(&dict, ifname,
+ DBUS_TYPE_BOOLEAN,
+ &supported);
+ }
+
+ connman_dbus_dict_close(&iter, &dict);
+
+ return reply;
+}
+
static DBusMessage *get_scan_state(DBusConnection *conn, DBusMessage *msg, void *data)
{
DBusMessage *reply;
@@ -2882,6 +2917,8 @@ static const GDBusMethodTable technology_methods[] = {
get_scan_state) },
{ GDBUS_METHOD("Get5GhzSupported", NULL, GDBUS_ARGS({ "supported", "a{sv}" }),
get_5ghz_supported) },
+ { GDBUS_METHOD("Get6GHzSupported", NULL, GDBUS_ARGS({ "supported", "a{sv}" }),
+ get_6ghz_supported) },
{ GDBUS_METHOD("GetMaxScanSsid", NULL, GDBUS_ARGS({ "maxscanssid", "a{sv}" }),
get_max_scan_ssid) },
{ GDBUS_ASYNC_METHOD("SetDevicePower",