diff options
author | Marit Henriksen <marit.henriksen@stericsson.com> | 2011-02-21 12:58:55 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-02-21 08:27:08 -0800 |
commit | 252d35cb05e3166bea1d227dca858123b2de3705 (patch) | |
tree | b731801c2cf05d01caf7a09e5b4394edbb206200 /plugins/ste.c | |
parent | d187f9fc8c9b9dfafb2f088d25be4f6083feaf7c (diff) | |
download | ofono-252d35cb05e3166bea1d227dca858123b2de3705.tar.bz2 |
ste: Add support for multiple pdp contexts.
Diffstat (limited to 'plugins/ste.c')
-rw-r--r-- | plugins/ste.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/ste.c b/plugins/ste.c index cf8aed8e..749c4f36 100644 --- a/plugins/ste.c +++ b/plugins/ste.c @@ -66,6 +66,7 @@ #include <drivers/stemodem/if_caif.h> #define NUM_CHAT 1 +#define MAX_PDP_CONTEXTS 4 static const char *cpin_prefix[] = { "+CPIN:", NULL }; @@ -363,6 +364,7 @@ static void ste_post_online(struct ofono_modem *modem) struct ofono_message_waiting *mw; struct ofono_gprs *gprs; struct ofono_gprs_context *gc; + int i; DBG("%p", modem); @@ -378,13 +380,18 @@ static void ste_post_online(struct ofono_modem *modem) gprs = ofono_gprs_create(modem, OFONO_VENDOR_MBM, "atmodem", data->chat); - gc = ofono_gprs_context_create(modem, 0, "stemodem", data->chat); - - if (gprs && gc) - ofono_gprs_add_context(gprs, gc); + if (gprs) { + for (i = 0; i < MAX_PDP_CONTEXTS; i++) { + gc = ofono_gprs_context_create( + modem, 0, "stemodem", data->chat); + if (gc == NULL) + break; + + ofono_gprs_add_context(gprs, gc); + } + } mw = ofono_message_waiting_create(modem); - if (mw) ofono_message_waiting_register(mw); } |