Fix telephony technology driver
authorDanny Jeongseok Seo <S.Seo@samsung.com>
Thu, 31 May 2012 01:43:33 +0000 (10:43 +0900)
committerDanny Jeongseok Seo <S.Seo@samsung.com>
Thu, 31 May 2012 01:43:33 +0000 (10:43 +0900)
[Team] Data Network
[Problem issues #] N/A
[Problem] Cellular device is not enabled.
[Cause] Telephony technology driver has not registered correctly.
[Solution] Telephony technology driver registered correctly.

Change-Id: I3219d3555236ff594e1eec01b3713dca510d81a0

debian/changelog
packaging/connman.spec.orig [deleted file]
packaging/connman.spec.rej [deleted file]
plugins/telephony.c
resources/var/lib/connman/settings
src/resolver.c
src/service.c

index e5dac89..303d778 100644 (file)
@@ -1,3 +1,11 @@
+connman (0.78.4-0slp2+78) unstable; urgency=low
+
+  * Fix telephony technology driver
+  * Git: slp/pkgs/c/connman
+  * Tag: connman_0.78.4-0slp2+78
+
+ -- Danny Jeongseok Seo <s.seo@samsung.com>  Wed, 09 May 2012 17:56:57 +0900
+
 connman (0.78.4-0slp2+77) unstable; urgency=low
 
   * Upgrade ConnMan-stable 0.78.4
diff --git a/packaging/connman.spec.orig b/packaging/connman.spec.orig
deleted file mode 100644 (file)
index 422b186..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#sbs-git:pkgs/c/connman connman 0.77.2
-
-Name:       connman
-Summary:    Connection Manager
-Version:    0.77.2_75
-Release:    1
-Group:      System/Network
-License:    GNU General Public License version 2
-URL:        http://connman.net
-Source0:    %{name}-%{version}.tar.gz
-BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(dbus-1)
-BuildRequires:  pkgconfig(xtables)
-BuildRequires:  pkgconfig(libiptc)
-
-%description
-Connection Manager provides a daemon for managing Internet connections
-within embedded devices running the Linux operating system.
-
-%prep
-%setup -q
-
-
-%build
-
-./autogen.sh
-
-./configure --prefix=/usr \
-            --localstatedir=/var \
-            --enable-threads \
-            --enable-tizen-ext \
-            --enable-wifi=builtin
-
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-%make_install
-
-mkdir -p %{buildroot}/var/lib/connman
-cp resources/var/lib/connman/default.profile %{buildroot}/var/lib/connman/default.profile
-mkdir -p %{buildroot}/usr/share/dbus-1/services
-cp resources/usr/share/dbus-1/services/net.connman.service %{buildroot}/usr/share/dbus-1/services/net.connman.service
-mkdir -p %{buildroot}/usr/etc/connman
-cp src/main.conf %{buildroot}/usr/etc/connman/main.conf
-mkdir -p %{buildroot}/etc/rc.d/init.d
-cp resources/etc/rc.d/init.d/connman %{buildroot}/etc/rc.d/init.d/connman
-mkdir -p %{buildroot}/etc/rc.d/rc3.d
-ln -s ../init.d/connman %{buildroot}/etc/rc.d/rc3.d/S61connman
-mkdir -p %{buildroot}/etc/rc.d/rc5.d
-ln -s ../init.d/connman %{buildroot}/etc/rc.d/rc5.d/S61connman
-
-rm -rf %{buildroot}/usr/include/
-rm -rf %{buildroot}/usr/lib/pkgconfig/
-rm %{buildroot}/etc/dbus-1/system.d/*.conf
-
-mkdir -p %{buildroot}/usr/etc/dbus-1/system.d/
-cp src/connman.conf %{buildroot}/usr/etc/dbus-1/system.d/
-
-
-%post
-#Resource
-chmod 600 /var/lib/connman/default.profile
-
-
-%files
-%defattr(-,root,root,-)
-#%doc AUTHORS COPYING INSTALL ChangeLog NEWS README
-%{_sbindir}/*
-%{_var}/lib/connman/default.profile
-%{_libdir}/connman/plugins/*.so
-%{_datadir}/dbus-1/services/*
-%{_prefix}/etc/dbus-1/system.d/*
-%{_prefix}/etc/connman/main.conf
-%{_prefix}/etc/dbus-1/system.d/*.conf
-%{_sysconfdir}/rc.d/init.d/connman
-%{_sysconfdir}/rc.d/rc3.d/S61connman
-%{_sysconfdir}/rc.d/rc5.d/S61connman
diff --git a/packaging/connman.spec.rej b/packaging/connman.spec.rej
deleted file mode 100644 (file)
index b1de316..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- packaging/connman.spec
-+++ packaging/connman.spec
-@@ -1,8 +1,8 @@
--#sbs-git:pkgs/c/connman connman 0.77.2
-+#sbs-git:pkgs/c/connman connman 0.78.4
- Name:       connman
- Summary:    Connection Manager
--Version:    0.77.2_76
-+Version:    0.78.4_77
- Release:    1
- Group:      System/Network
- License:    GNU General Public License version 2
index 7e0b795..14e948a 100644 (file)
@@ -165,6 +165,22 @@ static struct connman_network_driver network_driver = {
        .disconnect     = __network_disconnect,
 };
 
+static int tech_probe(struct connman_technology *technology)
+{
+       return 0;
+}
+
+static void tech_remove(struct connman_technology *technology)
+{
+}
+
+static struct connman_technology_driver tech_driver = {
+       .name           = "cellular",
+       .type           = CONNMAN_SERVICE_TYPE_CELLULAR,
+       .probe          = tech_probe,
+       .remove         = tech_remove,
+};
+
 // local function
 static void telephony_connect(DBusConnection *connection, void *user_data)
 {
@@ -741,6 +757,7 @@ static void __add_connman_device(const char* modem_path, const char* operator)
        connman_device_set_data(device, modem);
 
        if (connman_device_register(device) < 0) {
+               connman_error("Failed to register cellular device");
                connman_device_unref(device);
                return;
        }
@@ -1524,6 +1541,13 @@ static int telephony_init(void)
                goto remove;
        }
 
+       err = connman_technology_driver_register(&tech_driver);
+       if (err < 0) {
+               connman_device_driver_unregister(&modem_driver);
+               connman_network_driver_unregister(&network_driver);
+               goto remove;
+       }
+
        return 0;
 
 remove:
index 75a10d9..e1fd531 100644 (file)
@@ -12,7 +12,7 @@ Enable=false
 Enable=false
 
 [3G]
-Enable=false
+Enable=true
 
 [WiMAX]
 Enable=false
index 4f508d6..4d836e1 100644 (file)
@@ -125,7 +125,7 @@ static int resolvfile_export(void)
 #if defined TIZEN_EXT
 /*
  * Description: /etc path is read-only in SLP
- *              /opt/etc/resolve.conf rather than /etc/resolve.conf
+ *              /opt/etc/resolv.conf rather than /etc/resolv.conf
  */
        fd = open("/opt/etc/resolv.conf", O_RDWR | O_CREAT | O_CLOEXEC,
                                        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
index 5b4a1b3..ace9b32 100644 (file)
@@ -1812,12 +1812,13 @@ static int __connman_service_dbus_update_default_info(int type, ...)
 static connman_bool_t __connman_service_is_internet_profile(
                struct connman_service *cellular)
 {
+#define CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX        CONNMAN_PATH "/service/cellular_"
        DBG("Service path: %s", cellular->path);
 
        const char internet_suffix[] = "_1";
        char *suffix = NULL;
 
-       if (strstr(cellular->path, "cellular_") != NULL) {
+       if (g_str_has_prefix(cellular->path, CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX) == TRUE) {
                suffix = strrchr(cellular->path, '_');
                if (strcmp(suffix, internet_suffix) == 0)
                        return TRUE;