aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/device
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-11-11 12:32:40 +0100
committerPaul Kocialkowski <contact@paulk.fr>2012-11-11 12:32:40 +0100
commitd9622e4a4bcee8132ff3dfe89beed5399f3bdeb8 (patch)
tree60054b6342eb04620283cf7a9fcb56963dc5dd2e /samsung-ipc/device
parentf722771a3837793c397d1db5075b8e8bd2906fed (diff)
downloadexternal_libsamsung-ipc-d9622e4a4bcee8132ff3dfe89beed5399f3bdeb8.zip
external_libsamsung-ipc-d9622e4a4bcee8132ff3dfe89beed5399f3bdeb8.tar.gz
external_libsamsung-ipc-d9622e4a4bcee8132ff3dfe89beed5399f3bdeb8.tar.bz2
GPRS: Pass CID to activate/deactivate functions
Aries: Use CID to activate/deactivate the corresponding iface Change-Id: Ifd153eda59404921bc6ea12d27f94d5aee7b06ff Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc/device')
-rw-r--r--samsung-ipc/device/aries/aries_ipc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/samsung-ipc/device/aries/aries_ipc.c b/samsung-ipc/device/aries/aries_ipc.c
index fa9a5fb..9e095d6 100644
--- a/samsung-ipc/device/aries/aries_ipc.c
+++ b/samsung-ipc/device/aries/aries_ipc.c
@@ -38,6 +38,7 @@
#include <asm/types.h>
#include <mtd/mtd-abi.h>
#include <assert.h>
+#include <string.h>
#include <radio.h>
@@ -796,17 +797,22 @@ int aries_ipc_power_off(void *data)
//TODO: there are also suspend/resume nodes
-int aries_ipc_gprs_activate(void *data)
+int aries_ipc_gprs_activate(void *data, int cid)
{
int fd = open("/sys/class/net/svnet0/pdp/activate", O_RDWR);
- char activate_data[] = "1\n";
+ char *activate_data = NULL;
int rc;
if(fd < 0)
return -1;
- rc = write(fd, activate_data, sizeof(activate_data) - 1);
+ asprintf(&activate_data, "%d\n", cid);
+ if(activate_data == NULL)
+ return -1;
+
+ rc = write(fd, activate_data, strlen(activate_data));
+ free(activate_data);
close(fd);
if(rc < 0)
@@ -816,17 +822,22 @@ int aries_ipc_gprs_activate(void *data)
}
-int aries_ipc_gprs_deactivate(void *data)
+int aries_ipc_gprs_deactivate(void *data, int cid)
{
int fd = open("/sys/class/net/svnet0/pdp/deactivate", O_RDWR);
- char deactivate_data[] = "1\n";
+ char *deactivate_data = NULL;
int rc;
if(fd < 0)
return -1;
- rc = write(fd, deactivate_data, sizeof(deactivate_data) - 1);
+ asprintf(&deactivate_data, "%d\n", cid);
+ if(deactivate_data == NULL)
+ return -1;
+
+ rc = write(fd, deactivate_data, strlen(deactivate_data));
+ free(deactivate_data);
close(fd);
if(rc < 0)