devicectl: Remove devicectl
authorWook Song <wook16.song@samsung.com>
Fri, 18 Nov 2016 04:23:19 +0000 (13:23 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 16 Jan 2017 11:35:36 +0000 (20:35 +0900)
This patch removes devicectl, which is a helper tool for deviced. When
the stable version of pass is ready and available, it will be refactored
to support pass.

Signed-off-by: Wook Song <wook16.song@samsung.com>
CMakeLists.txt
packaging/pass.spec
scripts/direct_set_debug.sh [deleted file]
src/devicectl/CMakeLists.txt [deleted file]
src/devicectl/devicectl.c [deleted file]
src/devicectl/usb.c [deleted file]
src/devicectl/usb.h [deleted file]

index 79dbe5f..2534308 100644 (file)
@@ -237,7 +237,6 @@ IF(${USB_MODULE} STREQUAL on)
        INSTALL_CONF(src/usb usb-operation)
 
        # USB (Manual setting)
-       INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/direct_set_debug.sh DESTINATION bin)
        IF(${SDB_PRESTART} STREQUAL on)
                INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/sdb-prestart.service DESTINATION lib/systemd/system)
        ENDIF(${SDB_PRESTART} STREQUAL on)
@@ -265,7 +264,7 @@ ENDIF()
 
 ADD_SUBDIRECTORY(src/shared)
 ADD_SUBDIRECTORY(src/libdeviced)
-ADD_SUBDIRECTORY(src/devicectl)
+
 IF(HAPTIC_MODULE STREQUAL on)
        ADD_SUBDIRECTORY(src/haptic)
 ENDIF()
index 383cb5f..a839649 100644 (file)
@@ -111,13 +111,6 @@ Group:      main
 %description %{daemon_name}
 PASS systemd daemon.
 
-%package tools
-Summary:  %{daemon_name} tools
-Group:    System/Utilities
-
-%description tools
-PASS helper tools
-
 %package -n %{libdaemon_name}
 Summary:    PASS library
 Group:      Development/Libraries
@@ -286,13 +279,6 @@ systemctl daemon-reload
 %{_prefix}/lib/udev/rules.d/99-usbhost.rules
 %endif
 
-%files tools
-%manifest %{name}.manifest
-%{_bindir}/devicectl
-%if %{?usb_module} == on
-%{_bindir}/direct_set_debug.sh
-%endif
-
 %files -n %{libdaemon_name}
 %manifest %{libdaemon_name}.manifest
 %defattr(-,root,root,-)
diff --git a/scripts/direct_set_debug.sh b/scripts/direct_set_debug.sh
deleted file mode 100755 (executable)
index 17c4224..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-load_usb_gadget() {
-       echo 0 > /sys/class/usb_mode/usb0/enable
-       echo 04e8 > /sys/class/usb_mode/usb0/idVendor
-       echo $1 > /sys/class/usb_mode/usb0/idProduct
-       echo $2 > /sys/class/usb_mode/usb0/funcs_fconf
-       echo $3 > /sys/class/usb_mode/usb0/funcs_sconf
-       echo 239 > /sys/class/usb_mode/usb0/bDeviceClass
-       echo 2 > /sys/class/usb_mode/usb0/bDeviceSubClass
-       echo 1 > /sys/class/usb_mode/usb0/bDeviceProtocol
-       echo 1 > /sys/class/usb_mode/usb0/enable
-}
-
-unload_usb_gadget() {
-       echo 0 > /sys/class/usb_mode/usb0/enable
-}
-
-sdb_set() {
-       load_usb_gadget "6860" "" "sdb"
-       /usr/bin/systemctl start sdbd.service
-       /usr/bin/vconftool set -t int memory/sysman/usb_status 2 -f
-       echo "SDB enabled"
-}
-
-sdb_unset() {
-       unload_usb_gadget
-       /usr/bin/vconftool set -t int memory/sysman/usb_status 0 -f
-       /usr/bin/systemctl stop sdbd.service
-       echo "SDB disabled"
-}
-
-show_options() {
-       echo "direct_set_debug.sh: usage:"
-       echo "    --help       This message"
-       echo "    --sdb-set    Load sdb without usb-manager"
-       echo "    --sdb-unset  Unload sdb without usb-manager"
-}
-
-case "$1" in
-"--sdb-set")
-       sdb_set
-       ;;
-
-"--sdb-unset")
-       sdb_unset
-       ;;
-
-"--help")
-       show_options
-       ;;
-
-*)
-       echo "Wrong parameters. Please use option --help to check options "
-       ;;
-esac
diff --git a/src/devicectl/CMakeLists.txt b/src/devicectl/CMakeLists.txt
deleted file mode 100755 (executable)
index a99104f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(devicectl C)
-
-IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_ENGINEER_MODE")
-    OPTION(USE_ENGINEER_MODE "Use Engineer mode" ON)
-ENDIF()
-
-SET(SRCS
-       devicectl.c
-       usb.c
-)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dbus-1)
-
-FOREACH(flag ${pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
-IF( $ENV{ARCH} MATCHES "arm" )
-       ADD_DEFINITIONS("-DTARGET")
-ENDIF()
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} shared)
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
diff --git a/src/devicectl/devicectl.c b/src/devicectl/devicectl.c
deleted file mode 100644 (file)
index 4a06f99..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * devicectl
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dbus/dbus.h>
-#include <shared/dbus.h>
-#include <core/common.h>
-#include "usb.h"
-
-/*
- * devicectl [device] [action]
- * ex> devicectl display stop
- *     devicectl pass start
- */
-
-enum device_type {
-       DEVICE_CORE,
-       DEVICE_DISPLAY,
-       DEVICE_LED,
-       DEVICE_PASS,
-       DEVICE_USB,
-       DEVICE_EXTCON,
-       DEVICE_POWER,
-       DEVICE_USB_HOST_TEST,
-       DEVICE_MAX,
-       DEVICE_ALL,
-};
-static enum device_type arg_id;
-
-static const struct device {
-       const enum device_type id;
-       const char *name;
-       const char *path;
-       const char *iface;
-} devices[] = {
-       { DEVICE_CORE,    "core",    DEVICED_PATH_CORE,    DEVICED_INTERFACE_CORE    },
-       { DEVICE_DISPLAY, "display", DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY },
-       { DEVICE_LED,     "led",     DEVICED_PATH_LED,     DEVICED_INTERFACE_LED     },
-       { DEVICE_PASS,    "pass",    DEVICED_PATH_PASS,    DEVICED_INTERFACE_PASS    },
-       { DEVICE_USB,     "usb",     DEVICED_PATH_USB,     DEVICED_INTERFACE_USB     },
-       { DEVICE_EXTCON,  "extcon",  DEVICED_PATH_EXTCON,  DEVICED_INTERFACE_EXTCON  },
-       { DEVICE_POWER,   "power",   DEVICED_PATH_POWER,   DEVICED_INTERFACE_POWER   },
-       { DEVICE_USB_HOST_TEST, "usb-host-test", DEVICED_PATH_USB_HOST_TEST, DEVICED_INTERFACE_USB_HOST_TEST},
-};
-
-static int start_device(char **args)
-{
-       DBusMessage *msg;
-
-       if (!args[1])
-               return -EINVAL;
-
-       printf("start %s device!\n", args[1]);
-
-       msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "start", NULL, NULL);
-       if (!msg)
-               return -EBADMSG;
-
-       dbus_message_unref(msg);
-
-       return 0;
-}
-
-static int stop_device(char **args)
-{
-       DBusMessage *msg;
-
-       if (!args[1])
-               return -EINVAL;
-
-       printf("stop %s device!\n", args[1]);
-
-       msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "stop", NULL, NULL);
-       if (!msg)
-               return -EBADMSG;
-
-       dbus_message_unref(msg);
-
-       return 0;
-}
-
-static int dump_mode(char **args)
-{
-       int ret;
-       char *arr[1];
-
-       if (!args[1] || !args[2] || !args[3])
-               return -EINVAL;
-
-       printf("%s (%s %s)!\n", args[1], args[2], args[3]);
-
-       arr[0] = args[3];
-       ret = dbus_method_async(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "Dumpmode", "s", arr);
-       if (ret < 0)
-               printf("failed to set dump mode (%d)", ret);
-
-       return ret;
-}
-
-static int save_log(char **args)
-{
-       int ret;
-
-       if (!args[1])
-               return -EINVAL;
-
-       printf("save log %s device!\n", args[1]);
-
-       ret = dbus_method_async(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "SaveLog", NULL, NULL);
-       if (ret < 0)
-               printf("failed to save log (%d)", ret);
-
-       return ret;
-}
-
-static void get_pname(pid_t pid, char *pname)
-{
-       char buf[PATH_MAX];
-       int cmdline, r;
-
-       snprintf(buf, PATH_MAX, "/proc/%d/cmdline", pid);
-       cmdline = open(buf, O_RDONLY);
-       if (cmdline < 0) {
-               pname[0] = '\0';
-               return;
-       }
-
-       r = read(cmdline, pname, PATH_MAX);
-       if ((r >= 0) && (r < PATH_MAX))
-               pname[r] = '\0';
-       else
-               pname[0] = '\0';
-
-       close(cmdline);
-}
-
-static int save_dbus_name(char **args)
-{
-       DBusMessage *msg;
-       char **list;
-       int ret, size, i;
-       pid_t pid;
-       char *arr[1];
-       char pname[PATH_MAX];
-
-       if (!args[1])
-               return -EINVAL;
-
-       printf("save dbus name!\n");
-
-       msg = dbus_method_sync_with_reply(DBUS_BUS_NAME,
-           DBUS_OBJECT_PATH, DBUS_INTERFACE_NAME,
-           "ListNames", NULL, NULL);
-       if (!msg) {
-               printf("failed to get list names");
-               return -EBADMSG;
-       }
-
-       ret = dbus_message_get_args(msg, NULL, DBUS_TYPE_ARRAY,
-           DBUS_TYPE_STRING, &list, &size, DBUS_TYPE_INVALID);
-       dbus_message_unref(msg);
-       if (!ret) {
-               printf("invalid list name arguments!");
-               return -EINVAL;
-       }
-
-       printf("%d connections\n", size);
-
-       for (i = 0; i < size; i++) {
-               arr[0] = list[i];
-               msg = dbus_method_sync_with_reply(DBUS_BUS_NAME,
-                   DBUS_OBJECT_PATH, DBUS_INTERFACE_NAME,
-                   "GetConnectionUnixProcessID", "s", arr);
-               if (!msg)
-                       continue;
-
-               ret = dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32,
-                   &pid, DBUS_TYPE_INVALID);
-               dbus_message_unref(msg);
-               if (!ret)
-                       continue;
-
-               get_pname(pid, pname);
-               printf("%6d  %6s  %s\n", pid, list[i], pname);
-
-       }
-
-       return 0;
-}
-
-static int device_list(char **args)
-{
-       DBusMessage *msg;
-
-       if (!args[1])
-               return -EINVAL;
-
-       printf("print %s to dlog!\n", args[1]);
-
-       msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "DeviceList", NULL, NULL);
-       if (!msg)
-               return -EBADMSG;
-
-       dbus_message_unref(msg);
-
-       return 0;
-}
-
-static int set_usb_mode(char **args)
-{
-       return load_usb_mode(args[3]);
-}
-
-static int unset_usb_mode(char **args)
-{
-       return unload_usb_mode(args[3]);
-}
-
-static int enable_device(char **args)
-{
-       DBusMessage *msg;
-       char *arr[1];
-
-       if (!args[3])
-               return -EINVAL;
-
-       printf("enable %s device!\n", args[3]);
-
-       arr[0] = args[3];
-
-       msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "enable", "s", arr);
-       if (!msg)
-               return -EBADMSG;
-
-       dbus_message_unref(msg);
-
-       return 0;
-}
-
-static int disable_device(char **args)
-{
-       DBusMessage *msg;
-       char *arr[1];
-
-       if (!args[3])
-               return -EINVAL;
-
-       printf("disable %s device!\n", args[3]);
-
-       arr[0] = args[3];
-
-       msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "disable", "s", arr);
-       if (!msg)
-               return -EBADMSG;
-
-       dbus_message_unref(msg);
-
-       return 0;
-}
-
-static int power_operation(char **args, char *type)
-{
-       DBusMessage *msg;
-       char *arr[2];
-
-       if (!args[1] || !type)
-               return -EINVAL;
-
-       printf("Power %s device!\n", args[2]);
-
-       arr[0] = type;
-       arr[1] = "0";
-
-       msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
-                   devices[arg_id].path, devices[arg_id].iface,
-                   "reboot", "si", arr);
-       if (!msg)
-               return -EBADMSG;
-
-       dbus_message_unref(msg);
-
-       return 0;
-}
-static int power_off(char **args)
-{
-       return power_operation(args, "poweroff");
-}
-
-static int power_reboot(char **args)
-{
-       return power_operation(args, "reboot");
-}
-
-static const struct action {
-       const enum device_type id;
-       const char *action;
-       const int argc;
-       int (* const func)(char **args);
-       const char *option;
-} actions[] = {
-       { DEVICE_ALL,       "start",           3, start_device,      ""            },
-       { DEVICE_ALL,       "stop",            3, stop_device,       ""            },
-       { DEVICE_DISPLAY,   "dumpmode",        4, dump_mode,         "[on|off]"    },
-       { DEVICE_LED,       "dumpmode",        4, dump_mode,         "[on|off]"    },
-       { DEVICE_DISPLAY,   "savelog",         3, save_log,          ""            },
-       { DEVICE_USB,       "set",             4, set_usb_mode,      "[sdb|ssh]"   },
-       { DEVICE_USB,       "unset",           4, unset_usb_mode,    "[sdb|ssh]"   },
-       { DEVICE_CORE,      "dbusname",        3, save_dbus_name,    ""            },
-       { DEVICE_CORE,      "devicelist",      3, device_list,       ""            },
-       { DEVICE_EXTCON,    "enable",          4, enable_device,     "[USB|HEADPHONE|HDMI|DOCK]" },
-       { DEVICE_EXTCON,    "disable",         4, disable_device,    "[USB|HEADPHONE|HDMI|DOCK]" },
-       { DEVICE_POWER,     "off",             3, power_off,         ""            },
-       { DEVICE_POWER,     "reboot",          3, power_reboot,      ""            },
-};
-
-static inline void usage()
-{
-       printf("[usage] devicectl <device_name> <action>\n");
-       printf("Please use option --help to check options\n");
-}
-
-static void help()
-{
-       int i;
-
-       printf("[usage] devicectl <device_name> <action> <option>\n");
-       printf("device name & action & option\n");
-       for (i = 0; i < ARRAY_SIZE(actions); i++) {
-               if (actions[i].id == DEVICE_ALL) {
-                       printf("    [all-device] %s %s\n", actions[i].action,
-                           actions[i].option);
-               } else {
-                       printf("    %s %s %s\n", devices[actions[i].id].name,
-                           actions[i].action, actions[i].option);
-               }
-       }
-}
-
-int main(int argc, char *argv[])
-{
-       int i;
-
-       if (argc == 2 && !strcmp(argv[1], "--help")) {
-               help();
-               return 0;
-       }
-
-       if (argc < 3) {
-               usage();
-               return -EINVAL;
-       }
-
-       for (i = 0; i < argc; i++)
-               if (argv[i] == NULL) {
-                       usage();
-                       return -EINVAL;
-               }
-
-       for (i = 0; i < ARRAY_SIZE(devices); i++)
-               if (!strcmp(argv[1], devices[i].name))
-                       break;
-
-       if (i >= ARRAY_SIZE(devices)) {
-               printf("invalid device name! %s\n", argv[1]);
-               usage();
-               return -EINVAL;
-       }
-
-       arg_id = devices[i].id;
-
-       for (i = 0; i < ARRAY_SIZE(actions); i++)
-               if (actions[i].id == arg_id || actions[i].id == DEVICE_ALL)
-                       if (!strcmp(argv[2], actions[i].action))
-                               break;
-
-       if (i >= ARRAY_SIZE(actions)) {
-               printf("invalid action name! %s\n", argv[2]);
-               usage();
-               return -EINVAL;
-       }
-
-       if (actions[i].argc != argc) {
-               printf("invalid arg count!\n");
-               usage();
-               return -EINVAL;
-       }
-
-       return actions[i].func(argv);
-}
diff --git a/src/devicectl/usb.c b/src/devicectl/usb.c
deleted file mode 100644 (file)
index 9c3403f..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * devicectl
- *
- * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <core/common.h>
-#include <core/launch.h>
-#include "usb.h"
-
-#define USB_SDB "sdb"
-#define USB_SSH "ssh"
-
-#define ARG_MAX 10
-#define CMD_MAX 128
-
-static struct usb_sysfs {
-       char *path;
-       char *value;
-} usb_confs[] = {
-       { "/sys/class/usb_mode/usb0/enable",          "0"    },
-       { "/sys/class/usb_mode/usb0/idVendor",        "04e8" },
-       { "/sys/class/usb_mode/usb0/idProduct",       NULL   },
-       { "/sys/class/usb_mode/usb0/funcs_fconf",     NULL   },
-       { "/sys/class/usb_mode/usb0/funcs_sconf",     NULL   },
-       { "/sys/class/usb_mode/usb0/bDeviceClass",    "239"  },
-       { "/sys/class/usb_mode/usb0/bDeviceSubClass", "2"    },
-       { "/sys/class/usb_mode/usb0/bDeviceProtocol", "1"    },
-       { "/sys/class/usb_mode/usb0/enable",          "1"    },
-};
-
-static int launch_app(char **argv)
-{
-       pid_t pid;
-
-       if (!argv || !argv[0])
-               return -EINVAL;
-
-       pid = fork();
-
-       if (pid < 0) {
-               printf("fork() failed\n");
-               return -ENOMEM;
-       }
-
-       if (pid > 0) { /*parent*/
-               return pid;
-       }
-
-       /*child*/
-
-       if (execvp(argv[0], argv) < 0)
-               printf("execvp failed (%d)\n", errno);
-
-       return 0;
-}
-
-static int write_sysfs(char *path, char *value)
-{
-       FILE *fp;
-       int ret;
-
-       if (!path || !value)
-               return -ENOMEM;
-
-       fp = fopen(path, "w");
-       if (!fp) {
-               printf("FAIL: fopen(%s)\n", path);
-               return -ENOMEM;
-       }
-
-       ret = fwrite(value, sizeof(char), strlen(value), fp);
-       fclose(fp);
-       if (ret < strlen(value)) {
-               printf("FAIL: fwrite(%s)\n", value);
-               ret = -ENOMEM;
-       }
-
-       return ret;
-}
-
-static int set_usb_configuration(char *idproduct, char *fconf, char *sconf)
-{
-       int i, ret;
-
-       usb_confs[2].value = idproduct;
-       usb_confs[3].value = fconf;
-       usb_confs[4].value = sconf;
-
-       for (i = 0; i < ARRAY_SIZE(usb_confs); i++) {
-               ret = write_sysfs(usb_confs[i].path, usb_confs[i].value);
-               if (ret < 0) {
-                       printf("usb setting fails (%s), (%s)\n", usb_confs[i].path, usb_confs[i].value);
-                       return ret;
-               }
-       }
-
-       return 0;
-}
-
-static int divide_cmd(char **command, int len, char *cmd)
-{
-       char *param, *next, *term;
-       int cnt = 0;
-
-       if (!cmd)
-               return -EINVAL;
-
-       term = strchr(cmd, '\0');
-       if (!term)
-               return -EINVAL;
-
-       memset(command, 0, len);
-
-       param = cmd;
-       while (1) {
-               if (*param == '\0')
-                       break;
-               if (*param == ' ') {
-                       param++;
-                       continue;
-               }
-
-               next = strchr(param, ' ');
-               if (!next) {
-                       command[cnt++] = param;
-                       break;
-               }
-
-               if (next == param) {
-                       param++;
-                       continue;
-               }
-
-               *next = '\0';
-               command[cnt++] = param;
-               param = next + 1;
-       }
-
-       return 0;
-}
-
-static int run_cmd(char *cmd)
-{
-       int ret;
-       char *command[ARG_MAX];
-       char in_cmd[CMD_MAX];
-
-       if (!cmd)
-               return -EINVAL;
-
-       snprintf(in_cmd, sizeof(in_cmd), "%s", cmd);
-
-       ret = divide_cmd(command, sizeof(command), in_cmd);
-       if (ret < 0)
-               return ret;
-
-       ret = launch_app(command);
-       if (ret < 0)
-               return ret;
-
-       return 0;
-
-}
-
-static int load_sdb(void)
-{
-       int ret;
-
-       ret = set_usb_configuration("6860", "mtp", "mtp,acm,sdb");
-       if (ret < 0)
-               return ret;
-
-       return run_cmd("/usr/bin/systemctl start sdbd.service");
-}
-
-static int load_ssh(void)
-{
-       int ret;
-
-       ret = set_usb_configuration("6863", "rndis", " ");
-       if (ret < 0)
-               return ret;
-
-       ret = run_cmd("/sbin/ifconfig usb0 192.168.129.3 up");
-       if (ret < 0)
-               return ret;
-
-       ret = run_cmd("/sbin/route add -net 192.168.129.0 netmask 255.255.255.0 dev usb0");
-       if (ret < 0)
-               return ret;
-
-       ret = run_cmd("/usr/bin/systemctl start sshd.service");
-       if (ret < 0)
-               return ret;
-
-       return 0;
-}
-
-static int unload_sdb(void)
-{
-       int ret;
-
-       ret = write_sysfs(usb_confs[0].path, usb_confs[0].value);
-       if (ret < 0)
-               return ret;
-
-       ret = run_cmd("/usr/bin/systemctl stop sdbd.service");
-       if (ret < 0)
-               return ret;
-
-       return 0;
-}
-
-static int unload_ssh(void)
-{
-       int ret;
-
-       ret = write_sysfs(usb_confs[0].path, usb_confs[0].value);
-       if (ret < 0)
-               return ret;
-
-       ret = run_cmd("/sbin/ifconfig usb0 down");
-       if (ret < 0)
-               return ret;
-
-       ret = run_cmd("/usr/bin/systemctl stop sshd.service");
-       if (ret < 0)
-               return ret;
-
-       return 0;
-}
-
-int load_usb_mode(char *opt)
-{
-       if (!opt) {
-               printf("Failed: Forth parameter is NULL\n");
-               return -EINVAL;
-       }
-
-       if (!strncmp(opt, USB_SDB, strlen(opt)))
-               return load_sdb();
-
-       if (!strncmp(opt, USB_SSH, strlen(opt)))
-               return load_ssh();
-
-       printf("Failed: Forth parameter is invalid (%s)\n", opt);
-       return -EINVAL;
-}
-
-int unload_usb_mode(char *opt)
-{
-       if (!opt) {
-               printf("Failed: Forth parameter is NULL\n");
-               return -EINVAL;
-       }
-
-       if (!strncmp(opt, USB_SDB, strlen(opt)))
-               return unload_sdb();
-
-       if (!strncmp(opt, USB_SSH, strlen(opt)))
-               return unload_ssh();
-
-       printf("Failed: Forth parameter is invalid (%s)\n", opt);
-       return -EINVAL;
-}
diff --git a/src/devicectl/usb.h b/src/devicectl/usb.h
deleted file mode 100644 (file)
index e2285d8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * devicectl
- *
- * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __DEVICECTL_USBCLIENT_H__
-#define __DEVICECTL_USBCLIENT_H__
-
-int load_usb_mode(char *opt);
-int unload_usb_mode(char *opt);
-
-#endif /* __DEVICECTL_USBCLIENT_H__*/