All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Xu <martin.xu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 4/4] add mbm_gprs_create/destroy_interface to mbm gprs_context_driver
Date: Mon, 09 Nov 2009 15:38:01 +0800	[thread overview]
Message-ID: <1257752281-22251-4-git-send-email-martin.xu@intel.com> (raw)
In-Reply-To: <1257752281-22251-3-git-send-email-martin.xu@intel.com>

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

---
 drivers/mbmmodem/gprs-context.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/mbmmodem/gprs-context.c b/drivers/mbmmodem/gprs-context.c
index ecbafa0..d3e03b7 100644
--- a/drivers/mbmmodem/gprs-context.c
+++ b/drivers/mbmmodem/gprs-context.c
@@ -172,6 +172,25 @@ error:
 	CALLBACK_WITH_FAILURE(cb, data);
 }
 
+static void mbm_gprs_create_interface(struct ofono_gprs_context *gc,
+					struct ofono_gprs_primary_context *ctx)
+{
+	const char *interface;
+	struct ofono_modem *modem = ofono_gprs_context_get_modem(gc);
+
+	interface = ofono_modem_get_string(modem, "NetworkInterface");
+
+	g_free(ctx->interface);
+	ctx->interface = g_strdup(interface);
+}
+
+static void mbm_gprs_destroy_interface(struct ofono_gprs_context *gc,
+					struct ofono_gprs_primary_context *ctx)
+{
+	g_free(ctx->interface);
+	ctx->interface = NULL;
+}
+
 static void e2nap_notifier(GAtResult *result, gpointer user_data)
 {
 	struct ofono_gprs_context *gc = user_data;
@@ -237,6 +256,8 @@ static struct ofono_gprs_context_driver driver = {
 	.remove			= mbm_gprs_context_remove,
 	.activate_primary	= mbm_gprs_activate_primary,
 	.deactivate_primary	= mbm_gprs_deactivate_primary,
+	.create_interface	= mbm_gprs_create_interface,
+	.destroy_interface	= mbm_gprs_destroy_interface,
 };
 
 void mbm_gprs_context_init()
-- 
1.6.1.3


  reply	other threads:[~2009-11-09  7:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09  7:37 [PATCH 1/4] add interface property to primary context Martin Xu
2009-11-09  7:37 ` [PATCH 2/4] add create/destroy_interface to ofono_gprs_context_driver Martin Xu
2009-11-09  7:38   ` [PATCH 3/4] add function ofono_gprs_context_get_modem Martin Xu
2009-11-09  7:38     ` Martin Xu [this message]
2009-11-09 16:59   ` [PATCH 2/4] add create/destroy_interface to ofono_gprs_context_driver Denis Kenzior
2009-11-09  7:42 ` [PATCH */4] add interface property to primary context Xu, Martin
2009-11-10  3:28   ` How does ConnMan works with Ofono? " Xu, Martin
2009-11-10  4:52     ` Xu, Martin
2009-11-09 16:57 ` [PATCH 1/4] " Denis Kenzior

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=1257752281-22251-4-git-send-email-martin.xu@intel.com \
    --to=martin.xu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.