Skip to contentSkip to conversation

unify telit and xe910 plugins

PATCH In review Piotr Haber 2 participants 4 messages Feb 2, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

cover unify telit and xe910 plugins

Expect of Bluetooth SAP related funcionality most of the code in telit and xe910 plugins is the same. Also unify udevng initialization code.

Piotr Haber (2):
plugins: rename xe910 to telit
udevng: unify telit and xe910

 Makefile.am      |   7 +-
 plugins/telit.c  | 550 +++++++++++++++++++++----------------------------------
 plugins/udevng.c |  44 +----
 plugins/xe910.c  | 546 ------------------------------------------------------
 4 files changed, 213 insertions(+), 934 deletions(-)
 delete mode 100644 plugins/xe910.c
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 plugins: rename xe910 to telit

Unify old telit and xe910 plugins. Dropping support for Bluetooth SAP.
Add support for UC864 family.

---
 Makefile.am     |   7 +-
 plugins/telit.c | 550 +++++++++++++++++++++-----------------------------------
 plugins/xe910.c | 546 -------------------------------------------------------
 3 files changed, 207 insertions(+), 896 deletions(-)
 delete mode 100644 plugins/xe910.c
Makefile.am +2 -5
index 560fc1cb..5968d8a8 100644
@@ -492,8 +492,8 @@ builtin_sources += plugins/sim900.c
 builtin_modules += connman
 builtin_sources += plugins/connman.c
 
-builtin_modules += xe910
-builtin_sources += plugins/xe910.c
+builtin_modules += telit
+builtin_sources += plugins/telit.c
 
 builtin_modules += quectel
 builtin_sources += plugins/quectel.c
@@ -503,9 +503,6 @@ builtin_sources += plugins/ublox.c
 
 if BLUETOOTH
 if BLUEZ4
-builtin_modules += telit
-builtin_sources += plugins/telit.c plugins/bluez4.h
-
 builtin_modules += sap
 builtin_sources += plugins/sap.c plugins/bluez4.h
 
plugins/telit.c +205 -345

713 lines not on this page · raw message

plugins/xe910.c deleted +0 -546

546 lines not on this page · raw message

Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/2 udevng: unify telit and xe910

In reply to Piotr Haber

Unified setup for Telit devices using
usbserial and cdc_acm drivers.

---
 plugins/udevng.c | 44 ++++++--------------------------------------
 1 file changed, 6 insertions(+), 38 deletions(-)
plugins/udevng.c +6 -38
index 098e0651..b98d9d43 100644
@@ -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"	},
 	{ }
 };
 
Signature · 1 line
2.11.0
#3 lore raw
In reply to Piotr Haber

Hi Piotr,

Quoted 8 lines · Piotr Haber

Expect of Bluetooth SAP related funcionality most of the code in telit and xe910 plugins is the same. Also unify udevng initialization code.

Piotr Haber (2):
plugins: rename xe910 to telit
udevng: unify telit and xe910

Quoted 7 lines
 Makefile.am      |   7 +-
 plugins/telit.c  | 550 +++++++++++++++++++++----------------------------------
 plugins/udevng.c |  44 +----
 plugins/xe910.c  | 546 ------------------------------------------------------
 4 files changed, 213 insertions(+), 934 deletions(-)
 delete mode 100644 plugins/xe910.c

Both applied, thanks.

Regards,
-Denis