Open Source Telephony
 help / color / mirror / Atom feed
From: Marit Henriksen <tomasz.gregorek@gmail.com>
To: ofono@ofono.org
Subject: [PATCHv2 1/2] ste: Add support for multiple pdp contexts.
Date: Mon, 21 Feb 2011 12:58:55 +0100	[thread overview]
Message-ID: <1298289535-5865-1-git-send-email-maritsofie.henriksen8@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

From: Marit Henriksen <marit.henriksen@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


             reply	other threads:[~2011-02-21 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 11:58 Marit Henriksen [this message]
2011-02-21 16:27 ` [PATCHv2 1/2] ste: Add support for multiple pdp contexts Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298289535-5865-1-git-send-email-maritsofie.henriksen8@gmail.com \
    --to=tomasz.gregorek@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox