All of lore.kernel.org
 help / color / mirror / Atom feed
From: Piotr Haber <gluedig@gmail.com>
To: ofono@ofono.org
Subject: [PATCH 4/4] udevng: setup of Telit LE910V2
Date: Wed, 25 Jan 2017 11:41:28 +0100	[thread overview]
Message-ID: <20170125104128.5254-5-gluedig@gmail.com> (raw)
In-Reply-To: <20170125104128.5254-1-gluedig@gmail.com>

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

Setup LE910V2 in default USB composition
with 6 CDC-ACM serial ports and 1 CDC-NCM network adapter.
---
 plugins/udevng.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 50089129..90ddeeab 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -957,6 +957,41 @@ static gboolean setup_gemalto(struct modem_info* modem)
 	return TRUE;
 }
 
+static gboolean setup_le910v2(struct modem_info *modem)
+{
+	const char *aux = NULL, *mdm = NULL, *network = NULL;
+	GSList *list;
+
+	DBG("%s", modem->syspath);
+
+	for (list = modem->devices; list; list = list->next) {
+		struct device_info *info = list->data;
+
+		DBG("%s %s %s %s %s", info->devnode, info->interface,
+					info->number, info->label, info->sysattr);
+
+		if (g_strcmp0(info->interface, "2/2/1") == 0) {
+			if (g_strcmp0(info->number, "00") == 0)
+				aux = info->devnode;
+			else if (g_strcmp0(info->number, "06") == 0)
+				mdm = info->devnode;
+		} else if (info->sysattr && (g_str_has_suffix(info->sysattr,
+						"CDC NCM") == TRUE)) {
+			network = info->devnode;
+		}
+	}
+	DBG("aux=%s modem=%s network=%s", aux, mdm, network);
+
+	if (aux == NULL || mdm == NULL || network == NULL)
+		return FALSE;
+
+	ofono_modem_set_string(modem->modem, "Aux", aux);
+	ofono_modem_set_string(modem->modem, "Modem", mdm);
+	ofono_modem_set_string(modem->modem, "NetworkInterface", network);
+
+	return TRUE;
+}
+
 static struct {
 	const char *name;
 	gboolean (*setup)(struct modem_info *modem);
@@ -984,6 +1019,7 @@ static struct {
 	{ "quectel",	setup_quectel	},
 	{ "ublox",	setup_ublox	},
 	{ "gemalto",	setup_gemalto	},
+	{ "le910v2",	setup_le910v2,	"device/interface"	},
 	{ }
 };
 
@@ -1226,6 +1262,8 @@ static struct {
 	{ "gemalto",	"option",	"1e2d",	"0053"	},
 	{ "gemalto",	"cdc_wdm",	"1e2d",	"0053"	},
 	{ "gemalto",	"qmi_wwan",	"1e2d",	"0053"	},
+	{ "le910v2",	"cdc_ncm",	"1bc7", "0036"	},
+	{ "le910v2",	"cdc_acm",	"1bc7", "0036"	},
 	{ }
 };
 
-- 
2.11.0


      parent reply	other threads:[~2017-01-25 10:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 14:21 [PATCH v2] drivers: add support for Telit LE910 V2 modem Piotr Haber
2017-01-24 18:55 ` Denis Kenzior
2017-01-25 10:41   ` [PATCH 0/4] add support for Telit LE910V2 Piotr Haber
2017-01-25 10:41     ` [PATCH 1/4] telitmodem: support for CDC-NCM network adapter Piotr Haber
2017-01-25 16:33       ` Denis Kenzior
2017-01-25 10:41     ` [PATCH 2/4] plugins: support for Telit LE910 V2 modem Piotr Haber
2017-01-25 16:37       ` Denis Kenzior
2017-01-26  9:09         ` gluedig
2017-01-26  9:40           ` Antoine Aubert
2017-01-26 11:13             ` gluedig
2017-01-26 13:46           ` Denis Kenzior
2017-01-25 10:41     ` [PATCH 3/4] doc: description of Telit LE910V2 network setup Piotr Haber
2017-01-25 16:38       ` Denis Kenzior
2017-01-25 10:41     ` Piotr Haber [this message]

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=20170125104128.5254-5-gluedig@gmail.com \
    --to=gluedig@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 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.