Open Source Telephony
 help / color / mirror / Atom feed
From: Piotr Haber <gluedig@gmail.com>
To: ofono@ofono.org
Subject: [PATCH 2/2] udevng: unify telit and xe910
Date: Thu, 02 Feb 2017 15:09:27 +0100	[thread overview]
Message-ID: <20170202140927.8152-3-gluedig@gmail.com> (raw)
In-Reply-To: <20170202140927.8152-1-gluedig@gmail.com>

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

Unified setup for Telit devices using
usbserial and cdc_acm drivers.
---
 plugins/udevng.c | 44 ++++++--------------------------------------
 1 file changed, 6 insertions(+), 38 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 098e0651..b98d9d43 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -611,7 +611,7 @@ static gboolean setup_nokia(struct modem_info *modem)
 
 static gboolean setup_telit(struct modem_info *modem)
 {
-	const char *mdm = NULL, *aux = NULL, *gps = NULL, *diag = NULL;
+	const char *mdm = NULL, *aux = NULL, *gps = NULL, *net = NULL;
 	GSList *list;
 
 	DBG("%s", modem->syspath);
@@ -621,7 +621,6 @@ static gboolean setup_telit(struct modem_info *modem)
 
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
-
 		if (g_strcmp0(info->label, "aux") == 0) {
 			aux = info->devnode;
 			if (mdm != NULL)
@@ -633,41 +632,11 @@ static gboolean setup_telit(struct modem_info *modem)
 		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
 			if (g_strcmp0(info->number, "00") == 0)
 				mdm = info->devnode;
-			else if (g_strcmp0(info->number, "01") == 0)
-				diag = info->devnode;
 			else if (g_strcmp0(info->number, "02") == 0)
 				gps = info->devnode;
 			else if (g_strcmp0(info->number, "03") == 0)
 				aux = info->devnode;
-		}
-	}
-
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
-	DBG("modem=%s aux=%s gps=%s diag=%s", mdm, aux, gps, diag);
-
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "GPS", gps);
-
-	return TRUE;
-}
-
-static gboolean setup_xe910(struct modem_info *modem)
-{
-	const char *mdm = NULL, *aux = NULL, *gps = NULL, *net = 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", info->devnode, info->interface,
-						info->number, info->label);
-
-		if (g_strcmp0(info->interface, "2/2/1") == 0) {
+		} else if (g_strcmp0(info->interface, "2/2/1") == 0) {
 			if (g_strcmp0(info->number, "00") == 0)
 				mdm = info->devnode;
 			else if (g_strcmp0(info->number, "06") == 0)
@@ -981,8 +950,7 @@ static struct {
 	{ "alcatel",	setup_alcatel	},
 	{ "novatel",	setup_novatel	},
 	{ "nokia",	setup_nokia	},
-	{ "telit",	setup_telit	},
-	{ "xe910",	setup_xe910,	"device/interface"	},
+	{ "telit",	setup_telit,	"device/interface"	},
 	{ "simcom",	setup_simcom	},
 	{ "zte",	setup_zte	},
 	{ "icera",	setup_icera	},
@@ -1220,7 +1188,7 @@ static struct {
 	{ "simcom",	"option",	"05c6", "9000"	},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
-	{ "xe910",	"cdc_acm",	"1bc7", "0021"	},
+	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
 	{ "nokia",	"option",	"0421", "060e"	},
 	{ "nokia",	"option",	"0421", "0623"	},
 	{ "samsung",	"option",	"04e8", "6889"	},
@@ -1232,8 +1200,8 @@ static struct {
 	{ "gemalto",	"option",	"1e2d",	"0053"	},
 	{ "gemalto",	"cdc_wdm",	"1e2d",	"0053"	},
 	{ "gemalto",	"qmi_wwan",	"1e2d",	"0053"	},
-	{ "xe910",	"cdc_ncm",	"1bc7", "0036"	},
-	{ "xe910",	"cdc_acm",	"1bc7", "0036"	},
+	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
+	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
 	{ }
 };
 
-- 
2.11.0


  parent reply	other threads:[~2017-02-02 14:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 14:09 [PATCH 0/2] unify telit and xe910 plugins Piotr Haber
2017-02-02 14:09 ` [PATCH 1/2] plugins: rename xe910 to telit Piotr Haber
2017-02-02 14:09 ` Piotr Haber [this message]
2017-02-02 17:57 ` [PATCH 0/2] unify telit and xe910 plugins 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=20170202140927.8152-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox