From 305514ced97ae5144d4cac1e848ba661e2ec4a31 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 26 Oct 2010 17:05:23 +0200 Subject: [PATCH] ifx: Add support for having three active GPRS contexts The Infineon modem can at least support three active GPRS contexts in M-RAW_IP mode. So use another DLC for the third context. --- plugins/ifx.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/ifx.c b/plugins/ifx.c index c28b730f..0d46c032 100644 --- a/plugins/ifx.c +++ b/plugins/ifx.c @@ -62,19 +62,21 @@ #include #include -#define NUM_DLC 5 +#define NUM_DLC 6 #define VOICE_DLC 0 #define NETREG_DLC 1 #define GPRS1_DLC 2 #define GPRS2_DLC 3 -#define AUX_DLC 4 +#define GPRS3_DLC 4 +#define AUX_DLC 5 -static char *dlc_prefixes[NUM_DLC] = { "Voice: ", "Net: ", - "GPRS1: ", "GPRS2: ", "Aux: " }; +static char *dlc_prefixes[NUM_DLC] = { "Voice: ", "Net: ", "GPRS1: ", + "GPRS2: ", "GPRS3: ", "Aux: " }; static const char *dlc_nodes[NUM_DLC] = { "/dev/ttyGSM1", "/dev/ttyGSM2", - "/dev/ttyGSM3", "/dev/ttyGSM4", "/dev/ttyGSM6" }; + "/dev/ttyGSM3", "/dev/ttyGSM4", + "/dev/ttyGSM5", "/dev/ttyGSM6" }; static const char *none_prefix[] = { NULL }; static const char *xdrv_prefix[] = { "+XDRV:", NULL }; @@ -373,6 +375,7 @@ static gboolean dlc_setup(gpointer user_data) g_at_chat_set_slave(data->dlcs[GPRS1_DLC], data->dlcs[NETREG_DLC]); g_at_chat_set_slave(data->dlcs[GPRS2_DLC], data->dlcs[NETREG_DLC]); + g_at_chat_set_slave(data->dlcs[GPRS3_DLC], data->dlcs[NETREG_DLC]); g_at_chat_send(data->dlcs[AUX_DLC], "AT+CFUN=4", NULL, cfun_enable, modem, NULL); @@ -745,6 +748,11 @@ static void ifx_post_online(struct ofono_modem *modem) "ifxmodem", data->dlcs[GPRS2_DLC]); if (gc) ofono_gprs_add_context(gprs, gc); + + gc = ofono_gprs_context_create(modem, 0, + "ifxmodem", data->dlcs[GPRS3_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); } }