Replace HAL interface with hal-api-wifi 45/252545/2 accepted/tizen/unified/20210210.130349 submit/tizen/20210209.010000
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 29 Jan 2021 07:31:33 +0000 (16:31 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 3 Feb 2021 06:45:46 +0000 (15:45 +0900)
Change-Id: Ib479ed18dbfc1585baa4524218b72a7855d18703
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
packaging/wifi-direct-manager.service
packaging/wifi-direct-manager.spec
plugin/wpasupplicant/ctrl_iface_dbus/CMakeLists.txt
plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c

index cc8b056..33cd624 100644 (file)
@@ -8,6 +8,6 @@ SmackProcessLabel=System
 ExecStart=/usr/bin/wfd-manager
 User=network_fw
 Group=network_fw
-Capabilities=cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_kill=i
+Capabilities=cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_kill,cap_sys_module=i
 SecureBits=keep-caps
 
index 03c6ec8..55c1b9a 100644 (file)
@@ -26,6 +26,7 @@ BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(libsystemd-login)
 BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(hal-api-wifi)
 %if 0%{?gtests:1}
 BuildRequires: pkgconfig(gmock)
 %endif
index 5f966de..906713e 100644 (file)
@@ -22,7 +22,7 @@ SET(PLUGIN_SRCS
        dbus/wfd-plugin-supplicant-dbus.c
        )
 
-pkg_check_modules(plugin_pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 dlog)
+pkg_check_modules(plugin_pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 dlog hal-api-wifi)
 
 FOREACH(flag ${plugin_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 266bf04..06b1ba0 100644 (file)
@@ -44,6 +44,7 @@
 #include <gio/gio.h>
 
 #include <tzplatform_config.h>
+#include <hal-wifi.h>
 
 #include "wifi-direct-oem.h"
 #include "wfd-plugin-log.h"
@@ -3979,14 +3980,19 @@ gboolean _ws_util_execute_file(const char *file_path,
 
 static int __ws_p2p_firmware_start(const char *interface_name)
 {
-       gboolean rv = FALSE;
-       const char *path = "/usr/bin/wlan.sh";
-       char *const args[] = { "/usr/bin/wlan.sh", "p2p", (char *)interface_name, NULL };
-       char *const envs[] = { NULL };
+       int rv = 0;
 
-       rv = _ws_util_execute_file(path, args, envs);
-       if (rv != TRUE)
+       rv = hal_wifi_get_backend();
+       if (rv < 0) {
+               WDP_LOGD("hal_wifi_get_backend() failed, ret: %d", rv);
                return -1;
+       }
+
+       rv = hal_wifi_p2p_start(interface_name);
+       if (rv < 0) {
+               WDP_LOGD("hal_wifi_p2p_start() failed, ret: %d", rv);
+               return -1;
+       }
 
        WDP_LOGI("Successfully loaded p2p device driver");
        return 0;
@@ -3994,13 +4000,19 @@ static int __ws_p2p_firmware_start(const char *interface_name)
 
 static int __ws_p2p_firmware_stop(const char *interface_name)
 {
-       gboolean rv = FALSE;
-       const char *path = "/usr/bin/wlan.sh";
-       char *const args[] = { "/usr/bin/wlan.sh", "stop", (char *)interface_name, NULL };
-       char *const envs[] = { NULL };
-       rv = _ws_util_execute_file(path, args, envs);
-       if (rv < 0)
+       int rv = 0;
+
+       rv = hal_wifi_get_backend();
+       if (rv < 0) {
+               WDP_LOGD("hal_wifi_get_backend() failed, ret: %d", rv);
                return -1;
+       }
+
+       rv = hal_wifi_stop(interface_name);
+       if (rv < 0) {
+               WDP_LOGD("hal_wifi_stop() failed, ret: %d", rv);
+               return -1;
+       }
 
        WDP_LOGI("Successfully removed p2p device driver");
        return 0;