Don't manage network interface in PS object
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Thu, 14 Mar 2013 15:59:25 +0000 (16:59 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 06:51:03 +0000 (15:51 +0900)
Change-Id: Ia019a6e730a4c70ce8c688857aa5e68469f8489c

src/at_ps.c

index 5cd0ec2..e6daa36 100644 (file)
@@ -29,7 +29,6 @@
 #include <core_object.h>
 #include <hal.h>
 #include <at.h>
-#include <util.h>
 
 #include <co_ps.h>
 #include <co_context.h>
@@ -71,22 +70,6 @@ static void notify_context_status_changed(CoreObject *co_ps, unsigned int cid,
        dbg("Exit");
 }
 
-static void on_unmount_netif(CoreObject *co_ps, const char *netif_name,
-                               void *user_data)
-{
-       CoreObject *ps_context = user_data;
-       char *ifname;
-
-       dbg("Enter");
-
-       ifname = tcore_context_get_ipv4_devname(ps_context);
-
-       if (tcore_util_netif(ifname, FALSE) != TCORE_RETURN_SUCCESS)
-               dbg("disabling network interface failed");
-
-       dbg("Exit");
-}
-
 static void on_response_set_pdp_context_deactivate(TcorePending *p,
                                                        int data_len,
                                                        const void *data,
@@ -120,7 +103,7 @@ static void on_response_set_pdp_context_deactivate(TcorePending *p,
 
        notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
 
-       if (tcore_hal_setup_netif(h, co_ps, on_unmount_netif, ps_context, cid,
+       if (tcore_hal_setup_netif(h, co_ps, NULL, ps_context, cid,
                                        FALSE) != TCORE_RETURN_SUCCESS)
                err("Failed to disable network interface");
 
@@ -128,7 +111,7 @@ out:
        dbg("Exit");
 }
 
-static void on_mount_netif(CoreObject *co_ps, const char *netif_name,
+static void on_setup_pdp(CoreObject *co_ps, const char *netif_name,
                                void *user_data)
 {
        CoreObject *ps_context = user_data;
@@ -140,8 +123,6 @@ static void on_mount_netif(CoreObject *co_ps, const char *netif_name,
        dbg("devname = [%s]", netif_name);
 
        tcore_context_set_ipv4_devname(ps_context, netif_name);
-       if (tcore_util_netif(netif_name, TRUE) != TCORE_RETURN_SUCCESS)
-               dbg("disabling network interface failed");
 
        server = tcore_plugin_ref_server(tcore_object_ref_plugin(co_ps));
 
@@ -206,7 +187,7 @@ static void on_response_get_pdp_address(TcorePending *p, int data_len,
 
        tcore_context_set_ipv4_dns(ps_context, "8.8.8.8", "8.8.4.4");
 
-       if (tcore_hal_setup_netif(h, co_ps, on_mount_netif, ps_context, cid,
+       if (tcore_hal_setup_netif(h, co_ps, on_setup_pdp, ps_context, cid,
                                        TRUE) == TCORE_RETURN_SUCCESS)
                goto out;
 
@@ -438,11 +419,6 @@ static gboolean on_cgev_notification(CoreObject *co_ps, const void *data,
 
        notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
 
-       /*
-        * TODO Implement core object PS API to retreive context by ID to get
-        * network interface name and disable it.
-        */
-
 out:
        tcore_at_tok_free(tokens);