Open Source Telephony
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: ofono@ofono.org
Subject: [RFC PATCH 3/4] plugins: gemalto: add optional gprs-context driver
Date: Sun, 16 Aug 2020 00:43:57 +0300	[thread overview]
Message-ID: <20200815214358.69100-4-geomatsi@gmail.com> (raw)
In-Reply-To: <20200815214358.69100-1-geomatsi@gmail.com>

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

Setup custom gprs context driver for modems that provide
USB ethernet interfaces for data path.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 plugins/gemalto.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/plugins/gemalto.c b/plugins/gemalto.c
index 13950742..238c7cc4 100644
--- a/plugins/gemalto.c
+++ b/plugins/gemalto.c
@@ -588,6 +588,8 @@ static void gemalto_post_sim(struct ofono_modem *modem)
 	struct ofono_gprs *gprs;
 	struct ofono_gprs_context *gc;
 	const char *model = ofono_modem_get_string(modem, "Model");
+	const char *driver = NULL;
+	const char *iface = NULL;
 
 	DBG("%p", modem);
 
@@ -596,7 +598,15 @@ static void gemalto_post_sim(struct ofono_modem *modem)
 	ofono_sms_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app);
 
 	gprs = ofono_gprs_create(modem, 0, "atmodem", data->app);
-	gc = ofono_gprs_context_create(modem, 0, "atmodem", data->mdm);
+
+	iface = ofono_modem_get_string(modem, "NetworkInterface");
+	if (iface) {
+		driver = "gemaltomodem";
+	} else {
+		driver = "atmodem";
+	}
+
+	gc = ofono_gprs_context_create(modem, 0, driver, data->mdm);
 
 	if (gprs && gc)
 		ofono_gprs_add_context(gprs, gc);
-- 
2.28.0

  parent reply	other threads:[~2020-08-15 21:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 21:43 [RFC PATCH 0/4] gemalto: USB ethernet data path for ELS81x Sergey Matyukevich
2020-08-15 21:43 ` [RFC PATCH 1/4] drivers: gemalto: add gprs-context driver Sergey Matyukevich
2020-08-17 19:23   ` Denis Kenzior
2020-08-15 21:43 ` [RFC PATCH 2/4] plugins: udevng: detect gemalto network interfaces Sergey Matyukevich
2020-08-15 21:43 ` Sergey Matyukevich [this message]
2020-08-15 21:43 ` [RFC PATCH 4/4] plugins: gemalto: fix incomplete at-chat shutdown Sergey Matyukevich
2020-08-17 16:56   ` Sergey Matyukevich
2020-08-17 19:54   ` Denis Kenzior
2020-08-17 20:22     ` Sergey Matyukevich
2020-08-18  9:06     ` Martin =?unknown-8bit?q?Hundeb=C3=B8ll?=
2020-08-18 14:33       ` 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=20200815214358.69100-4-geomatsi@gmail.com \
    --to=geomatsi@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