summaryrefslogtreecommitdiffstats
path: root/drivers/huaweimodem
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-05-26 09:48:25 +0200
committerMarcel Holtmann <marcel@holtmann.org>2012-05-26 09:48:25 +0200
commit3f191c3397aacec593f9a6dc9f81d6f0c9ce5bfb (patch)
tree8f5cf1a746c358248b052117d1afc5fefd7b0f6f /drivers/huaweimodem
parent2d95541f3b8f42ea036a7591d03762dea4bb776b (diff)
downloadofono-3f191c3397aacec593f9a6dc9f81d6f0c9ce5bfb.tar.bz2
huaweimodem: Use network interface from modem for GPRS context
Diffstat (limited to 'drivers/huaweimodem')
-rw-r--r--drivers/huaweimodem/gprs-context.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/huaweimodem/gprs-context.c b/drivers/huaweimodem/gprs-context.c
index db697dbb..3acd90c2 100644
--- a/drivers/huaweimodem/gprs-context.c
+++ b/drivers/huaweimodem/gprs-context.c
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
-#include <sys/stat.h>
#include <glib.h>
@@ -42,8 +41,6 @@
#include "huaweimodem.h"
-#define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun"
-
static const char *none_prefix[] = { NULL };
static const char *dhcp_prefix[] = { "^DHCP:", NULL };
@@ -100,6 +97,7 @@ static void dhcp_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
struct ofono_gprs_context *gc = user_data;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtResultIter iter;
+ struct ofono_modem *modem;
const char *interface;
char *ip = NULL;
char *netmask = NULL;
@@ -136,7 +134,8 @@ static void dhcp_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_info("IP: %s Gateway: %s", ip, gateway);
ofono_info("DNS: %s, %s", dns1, dns2);
- interface = "invalid";
+ modem = ofono_gprs_context_get_modem(gc);
+ interface = ofono_modem_get_string(modem, "NetworkInterface");
ofono_gprs_context_set_interface(gc, interface);
ofono_gprs_context_set_ipv4_address(gc, ip, TRUE);
@@ -314,15 +313,9 @@ static int huawei_gprs_context_probe(struct ofono_gprs_context *gc,
{
GAtChat *chat = data;
struct gprs_context_data *gcd;
- struct stat st;
DBG("");
- if (stat(TUN_SYSFS_DIR, &st) < 0) {
- ofono_error("Missing support for TUN/TAP devices");
- return -ENODEV;
- }
-
gcd = g_try_new0(struct gprs_context_data, 1);
if (gcd == NULL)
return -ENOMEM;