From: Marit Henriksen <marit.henrik...@stericsson.com>

---
 plugins/ste.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/plugins/ste.c b/plugins/ste.c
index cf8aed8..749c4f3 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);
 }
-- 
1.7.1

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to