All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC hwdb v1 00/28] USB interface labelling via udev
@ 2017-03-30 20:52 Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 01/28] zte: remove unused qcdm property Jonas Bonn
                   ` (27 more replies)
  0 siblings, 28 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

This series moves the labelling of USB modem interfaces to udev proper.
For most modems we are able to use the udev hwdb to do the labelling, and
for a few special cases we need to add udev rules.

Importantly, the OFONO_DRIVER and OFONO_LABEL properties are set on all
known interfaces.  This saves the ofono udev handler from having to figure
these out from parsing udev device properties and doing table lookups.

The reason for doing this is:
i)   ofono is currenly re-creating a lot of udev functionality when trying
     figure out the driver and label to apply to interfaces
ii)  the udev hwdb is an optimized path for setting device properties
iii) labelling interfaces via udev means it can be done for new devices
     without code changes (and thus without rebuilding ofono)
iv)  the udev implementation gets smaller and simpler; hopefully this
     can be made so generic that every new modem won't require changes
     to this module

This is an RFC because I'm not quite done with the conversion yet.  There
are still some sysattr details to work out for the mbm and telit modems;
and the qmi modems still need to be put into their final form.  A follow-up
series will be sent to this one but I wanted to get this sent out now for
some review.

Thanks,
Jonas

Jonas Bonn (28):
  zte: remove unused qcdm property
  zte: label interfaces via hwdb
  novatel: label interfaces via hwdb
  alcatel: label interfaces via hwdb
  huawei: label interfaces via hwdb
  simcom: label interfaces via hwdb
  ublox: label interfaces via hwdb
  gemalto: label interfaces via hwdb
  speedup: label interfaces via hwdb
  linktop: label interfaces via hwdb
  udevng (hso): remove impossible condition
  hso: label interfaces via udev rules
  isiusb: label interfaces via udev rules
  gobi: label interfaces via udev rules
  option: label interfaces via hwdb
  nokia: label interfaces via hwdb
  samsung: label interfaces via udev rules and hwdb
  sierra: label interfaces via udev rules
  telitqmi: label interfaces via udev rules
  telitqmi: drop unused device rule
  telit: label interfaces via hwdb
  icera: label interfaces via hwdb
  quectel: label interfaces via hwdb
  udevng: drop unused headers
  mbm: use standard atom names
  udevng: remove 'option' driver setup
  udevng: push device existence check into drivers
  udevng: consolidate setup functions for several USB devices

 drivers/mbmmodem/location-reporting.c |   2 +-
 plugins/alcatel.c                     |   9 +
 plugins/gobi.c                        |   9 +
 plugins/hso.c                         |   9 +
 plugins/huawei.c                      |   9 +
 plugins/icera.c                       |   9 +
 plugins/linktop.c                     |   9 +
 plugins/mbm.c                         |  15 +-
 plugins/nokia.c                       |   9 +
 plugins/novatel.c                     |   9 +
 plugins/ofono-speedup.rules           |  27 --
 plugins/ofono.hwdb                    | 307 +++++++++++++++
 plugins/ofono.rules                   |  51 +++
 plugins/quectel.c                     |   9 +
 plugins/speedup.c                     |   9 +
 plugins/telit.c                       |   9 +
 plugins/udevng.c                      | 687 +++++-----------------------------
 plugins/zte.c                         |   9 +
 18 files changed, 577 insertions(+), 620 deletions(-)
 delete mode 100644 plugins/ofono-speedup.rules
 create mode 100644 plugins/ofono.hwdb

-- 
2.9.3


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 01/28] zte: remove unused qcdm property
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 02/28] zte: label interfaces via hwdb Jonas Bonn
                   ` (26 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/udevng.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index d198763..d9153b3 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -765,7 +765,7 @@ static gboolean setup_simcom(struct modem_info *modem)
 
 static gboolean setup_zte(struct modem_info *modem)
 {
-	const char *aux = NULL, *mdm = NULL, *qcdm = NULL;
+	const char *aux = NULL, *mdm = NULL;
 	const char *modem_intf;
 	GSList *list;
 
@@ -793,9 +793,7 @@ static gboolean setup_zte(struct modem_info *modem)
 			if (aux != NULL)
 				break;
 		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "00") == 0)
-				qcdm = info->devnode;
-			else if (g_strcmp0(info->number, "01") == 0)
+			if (g_strcmp0(info->number, "01") == 0)
 				aux = info->devnode;
 			else if (g_strcmp0(info->number, modem_intf) == 0)
 				mdm = info->devnode;
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 02/28] zte: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 01/28] zte: remove unused qcdm property Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 03/28] novatel: " Jonas Bonn
                   ` (25 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 16 ++++++++++++++++
 plugins/udevng.c   | 25 +++----------------------
 2 files changed, 19 insertions(+), 22 deletions(-)
 create mode 100644 plugins/ofono.hwdb

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
new file mode 100644
index 0000000..75e553b
--- /dev/null
+++ b/plugins/ofono.hwdb
@@ -0,0 +1,16 @@
+# ZTE
+usb:v19D2*icFFiscFFipFF*
+ OFONO_DRIVER=zte
+
+usb:v19D2*icFFiscFFipFFin01
+ OFONO_LABEL=aux
+
+usb:v19D2*icFFiscFFipFFin03
+usb:v19D2p0016*icFFiscFFipFFin02
+usb:v19D2p0017*icFFiscFFipFFin02
+ OFONO_LABEL=modem
+
+usb:v19D2p0016*icFFiscFFipFFin03
+usb:v19D2p0017*icFFiscFFipFFin03
+ OFONO_LABEL=none
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index d9153b3..d95f71f 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -766,44 +766,26 @@ static gboolean setup_simcom(struct modem_info *modem)
 static gboolean setup_zte(struct modem_info *modem)
 {
 	const char *aux = NULL, *mdm = NULL;
-	const char *modem_intf;
 	GSList *list;
 
 	DBG("%s", modem->syspath);
 
-	if (g_strcmp0(modem->model, "0016") == 0 ||
-				g_strcmp0(modem->model, "0017") == 0 ||
-				g_strcmp0(modem->model, "0117") == 0)
-		modem_intf = "02";
-	else
-		modem_intf = "03";
-
 	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->label, "aux") == 0) {
+		if (g_strcmp0(info->label, "aux") == 0)
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "01") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, modem_intf) == 0)
-				mdm = info->devnode;
-		}
 	}
 
 	if (aux == NULL || mdm == NULL)
 		return FALSE;
 
-	DBG("aux=%s modem=%s qcdm=%s", aux, mdm, qcdm);
+	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
@@ -1457,7 +1439,6 @@ static struct {
 	{ "speedup",	"option",	"2020"		},
 	{ "alcatel",	"option",	"1bbb", "0017"	},
 	{ "novatel",	"option",	"1410"		},
-	{ "zte",	"option",	"19d2"		},
 	{ "simcom",	"option",	"05c6", "9000"	},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 03/28] novatel: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 01/28] zte: remove unused qcdm property Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 02/28] zte: label interfaces via hwdb Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 04/28] alcatel: " Jonas Bonn
                   ` (24 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 10 ++++++++++
 plugins/udevng.c   | 15 ++-------------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 75e553b..881497d 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -1,3 +1,13 @@
+# Novatel
+usb:v1410*icFFiscFFipFF*
+ OFONO_DRIVER=novatel
+
+usb:v1410*icFFiscFFipFFin00
+ OFONO_LABEL=aux
+
+usb:v1410*icFFiscFFipFFin01
+ OFONO_LABEL=modem
+
 # ZTE
 usb:v19D2*icFFiscFFipFF*
  OFONO_DRIVER=zte
diff --git a/plugins/udevng.c b/plugins/udevng.c
index d95f71f..3662370 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -558,20 +558,10 @@ static gboolean setup_novatel(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->label, "aux") == 0) {
+		if (g_strcmp0(info->label, "aux") == 0)
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "00") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "01") == 0)
-				mdm = info->devnode;
-		}
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1438,7 +1428,6 @@ static struct {
 	{ "speedup",	"option",	"1c9e"		},
 	{ "speedup",	"option",	"2020"		},
 	{ "alcatel",	"option",	"1bbb", "0017"	},
-	{ "novatel",	"option",	"1410"		},
 	{ "simcom",	"option",	"05c6", "9000"	},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 04/28] alcatel: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (2 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 03/28] novatel: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 05/28] huawei: " Jonas Bonn
                   ` (23 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb |  9 +++++++++
 plugins/udevng.c   | 10 ----------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 881497d..1097b8c 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -24,3 +24,12 @@ usb:v19D2p0016*icFFiscFFipFFin03
 usb:v19D2p0017*icFFiscFFipFFin03
  OFONO_LABEL=none
 
+# Alcatel
+usb:v1BBBp0017*icFFiscFFipFF*
+ OFONO_DRIVER=alcatel
+
+usb:v1BBBp0017*icFFiscFFipFFin03
+ OFONO_LABEL=aux
+
+usb:v1BBBp0017*icFFiscFFipFFin05
+ OFONO_LABEL=modem
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 3662370..ff14869 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -520,17 +520,8 @@ static gboolean setup_alcatel(struct modem_info *modem)
 
 		if (g_strcmp0(info->label, "aux") == 0) {
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
 		} else if (g_strcmp0(info->label, "modem") == 0) {
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "03") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "05") == 0)
-				mdm = info->devnode;
 		}
 	}
 
@@ -1427,7 +1418,6 @@ static struct {
 	{ "speedupcdma","option",	"1c9e", "9e00"	},
 	{ "speedup",	"option",	"1c9e"		},
 	{ "speedup",	"option",	"2020"		},
-	{ "alcatel",	"option",	"1bbb", "0017"	},
 	{ "simcom",	"option",	"05c6", "9000"	},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 05/28] huawei: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (3 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 04/28] alcatel: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 06/28] simcom: " Jonas Bonn
                   ` (22 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 plugins/udevng.c   | 41 +++++------------------------------------
 2 files changed, 56 insertions(+), 36 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 1097b8c..66cc0a1 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -1,3 +1,54 @@
+# Huawei
+usb:v201E*
+usb:v12D1*
+ OFONO_DRIVER=huawei
+
+usb:v201E*icFFisc01ip01*
+usb:v201E*icFFisc02ip01*
+usb:v201E*icFFisc03ip01*
+usb:v201E*icFFisc01ip31*
+usb:v201E*icFFiscFFipFFin00
+usb:v12D1*icFFisc01ip01*
+usb:v12D1*icFFisc02ip01*
+usb:v12D1*icFFisc03ip01*
+usb:v12D1*icFFisc01ip31*
+usb:v12D1*icFFiscFFipFFin00
+ OFONO_LABEL=modem
+
+usb:v201E*icFFisc01ip02*
+usb:v201E*icFFisc02ip02*
+usb:v201E*icFFisc02ip12*
+usb:v201E*icFFisc03ip12*
+usb:v201E*icFFisc01ip32*
+usb:v201E*icFFiscFFipFFin0[1234]
+usb:v12D1*icFFisc01ip02*
+usb:v12D1*icFFisc02ip02*
+usb:v12D1*icFFisc02ip12*
+usb:v12D1*icFFisc03ip12*
+usb:v12D1*icFFisc01ip32*
+usb:v12D1*icFFiscFFipFFin0[1234]
+ OFONO_LABEL=pcui
+
+usb:v201E*icFFisc01ip03*
+usb:v201E*icFFisc02ip03*
+usb:v201E*icFFisc01ip33*
+usb:v12D1*icFFisc01ip03*
+usb:v12D1*icFFisc02ip03*
+usb:v12D1*icFFisc01ip33*
+ OFONO_LABEL=diag
+
+usb:v201E*icFFisc01ip08*
+usb:v201E*icFFisc01ip38*
+usb:v12D1*icFFisc01ip08*
+usb:v12D1*icFFisc01ip38*
+ OFONO_LABEL=net
+
+usb:v201E*icFFisc01ip09*
+usb:v201E*icFFisc01ip39*
+usb:v12D1*icFFisc01ip09*
+usb:v12D1*icFFisc01ip39*
+ OFONO_LABEL=qmi
+
 # Novatel
 usb:v1410*icFFiscFFipFF*
  OFONO_DRIVER=novatel
diff --git a/plugins/udevng.c b/plugins/udevng.c
index ff14869..d8f077a 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -336,42 +336,16 @@ static gboolean setup_huawei(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->label, "modem") == 0 ||
-				g_strcmp0(info->interface, "255/1/1") == 0 ||
-				g_strcmp0(info->interface, "255/2/1") == 0 ||
-				g_strcmp0(info->interface, "255/3/1") == 0 ||
-				g_strcmp0(info->interface, "255/1/49") == 0) {
+		if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-		} else if (g_strcmp0(info->label, "pcui") == 0 ||
-				g_strcmp0(info->interface, "255/1/2") == 0 ||
-				g_strcmp0(info->interface, "255/2/2") == 0 ||
-				g_strcmp0(info->interface, "255/2/18") == 0 ||
-				g_strcmp0(info->interface, "255/3/18") == 0 ||
-				g_strcmp0(info->interface, "255/1/50") == 0) {
+		else if (g_strcmp0(info->label, "pcui") == 0)
 			pcui = info->devnode;
-		} else if (g_strcmp0(info->label, "diag") == 0 ||
-				g_strcmp0(info->interface, "255/1/3") == 0 ||
-				g_strcmp0(info->interface, "255/2/3") == 0 ||
-				g_strcmp0(info->interface, "255/1/51") == 0) {
+		else if (g_strcmp0(info->label, "diag") == 0)
 			diag = info->devnode;
-		} else if (g_strcmp0(info->interface, "255/1/8") == 0 ||
-				g_strcmp0(info->interface, "255/1/56") == 0) {
+		else if (g_strcmp0(info->label, "net") == 0)
 			net = info->devnode;
-		} else if (g_strcmp0(info->interface, "255/1/9") == 0 ||
-				g_strcmp0(info->interface, "255/1/57") == 0) {
+		else if (g_strcmp0(info->label, "qmi") == 0)
 			qmi = info->devnode;
-		} 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)
-				pcui = info->devnode;
-			else if (g_strcmp0(info->number, "02") == 0)
-				pcui = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				pcui = info->devnode;
-			else if (g_strcmp0(info->number, "04") == 0)
-				pcui = info->devnode;
-		}
 	}
 
 	if (qmi != NULL && net != NULL) {
@@ -1410,11 +1384,6 @@ static struct {
 	{ "sierra",	"sierra"			},
 	{ "sierra",	"sierra_net"			},
 	{ "option",	"option",	"0af0"		},
-	{ "huawei",	"option",	"201e"		},
-	{ "huawei",	"cdc_wdm",	"12d1"		},
-	{ "huawei",	"cdc_ether",	"12d1"		},
-	{ "huawei",	"qmi_wwan",	"12d1"		},
-	{ "huawei",	"option",	"12d1"		},
 	{ "speedupcdma","option",	"1c9e", "9e00"	},
 	{ "speedup",	"option",	"1c9e"		},
 	{ "speedup",	"option",	"2020"		},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 06/28] simcom: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (4 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 05/28] huawei: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 07/28] ublox: " Jonas Bonn
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 17 +++++++++++++++++
 plugins/udevng.c   | 23 ++++++-----------------
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 66cc0a1..fc2d738 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -84,3 +84,20 @@ usb:v1BBBp0017*icFFiscFFipFFin03
 
 usb:v1BBBp0017*icFFiscFFipFFin05
  OFONO_LABEL=modem
+
+# Simcom
+usb:v05C6p9000*icFFiscFFipFF*
+ OFONO_DRIVER=simcom
+
+usb:v05C6p9000*icFFiscFFipFFin00
+ OFONO_LABEL=diag
+
+usb:v05C6p9000*icFFiscFFipFFin01
+ OFONO_LABEL=gps
+
+usb:v05C6p9000*icFFiscFFipFFin02
+ OFONO_LABEL=aux
+
+usb:v05C6p9000*icFFiscFFipFFin03
+ OFONO_LABEL=modem
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index d8f077a..bdf36fa 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -686,24 +686,14 @@ static gboolean setup_simcom(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->label, "aux") == 0) {
+		if (g_strcmp0(info->label, "aux") == 0)
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "00") == 0)
-				diag = info->devnode;
-			else if (g_strcmp0(info->number, "01") == 0)
-				gps = info->devnode;
-			else if (g_strcmp0(info->number, "02") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				mdm = info->devnode;
-		}
+		else if (g_strcmp0(info->label, "gps") == 0)
+			gps = info->devnode;
+		else if (g_strcmp0(info->label, "diag") == 0)
+			diag = info->devnode;
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1387,7 +1377,6 @@ static struct {
 	{ "speedupcdma","option",	"1c9e", "9e00"	},
 	{ "speedup",	"option",	"1c9e"		},
 	{ "speedup",	"option",	"2020"		},
-	{ "simcom",	"option",	"05c6", "9000"	},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 07/28] ublox: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (5 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 06/28] simcom: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 08/28] gemalto: " Jonas Bonn
                   ` (20 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 16 ++++++++++++++++
 plugins/udevng.c   | 31 +++----------------------------
 2 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index fc2d738..c0c050f 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -101,3 +101,19 @@ usb:v05C6p9000*icFFiscFFipFFin02
 usb:v05C6p9000*icFFiscFFipFFin03
  OFONO_LABEL=modem
 
+# UBlox
+usb:v1546p1102*
+usb:v1546p1146*
+ OFONO_DRIVER=ublox
+
+usb:v1546*ic02isc02ip01in00
+ OFONO_LABEL=modem
+
+usb:v1546*ic02isc02ip01in02
+ OFONO_LABEL=aux
+
+usb:v1546*ic02isc06ip00*
+usb:v1546*ic0Aisc00ip00*
+usb:v1546*icE0isc01ip03*
+ OFONO_LABEL=net
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index bdf36fa..4869833 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -915,34 +915,12 @@ static gboolean setup_ublox(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 					info->number, info->label);
 
-		if (g_strcmp0(info->label, "aux") == 0) {
+		if (g_strcmp0(info->label, "aux") == 0)
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		/*
-		 * "2/2/1"
-		 *  - a common modem interface both for older models like LISA,
-		 *    and for newer models like TOBY.
-		 * For TOBY-L2, NetworkInterface can be detected for each
-		 * profile:
-		 *  - low-medium throughput profile : 2/6/0
-		 *  - fairly backward-compatible profile : 10/0/0
-		 *  - high throughput profile : 224/1/3
-		 */
-		} else if (g_strcmp0(info->interface, "2/2/1") == 0) {
-			if (g_strcmp0(info->number, "02") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "00") == 0)
-				mdm = info->devnode;
-		} else if (g_strcmp0(info->interface, "2/6/0") == 0 ||
-				g_strcmp0(info->interface, "10/0/0") == 0 ||
-				g_strcmp0(info->interface, "224/1/3") == 0) {
+		else if (g_strcmp0(info->label, "net") == 0)
 			net = info->devnode;
-		}
 	}
 
 	/* Abort only if both interfaces are NULL, as it's highly possible that
@@ -1387,9 +1365,6 @@ static struct {
 	{ "samsung",	"option",	"04e8", "6889"	},
 	{ "samsung",	"kalmia"			},
 	{ "quectel",	"option",	"05c6", "9090"	},
-	{ "ublox",	"cdc_acm",	"1546", "1102"	},
-	{ "ublox",	"rndis_host",	"1546", "1146"	},
-	{ "ublox",	"cdc_acm",	"1546", "1146"	},
 	{ "gemalto",	"option",	"1e2d",	"0053"	},
 	{ "gemalto",	"cdc_wdm",	"1e2d",	"0053"	},
 	{ "gemalto",	"qmi_wwan",	"1e2d",	"0053"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 08/28] gemalto: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (6 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 07/28] ublox: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 09/28] speedup: " Jonas Bonn
                   ` (19 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 16 ++++++++++++++++
 plugins/udevng.c   | 21 +++++++++------------
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index c0c050f..d35d422 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -117,3 +117,19 @@ usb:v1546*ic0Aisc00ip00*
 usb:v1546*icE0isc01ip03*
  OFONO_LABEL=net
 
+# Gemalto
+usb:v1E2Dp0053*icFFiscFFipFF*
+ OFONO_DRIVER=gemalto
+
+usb:v1E2Dp0053*icFFiscFFipFFin01
+ OFONO_LABEL=gps
+
+usb:v1E2Dp0053*icFFiscFFipFFin02
+ OFONO_LABEL=app
+
+usb:v1E2Dp0053*icFFiscFFipFFin03
+ OFONO_LABEL=modem
+
+usb:v1E2Dp0053*icFFiscFFipFF*
+ OFONO_LABEL=maybeqmi
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 4869833..0f54986 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -954,16 +954,16 @@ static gboolean setup_gemalto(struct modem_info* modem)
 		DBG("%s %s %s %s %s", info->devnode, info->interface,
 				info->number, info->label, info->subsystem);
 
-		if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "01") == 0)
-				gps = info->devnode;
-			else if (g_strcmp0(info->number, "02") == 0)
-				app = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				mdm = info->devnode;
-			else if (g_strcmp0(info->subsystem, "net") == 0)
+		if (!g_strcmp0(info->label, "gps"))
+			gps = info->devnode;
+		else if (!g_strcmp0(info->label, "app"))
+			app = info->devnode;
+		else if (!g_strcmp0(info->label, "modem"))
+			app = info->devnode;
+		else if (!g_strcmp0(info->label, "maybeqmi")) {
+			if (g_strcmp0(info->subsystem, "net"))
 				net = info->devnode;
-			else if (g_strcmp0(info->subsystem, "usbmisc") == 0)
+			else if (g_strcmp0(info->subsystem, "usbmisc"))
 				qmi = info->devnode;
 		}
 	}
@@ -1365,9 +1365,6 @@ static struct {
 	{ "samsung",	"option",	"04e8", "6889"	},
 	{ "samsung",	"kalmia"			},
 	{ "quectel",	"option",	"05c6", "9090"	},
-	{ "gemalto",	"option",	"1e2d",	"0053"	},
-	{ "gemalto",	"cdc_wdm",	"1e2d",	"0053"	},
-	{ "gemalto",	"qmi_wwan",	"1e2d",	"0053"	},
 	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
 	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
 	{ }
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 09/28] speedup: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (7 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 08/28] gemalto: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 10/28] linktop: " Jonas Bonn
                   ` (18 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono-speedup.rules | 27 ---------------------------
 plugins/ofono.hwdb          | 33 +++++++++++++++++++++++++++++++++
 plugins/udevng.c            |  3 ---
 3 files changed, 33 insertions(+), 30 deletions(-)
 delete mode 100644 plugins/ofono-speedup.rules

diff --git a/plugins/ofono-speedup.rules b/plugins/ofono-speedup.rules
deleted file mode 100644
index acf8857..0000000
--- a/plugins/ofono-speedup.rules
+++ /dev/null
@@ -1,27 +0,0 @@
-# do not edit this file, it will be overwritten on update
-
-ACTION!="add|change", GOTO="ofono_speedup_end"
-
-SUBSYSTEM!="tty", GOTO="ofono_speedup_end"
-KERNEL!="ttyUSB[0-9]*", GOTO="ofono_speedup_end"
-
-# SpeedUp 7300
-ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9e00", ENV{ID_USB_INTERFACE_NUM}=="00", ENV{OFONO_LABEL}="modem"
-ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9e00", ENV{ID_USB_INTERFACE_NUM}=="03", ENV{OFONO_LABEL}="aux"
-
-# SpeedUp
-ATTRS{idVendor}=="2020", ATTRS{idProduct}=="1005", ENV{ID_USB_INTERFACE_NUM}=="03", ENV{OFONO_LABEL}="modem"
-ATTRS{idVendor}=="2020", ATTRS{idProduct}=="1005", ENV{ID_USB_INTERFACE_NUM}=="01", ENV{OFONO_LABEL}="aux"
-
-ATTRS{idVendor}=="2020", ATTRS{idProduct}=="1008", ENV{ID_USB_INTERFACE_NUM}=="03", ENV{OFONO_LABEL}="modem"
-ATTRS{idVendor}=="2020", ATTRS{idProduct}=="1008", ENV{ID_USB_INTERFACE_NUM}=="01", ENV{OFONO_LABEL}="aux"
-
-# SpeedUp 9800
-ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9800", ENV{ID_USB_INTERFACE_NUM}=="01", ENV{OFONO_LABEL}="modem"
-ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9800", ENV{ID_USB_INTERFACE_NUM}=="02", ENV{OFONO_LABEL}="aux"
-
-# SpeedUp U3501
-ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{ID_USB_INTERFACE_NUM}=="03", ENV{OFONO_LABEL}="modem"
-ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{ID_USB_INTERFACE_NUM}=="01", ENV{OFONO_LABEL}="aux"
-
-LABEL="ofono_speedup_end"
diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index d35d422..d6e7e9d 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -133,3 +133,36 @@ usb:v1E2Dp0053*icFFiscFFipFFin03
 usb:v1E2Dp0053*icFFiscFFipFF*
  OFONO_LABEL=maybeqmi
 
+# SpeedUp
+usb:v1C9E*
+usb:v2020*
+ OFONO_DRIVER=speedup
+
+usb:v2020p100[58]*in01
+ OFONO_LABEL=aux
+
+usb:v2020p100[58]*in03
+ OFONO_LABEL=modem
+
+usb:v1C9Ep9800*in01
+ OFONO_LABEL=modem
+
+usb:v1C9Ep9800*in02
+ OFONO_LABEL=aux
+
+usb:v1C9Ep9605*in01
+ OFONO_LABEL=aux
+
+usb:v1C9Ep9605*in03
+ OFONO_LABEL=modem
+
+# SpeedUp 7300
+usb:v1C9Ep9E00*
+ OFONO_DRIVER=speedupcmda
+
+usb:v1C9Ep9E00*in00
+ OFONO_LABEL=modem
+
+usb:v1C9Ep9E00*in03
+ OFONO_LABEL=aux
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 0f54986..3be047d 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1352,9 +1352,6 @@ static struct {
 	{ "sierra",	"sierra"			},
 	{ "sierra",	"sierra_net"			},
 	{ "option",	"option",	"0af0"		},
-	{ "speedupcdma","option",	"1c9e", "9e00"	},
-	{ "speedup",	"option",	"1c9e"		},
-	{ "speedup",	"option",	"2020"		},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 10/28] linktop: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (8 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 09/28] speedup: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 11/28] udevng (hso): remove impossible condition Jonas Bonn
                   ` (17 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 10 ++++++++++
 plugins/udevng.c   | 11 ++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index d6e7e9d..5686163 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -166,3 +166,13 @@ usb:v1C9Ep9E00*in00
 usb:v1C9Ep9E00*in03
  OFONO_LABEL=aux
 
+# Linktop
+usb:v230D*ic02isc02ip01*
+ OFONO_DRIVER=linktop
+
+usb:v230D*ic02isc02ip01in01
+ OFONO_LABEL=aux
+
+usb:v230D*ic02isc02ip01in03
+ OFONO_LABEL=modem
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 3be047d..5b858f2 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -416,12 +416,10 @@ static gboolean setup_linktop(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->interface, "2/2/1") == 0) {
-			if (g_strcmp0(info->number, "01") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				mdm = info->devnode;
-		}
+		if (g_strcmp0(info->label, "aux") == 0)
+			aux = info->devnode;
+		else if (g_strcmp0(info->label, "modem") == 0)
+			mdm = info->devnode;
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1322,7 +1320,6 @@ static struct {
 	const char *pid;
 } vendor_list[] = {
 	{ "isiusb",	"cdc_phonet"			},
-	{ "linktop",	"cdc_acm",	"230d"		},
 	{ "icera",	"cdc_acm",	"19d2"		},
 	{ "icera",	"cdc_ether",	"19d2"		},
 	{ "icera",	"cdc_acm",	"04e8", "6872"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 11/28] udevng (hso): remove impossible condition
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (9 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 10/28] linktop: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-31 22:51   ` Denis Kenzior
  2017-03-30 20:52 ` [RFC hwdb v1 12/28] hso: label interfaces via udev rules Jonas Bonn
                   ` (16 subsequent siblings)
  27 siblings, 1 reply; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

The hso driver setup function tests for the devnode beginning with "hso"
in order to detect the network interface.  Since the devnode will always
begin with "/dev", this condition will never be fulfilled.

Given that the 'net' variable never gets set, we could just remove it.
However, leaving it there for now might be reminder to someone to figure
out how to set it in case it's actually needed.  That said, this test
has been in the code since 2011 and, presumably, nobody's noticied so
this modem might not be something that anybody actually uses anymore.
---
 plugins/udevng.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 5b858f2..f66a8b1 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -174,9 +174,6 @@ static gboolean setup_hso(struct modem_info *modem)
 			app = info->devnode;
 		else if (g_strcmp0(info->sysattr, "Modem") == 0)
 			mdm = info->devnode;
-		else if (info->sysattr == NULL &&
-				g_str_has_prefix(info->devnode, "hso") == TRUE)
-			net = info->devnode;
 	}
 
 	if (ctl == NULL || app == NULL)
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 12/28] hso: label interfaces via udev rules
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (10 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 11/28] udevng (hso): remove impossible condition Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 13/28] isiusb: " Jonas Bonn
                   ` (15 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.rules | 6 ++++++
 plugins/udevng.c    | 7 +++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 450f6c6..59c78d5 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -26,4 +26,10 @@ ATTRS{serial}=="1234567890ABCDEF", ENV{ID_SERIAL_SHORT}=""
 ATTRS{idVendor}=="0421", ATTRS{idProduct}=="023e", ENV{OFONO_DRIVER}="nokiacdma"
 ATTRS{idVendor}=="0421", ATTRS{idProduct}=="00b6", ENV{OFONO_DRIVER}="nokiacdma"
 
+
+DRIVER=="hso",ENV{OFONO_DRIVER}="hso"
+ENV{OFONO_DRIVER}=="hso",ATTR{hsotype}=="Control",ENV{OFONO_LABEL}="control"
+ENV{OFONO_DRIVER}=="hso",ATTR{hsotype}=="Application",ENV{OFONO_LABEL}="app"
+ENV{OFONO_DRIVER}=="hso",ATTR{hsotype}=="Modem",ENV{OFONO_LABEL}="modem"
+
 LABEL="ofono_end"
diff --git a/plugins/udevng.c b/plugins/udevng.c
index f66a8b1..2082a47 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -168,11 +168,11 @@ static gboolean setup_hso(struct modem_info *modem)
 		DBG("%s %s %s %s %s", info->devnode, info->interface,
 				info->number, info->label, info->sysattr);
 
-		if (g_strcmp0(info->sysattr, "Control") == 0)
+		if (g_strcmp0(info->label, "control") == 0)
 			ctl = info->devnode;
-		else if (g_strcmp0(info->sysattr, "Application") == 0)
+		else if (g_strcmp0(info->label, "app") == 0)
 			app = info->devnode;
-		else if (g_strcmp0(info->sysattr, "Modem") == 0)
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
 	}
 
@@ -1338,7 +1338,6 @@ static struct {
 	{ "mbm",	"cdc_acm",	"0930"		},
 	{ "mbm",	"cdc_ether",	"0930"		},
 	{ "mbm",	"cdc_ncm",	"0930"		},
-	{ "hso",	"hso"				},
 	{ "gobi",	"qmi_wwan"			},
 	{ "gobi",	"qcserial"			},
 	{ "sierra",	"qmi_wwan",	"1199"		},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 13/28] isiusb: label interfaces via udev rules
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (11 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 12/28] hso: label interfaces via udev rules Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 14/28] gobi: " Jonas Bonn
                   ` (14 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.rules |  4 ++++
 plugins/udevng.c    | 11 +++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 59c78d5..fe673cd 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -32,4 +32,8 @@ ENV{OFONO_DRIVER}=="hso",ATTR{hsotype}=="Control",ENV{OFONO_LABEL}="control"
 ENV{OFONO_DRIVER}=="hso",ATTR{hsotype}=="Application",ENV{OFONO_LABEL}="app"
 ENV{OFONO_DRIVER}=="hso",ATTR{hsotype}=="Modem",ENV{OFONO_LABEL}="modem"
 
+DRIVER=="cdc_phonet",ENV{OFONO_DRIVER}="isiusb"
+ENV{OFONO_DRIVER}=="isiusb",ATTR{type}=="820",ENV{OFONO_LABEL}="modem"
+ENV{OFONO_LABEL}=="modem",ENV{INTERFACE}=="2/254/0",ENV{OFONO_LABEL}="modem16"
+
 LABEL="ofono_end"
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 2082a47..508db04 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -88,11 +88,11 @@ static gboolean setup_isi(struct modem_info *modem)
 		DBG("%s %s %s %s %s", info->devnode, info->interface,
 				info->number, info->label, info->sysattr);
 
-		if (g_strcmp0(info->sysattr, "820") == 0) {
-			if (g_strcmp0(info->interface, "2/254/0") == 0)
-				addr = 16;
-
+		if (g_str_has_prefix(info->label, "modem")) {
 			node = info->devnode;
+
+			if (!g_strcmp0(info->label, "modem16"))
+				addr = 16;
 		}
 	}
 
@@ -983,7 +983,7 @@ static struct {
 	gboolean (*setup)(struct modem_info *modem);
 	const char *sysattr;
 } driver_list[] = {
-	{ "isiusb",	setup_isi,	"type"			},
+	{ "isiusb",	setup_isi,	},
 	{ "mbm",	setup_mbm,	"device/interface"	},
 	{ "hso",	setup_hso,	"hsotype"		},
 	{ "gobi",	setup_gobi	},
@@ -1316,7 +1316,6 @@ static struct {
 	const char *vid;
 	const char *pid;
 } vendor_list[] = {
-	{ "isiusb",	"cdc_phonet"			},
 	{ "icera",	"cdc_acm",	"19d2"		},
 	{ "icera",	"cdc_ether",	"19d2"		},
 	{ "icera",	"cdc_acm",	"04e8", "6872"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 14/28] gobi: label interfaces via udev rules
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (12 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 13/28] isiusb: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 15/28] option: label interfaces via hwdb Jonas Bonn
                   ` (13 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.rules | 24 ++++++++++++++++++++++++
 plugins/udevng.c    | 28 ++++++++++++++--------------
 2 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index fe673cd..4d70735 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -36,4 +36,28 @@ DRIVER=="cdc_phonet",ENV{OFONO_DRIVER}="isiusb"
 ENV{OFONO_DRIVER}=="isiusb",ATTR{type}=="820",ENV{OFONO_LABEL}="modem"
 ENV{OFONO_LABEL}=="modem",ENV{INTERFACE}=="2/254/0",ENV{OFONO_LABEL}="modem16"
 
+# If OFONO_DRIVER is set now, we are done.  If not, we make an additional
+# effort to find an appropriate driver and labelling.
+ENV{OFONO_DRIVER}="?*",GOTO="ofono_end"
+
+# If no product rule matched the interface then we still have an option:
+# the kernel also has device tables that it uses to attach drivers to
+# devices.  If the interface has an attached driver, then we can use
+# this information to attempt to label it.
+
+DRIVER=="qmi_wwan",ENV{OFONO_DRIVER}="gobi",ENV{OFONO_LABEL}="qmi"
+
+# Product rules are preferred for everything except "qmi" interfaces
+# in order to keep the below rules as minimal as possible.  The below
+# should be considered only as a fallback.
+
+DRIVER=="qcserial",ENV{OFONO_DRIVER}="gobi"
+ENV{OFONO_DRIVER}!="gobi",GOTO="gobi_end"
+ENV{INTERFACE}!="255/255/255",GOTO="gobi_end"
+ATTR{bInterfaceNumber}=="00",ENV{OFONO_LABEL}="net"
+ATTR{bInterfaceNumber}=="01",ENV{OFONO_LABEL}="diag"
+ATTR{bInterfaceNumber}=="02",ENV{OFONO_LABEL}="modem"
+ATTR{bInterfaceNumber}=="03",ENV{OFONO_LABEL}="gps"
+LABEL="gobi_end"
+
 LABEL="ofono_end"
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 508db04..c19dc1c 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -204,18 +204,19 @@ static gboolean setup_gobi(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (info->number == NULL)
-				qmi = info->devnode;
-			else if (g_strcmp0(info->number, "00") == 0)
-				net = info->devnode;
-			else if (g_strcmp0(info->number, "01") == 0)
-				diag = info->devnode;
-			else if (g_strcmp0(info->number, "02") == 0)
-				mdm = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				gps = info->devnode;
-		}
+		if (g_strcmp0(info->label, "qmi") == 0)
+			/* FIXME: subsystem detection to separate 'qmi' and
+			 * 'net' atoms???
+			 */
+			qmi = info->devnode;
+		else if (g_strcmp0(info->label, "net") == 0)
+			net = info->devnode;
+		else if (g_strcmp0(info->label, "modem") == 0)
+			mdm = info->devnode;
+		else if (g_strcmp0(info->label, "diag") == 0)
+			diag = info->devnode;
+		else if (g_strcmp0(info->label, "gps") == 0)
+			gps = info->devnode;
 	}
 
 	if (qmi == NULL || mdm == NULL || net == NULL)
@@ -223,6 +224,7 @@ static gboolean setup_gobi(struct modem_info *modem)
 
 	DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
 
+	/* FIXME: gps node not used... */
 	ofono_modem_set_string(modem->modem, "Device", qmi);
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
 	ofono_modem_set_string(modem->modem, "Diag", diag);
@@ -1337,8 +1339,6 @@ static struct {
 	{ "mbm",	"cdc_acm",	"0930"		},
 	{ "mbm",	"cdc_ether",	"0930"		},
 	{ "mbm",	"cdc_ncm",	"0930"		},
-	{ "gobi",	"qmi_wwan"			},
-	{ "gobi",	"qcserial"			},
 	{ "sierra",	"qmi_wwan",	"1199"		},
 	{ "sierra",	"qcserial",	"1199"		},
 	{ "sierra",	"sierra"			},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 15/28] option: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (13 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 14/28] gobi: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 16/28] nokia: " Jonas Bonn
                   ` (12 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 13 +++++++++++++
 plugins/udevng.c   | 16 ++++++----------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 5686163..655a897 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -1,3 +1,16 @@
+# Option
+usb:v0AF0*icFFiscFFipFF*
+ OFONO_DRIVER=option
+
+usb:v0AF0*icFFiscFFipFFin00
+ OFONO_LABEL=modem
+
+usb:v0AF0*icFFiscFFipFFin01
+ OFONO_LABEL=diag
+
+usb:v0AF0*icFFiscFFipFFin02
+ OFONO_LABEL=aux
+
 # Huawei
 usb:v201E*
 usb:v12D1*
diff --git a/plugins/udevng.c b/plugins/udevng.c
index c19dc1c..2e0320b 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -298,15 +298,12 @@ static gboolean setup_option(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		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)
-				aux = info->devnode;
-		}
-
+		if (g_strcmp0(info->label, "modem") == 0)
+			mdm = info->devnode;
+		else if (g_strcmp0(info->label, "aux") == 0)
+			aux = info->devnode;
+		else if (g_strcmp0(info->label, "diag") == 0)
+			diag = info->devnode;
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1343,7 +1340,6 @@ static struct {
 	{ "sierra",	"qcserial",	"1199"		},
 	{ "sierra",	"sierra"			},
 	{ "sierra",	"sierra_net"			},
-	{ "option",	"option",	"0af0"		},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 16/28] nokia: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (14 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 15/28] option: label interfaces via hwdb Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 17/28] samsung: label interfaces via udev rules and hwdb Jonas Bonn
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 13 +++++++++++++
 plugins/udevng.c   | 16 ++--------------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 655a897..70842c7 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -114,6 +114,19 @@ usb:v05C6p9000*icFFiscFFipFFin02
 usb:v05C6p9000*icFFiscFFipFFin03
  OFONO_LABEL=modem
 
+# Nokia
+usb:v0421p060E*ic0Aisc00ip00*
+usb:v0421p0623*ic0Aisc00ip00*
+ OFONO_DRIVER=nokia
+
+usb:v0421p060E*ic0Aisc00ip00in02
+usb:v0421p0623*ic0Aisc00ip00in02
+ OFONO_LABEL=modem
+
+usb:v0421p060E*ic0Aisc00ip00in04
+usb:v0421p0623*ic0Aisc00ip00in04
+ OFONO_LABEL=aux
+
 # UBlox
 usb:v1546p1102*
 usb:v1546p1146*
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 2e0320b..095d1fc 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -547,20 +547,10 @@ static gboolean setup_nokia(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->label, "aux") == 0) {
+		if (g_strcmp0(info->label, "aux") == 0)
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} else if (g_strcmp0(info->interface, "10/0/0") == 0) {
-			if (g_strcmp0(info->number, "02") == 0)
-				mdm = info->devnode;
-			else if (g_strcmp0(info->number, "04") == 0)
-				aux = info->devnode;
-		}
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1345,8 +1335,6 @@ static struct {
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
 	{ "telitqmi",	"qmi_wwan",	"1bc7", "1201"	},
 	{ "telitqmi",	"option",	"1bc7", "1201"	},
-	{ "nokia",	"option",	"0421", "060e"	},
-	{ "nokia",	"option",	"0421", "0623"	},
 	{ "samsung",	"option",	"04e8", "6889"	},
 	{ "samsung",	"kalmia"			},
 	{ "quectel",	"option",	"05c6", "9090"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 17/28] samsung: label interfaces via udev rules and hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (15 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 16/28] nokia: " Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:52 ` [RFC hwdb v1 18/28] sierra: label interfaces via udev rules Jonas Bonn
                   ` (10 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb  | 11 +++++++++++
 plugins/ofono.rules |  6 ++++++
 plugins/udevng.c    |  6 ++----
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 70842c7..02db1cd 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -127,6 +127,17 @@ usb:v0421p060E*ic0Aisc00ip00in04
 usb:v0421p0623*ic0Aisc00ip00in04
  OFONO_LABEL=aux
 
+# Samsung
+usb:v04E8p6889*ic0Aisc00ip00*
+usb:v04E8p6889*icFFisc00ip00*
+ OFONO_DRIVER=samsung
+
+usb:v04E8*ic0Aisc00ip00*
+ OFONO_LABEL=control
+
+usb:v04E8*icFFisc00ip00*
+ OFONO_LABEL=net
+
 # UBlox
 usb:v1546p1102*
 usb:v1546p1146*
diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 4d70735..f783aab 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -60,4 +60,10 @@ ATTR{bInterfaceNumber}=="02",ENV{OFONO_LABEL}="modem"
 ATTR{bInterfaceNumber}=="03",ENV{OFONO_LABEL}="gps"
 LABEL="gobi_end"
 
+DRIVER=="kalmia",ENV{OFONO_DRIVER}="samsung"
+ENV{OFONO_DRIVER}!="samsung",GOTO="samsung_end"
+ENV{INTERFACE}=="10/0/0",ENV{OFONO_LABEL}="control"
+ENV{INTERFACE}=="255/0/0",ENV{OFONO_LABEL}="net"
+LABEL="samsung_end"
+
 LABEL="ofono_end"
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 095d1fc..b5c5c86 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -735,9 +735,9 @@ static gboolean setup_samsung(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		if (g_strcmp0(info->interface, "10/0/0") == 0)
+		if (g_strcmp0(info->label, "control") == 0)
 			control = info->devnode;
-		else if (g_strcmp0(info->interface, "255/0/0") == 0)
+		else if (g_strcmp0(info->label, "net") == 0)
 			network = info->devnode;
 	}
 
@@ -1335,8 +1335,6 @@ static struct {
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
 	{ "telitqmi",	"qmi_wwan",	"1bc7", "1201"	},
 	{ "telitqmi",	"option",	"1bc7", "1201"	},
-	{ "samsung",	"option",	"04e8", "6889"	},
-	{ "samsung",	"kalmia"			},
 	{ "quectel",	"option",	"05c6", "9090"	},
 	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
 	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 18/28] sierra: label interfaces via udev rules
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (16 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 17/28] samsung: label interfaces via udev rules and hwdb Jonas Bonn
@ 2017-03-30 20:52 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 19/28] telitqmi: " Jonas Bonn
                   ` (9 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:52 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.rules | 11 +++++++++++
 plugins/udevng.c    | 32 ++++++++++++--------------------
 2 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index f783aab..34ff9ce 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -51,6 +51,17 @@ DRIVER=="qmi_wwan",ENV{OFONO_DRIVER}="gobi",ENV{OFONO_LABEL}="qmi"
 # in order to keep the below rules as minimal as possible.  The below
 # should be considered only as a fallback.
 
+DRIVER=="qcserial",ATTRS{idVendor}="1199",ENV{OFONO_DRIVER}="sierra"
+DRIVER=="sierra",ENV{OFONO_DRIVER}="sierra"
+DRIVER=="sierra_net",ENV{OFONO_DRIVER}="sierra
+ENV{OFONO_DRIVER}!="sierra",GOTO="sierra_end"
+ENV{INTERFACE}!="255/255/255",GOTO="sierra_end"
+ATTR{bInterfaceNumber}=="01",ENV{OFONO_LABEL}="diag"
+ATTR{bInterfaceNumber}=="03",ENV{OFONO_LABEL}="modem"
+ATTR{bInterfaceNumber}=="04",ENV{OFONO_LABEL}="app"
+ATTR{bInterfaceNumber}=="07",ENV{OFONO_LABEL}="net"
+LABEL="sierra_end"
+
 DRIVER=="qcserial",ENV{OFONO_DRIVER}="gobi"
 ENV{OFONO_DRIVER}!="gobi",GOTO="gobi_end"
 ENV{INTERFACE}!="255/255/255",GOTO="gobi_end"
diff --git a/plugins/udevng.c b/plugins/udevng.c
index b5c5c86..c4eb9fd 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -246,23 +246,19 @@ static gboolean setup_sierra(struct modem_info *modem)
 		DBG("%s %s %s %s %s", info->devnode, info->interface,
 				info->number, info->label, info->subsystem);
 
-		if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "01") == 0)
-				diag = info->devnode;
-			if (g_strcmp0(info->number, "03") == 0)
-				mdm = info->devnode;
-			else if (g_strcmp0(info->number, "04") == 0)
-				app = info->devnode;
-			else if (g_strcmp0(info->number, "07") == 0)
+		if (g_strcmp0(info->label, "qmi") == 0) {
+			if (g_strcmp0(info->subsystem, "net") == 0)
 				net = info->devnode;
-			else if (g_strcmp0(info->number, "0a") == 0) {
-				if (g_strcmp0(info->subsystem, "net") == 0)
-					net = info->devnode;
-				else if (g_strcmp0(info->subsystem,
-								"usbmisc") == 0)
-					qmi = info->devnode;
-			}
-		}
+			else if (g_strcmp0(info->subsystem, "usbmisc") == 0)
+				qmi = info->devnode;
+		} else if (g_strcmp0(info->label, "net") == 0)
+			net = info->devnode;
+		else if (g_strcmp0(info->label, "modem") == 0)
+			mdm = info->devnode;
+		else if (g_strcmp0(info->label, "diag") == 0)
+			diag = info->devnode;
+		else if (g_strcmp0(info->label, "app") == 0)
+			app = info->devnode;
 	}
 
 	if (qmi != NULL && net != NULL) {
@@ -1326,10 +1322,6 @@ static struct {
 	{ "mbm",	"cdc_acm",	"0930"		},
 	{ "mbm",	"cdc_ether",	"0930"		},
 	{ "mbm",	"cdc_ncm",	"0930"		},
-	{ "sierra",	"qmi_wwan",	"1199"		},
-	{ "sierra",	"qcserial",	"1199"		},
-	{ "sierra",	"sierra"			},
-	{ "sierra",	"sierra_net"			},
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 19/28] telitqmi: label interfaces via udev rules
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (17 preceding siblings ...)
  2017-03-30 20:52 ` [RFC hwdb v1 18/28] sierra: label interfaces via udev rules Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 20/28] telitqmi: drop unused device rule Jonas Bonn
                   ` (8 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

---
 plugins/udevng.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index c4eb9fd..3aef447 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -629,8 +629,7 @@ static gboolean setup_telitqmi(struct modem_info *modem)
 		DBG("%s %s %s %s %s", info->devnode, info->interface,
 				info->number, info->label, info->subsystem);
 
-		if (g_strcmp0(info->interface, "255/255/255") == 0 &&
-				g_strcmp0(info->number, "02") == 0) {
+		if (g_strcmp0(info->label, "qmi") == 0) {
 			if (g_strcmp0(info->subsystem, "net") == 0)
 				net = info->devnode;
 			else if (g_strcmp0(info->subsystem, "usbmisc") == 0)
@@ -1325,7 +1324,6 @@ static struct {
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
-	{ "telitqmi",	"qmi_wwan",	"1bc7", "1201"	},
 	{ "telitqmi",	"option",	"1bc7", "1201"	},
 	{ "quectel",	"option",	"05c6", "9090"	},
 	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 20/28] telitqmi: drop unused device rule
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (18 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 19/28] telitqmi: " Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-31  8:35   ` Lukasz Nowak
  2017-03-30 20:53 ` [RFC hwdb v1 21/28] telit: label interfaces via hwdb Jonas Bonn
                   ` (7 subsequent siblings)
  27 siblings, 1 reply; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

The rule might match for some device but setup_telitqmi does not attempt
to do anything for interfaces that aren't driven by the qmi_wwan driver
so it's pointless.
---
 plugins/udevng.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 3aef447..d02cc6e 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1324,7 +1324,6 @@ static struct {
 	{ "telit",	"usbserial",	"1bc7"		},
 	{ "telit",	"option",	"1bc7"		},
 	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
-	{ "telitqmi",	"option",	"1bc7", "1201"	},
 	{ "quectel",	"option",	"05c6", "9090"	},
 	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
 	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 21/28] telit: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (19 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 20/28] telitqmi: drop unused device rule Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 22/28] icera: " Jonas Bonn
                   ` (6 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 plugins/udevng.c   | 36 +++++++-----------------------------
 2 files changed, 53 insertions(+), 29 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 02db1cd..d3a19aa 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -213,3 +213,49 @@ usb:v230D*ic02isc02ip01in01
 usb:v230D*ic02isc02ip01in03
  OFONO_LABEL=modem
 
+# Telit
+usb:v1BC7*icFFiscFFipFF*
+usb:v1BC7p0021*icFFiscFFipFF*
+usb:v1BC7p0036*icFFiscFFipFF*
+ OFONO_DRIVER=telit
+
+usb:v1BC7*icFFiscFFipFFin00
+usb:v1BC7p0021*icFFiscFFipFFin00
+usb:v1BC7p0036*icFFiscFFipFFin00
+ OFONO_LABEL=modem
+
+usb:v1BC7*icFFiscFFipFFin02
+usb:v1BC7p0021*icFFiscFFipFFin02
+usb:v1BC7p0036*icFFiscFFipFFin02
+ OFONO_LABEL=gps
+
+usb:v1BC7*icFFiscFFipFFin03
+usb:v1BC7p0021*icFFiscFFipFFin03
+usb:v1BC7p0036*icFFiscFFipFFin03
+ OFONO_LABEL=aux
+
+usb:v1BC7*ic02isc02ip01in00
+usb:v1BC7p0021*ic02isc02ip01in00
+usb:v1BC7p0036*ic02isc02ip01in00
+ OFONO_LABEL=modem
+
+usb:v1BC7*ic02isc02ip01in06
+usb:v1BC7p0021*ic02isc02ip01in06
+usb:v1BC7p0036*ic02isc02ip01in06
+ OFONO_LABEL=aux
+
+usb:v1BC7*ic02isc02ip01in0a
+usb:v1BC7p0021*ic02isc02ip01in0a
+usb:v1BC7p0036*ic02isc02ip01in0a
+ OFONO_LABEL=gps
+
+
+# The Telit catch-all vendor rule above prevents us from using the generic
+# qmi udev rule for QMI devices.  Replace the above catch-all rule and
+# the following can be dropped
+usb:v1BC7p1201*icFFiscFFipFF*
+ OFONO_DRIVER=telitqmi
+
+usb:v1BC7p1201*icFFiscFFipFFin02
+ OFONO_LABEL=qmi
+
diff --git a/plugins/udevng.c b/plugins/udevng.c
index d02cc6e..45b64bd 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -573,32 +573,15 @@ 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) {
+		if (g_strcmp0(info->label, "aux") == 0)
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
+		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} 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, "02") == 0)
-				gps = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				aux = info->devnode;
-		} 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)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "0a") == 0)
-				gps = info->devnode;
-		} else if (info->sysattr && (g_str_has_suffix(info->sysattr,
-						"CDC NCM") == TRUE)) {
-			net = info->devnode;
-		}
+		else if (g_strcmp0(info->label, "gps") == 0)
+			gps = info->devnode;
+		else if (info->sysattr)
+			if (g_str_has_suffix(info->sysattr, "CDC NCM"))
+				net = info->devnode;
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1321,12 +1304,7 @@ static struct {
 	{ "mbm",	"cdc_acm",	"0930"		},
 	{ "mbm",	"cdc_ether",	"0930"		},
 	{ "mbm",	"cdc_ncm",	"0930"		},
-	{ "telit",	"usbserial",	"1bc7"		},
-	{ "telit",	"option",	"1bc7"		},
-	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
 	{ "quectel",	"option",	"05c6", "9090"	},
-	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
-	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
 	{ }
 };
 
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 22/28] icera: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (20 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 21/28] telit: label interfaces via hwdb Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 23/28] quectel: " Jonas Bonn
                   ` (5 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 36 ++++++++++++++++++++++++++++++++++++
 plugins/udevng.c   | 29 ++++++-----------------------
 2 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index d3a19aa..145e985 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -72,6 +72,42 @@ usb:v1410*icFFiscFFipFFin00
 usb:v1410*icFFiscFFipFFin01
  OFONO_LABEL=modem
 
+# Icera
+usb:v19D2*ic02isc02ip01*
+usb:v19D2*ic02isc06ip00*
+usb:v04E8p6872*ic02isc02ip01*
+usb:v04E8p6872*ic02isc06ip00*
+usb:v04E8p6833*ic02isc02ip01*
+usb:v04E8p6833*ic02isc06ip00*
+ OFONO_DRIVER=icera
+
+usb:v19D2*ic02isc02ip01in00
+usb:v04E8p6872*ic02isc02ip01in00
+usb:v04E8p6833*ic02isc02ip01in00
+usb:v19D2*ic02isc02ip01in01
+usb:v04E8p6872*ic02isc02ip01in01
+usb:v04E8p6833*ic02isc02ip01in01
+ OFONO_LABEL=aux
+
+usb:v19D2*ic02isc02ip01in02
+usb:v04E8p6872*ic02isc02ip01in02
+usb:v04E8p6833*ic02isc02ip01in02
+usb:v19D2*ic02isc02ip01in03
+usb:v04E8p6872*ic02isc02ip01in03
+usb:v04E8p6833*ic02isc02ip01in03
+ OFONO_LABEL=modem
+
+usb:v19D2*ic02isc06ip00in05
+usb:v04E8p6872*ic02isc06ip00in05
+usb:v04E8p6833*ic02isc06ip00in05
+usb:v19D2*ic02isc06ip00in06
+usb:v04E8p6872*ic02isc06ip00in06
+usb:v04E8p6833*ic02isc06ip00in06
+usb:v19D2*ic02isc06ip00in07
+usb:v04E8p6872*ic02isc06ip00in07
+usb:v04E8p6833*ic02isc06ip00in07
+ OFONO_LABEL=net
+
 # ZTE
 usb:v19D2*icFFiscFFipFF*
  OFONO_DRIVER=zte
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 45b64bd..16c9328 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -438,23 +438,12 @@ static gboolean setup_icera(struct modem_info *modem)
 		DBG("%s %s %s %s", info->devnode, info->interface,
 						info->number, info->label);
 
-		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, "01") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "02") == 0)
-				mdm = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				mdm = info->devnode;
-		} else if (g_strcmp0(info->interface, "2/6/0") == 0) {
-			if (g_strcmp0(info->number, "05") == 0)
-				net = info->devnode;
-			else if (g_strcmp0(info->number, "06") == 0)
-				net = info->devnode;
-			else if (g_strcmp0(info->number, "07") == 0)
-				net = info->devnode;
-		}
+		if (g_strcmp0(info->label, "aux") == 0)
+			aux = info->devnode;
+		else if (g_strcmp0(info->label, "modem") == 0)
+			mdm = info->devnode;
+		else if (g_strcmp0(info->label, "net") == 0)
+			mdm = info->devnode;
 	}
 
 	if (aux == NULL || mdm == NULL)
@@ -1283,12 +1272,6 @@ static struct {
 	const char *vid;
 	const char *pid;
 } vendor_list[] = {
-	{ "icera",	"cdc_acm",	"19d2"		},
-	{ "icera",	"cdc_ether",	"19d2"		},
-	{ "icera",	"cdc_acm",	"04e8", "6872"	},
-	{ "icera",	"cdc_ether",	"04e8", "6872"	},
-	{ "icera",	"cdc_acm",	"0421", "0633"	},
-	{ "icera",	"cdc_ether",	"0421", "0633"	},
 	{ "mbm",	"cdc_acm",	"0bdb"		},
 	{ "mbm",	"cdc_ether",	"0bdb"		},
 	{ "mbm",	"cdc_ncm",	"0bdb"		},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 23/28] quectel: label interfaces via hwdb
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (21 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 22/28] icera: " Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 24/28] udevng: drop unused headers Jonas Bonn
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

---
 plugins/ofono.hwdb | 10 ++++++++++
 plugins/udevng.c   | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/plugins/ofono.hwdb b/plugins/ofono.hwdb
index 145e985..a2ca4b8 100644
--- a/plugins/ofono.hwdb
+++ b/plugins/ofono.hwdb
@@ -249,6 +249,16 @@ usb:v230D*ic02isc02ip01in01
 usb:v230D*ic02isc02ip01in03
  OFONO_LABEL=modem
 
+# Quectel
+usb:v05C6p9090*icFFiscFFipFF*
+ OFONO_DRIVER=quectel
+
+usb:v05C6p9090*icFFiscFFipFFin02
+ OFONO_LABEL=aux
+
+usb:v05C6p9090*icFFiscFFipFFin03
+ OFONO_LABEL=modem
+
 # Telit
 usb:v1BC7*icFFiscFFipFF*
 usb:v1BC7p0021*icFFiscFFipFF*
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 16c9328..1fe7d34 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -734,17 +734,8 @@ static gboolean setup_quectel(struct modem_info *modem)
 
 		if (g_strcmp0(info->label, "aux") == 0) {
 			aux = info->devnode;
-			if (mdm != NULL)
-				break;
 		} else if (g_strcmp0(info->label, "modem") == 0) {
 			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
-			if (g_strcmp0(info->number, "02") == 0)
-				aux = info->devnode;
-			else if (g_strcmp0(info->number, "03") == 0)
-				mdm = info->devnode;
 		}
 	}
 
@@ -1287,7 +1278,6 @@ static struct {
 	{ "mbm",	"cdc_acm",	"0930"		},
 	{ "mbm",	"cdc_ether",	"0930"		},
 	{ "mbm",	"cdc_ncm",	"0930"		},
-	{ "quectel",	"option",	"05c6", "9090"	},
 	{ }
 };
 
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 24/28] udevng: drop unused headers
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (22 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 23/28] quectel: " Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 25/28] mbm: use standard atom names Jonas Bonn
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

---
 plugins/udevng.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 1fe7d34..2d9ddbe 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -24,9 +24,7 @@
 #endif
 
 #include <errno.h>
-#include <ctype.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include <libudev.h>
 
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 25/28] mbm: use standard atom names
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (23 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 24/28] udevng: drop unused headers Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-31 22:54   ` Denis Kenzior
  2017-03-30 20:53 ` [RFC hwdb v1 26/28] udevng: remove 'option' driver setup Jonas Bonn
                   ` (2 subsequent siblings)
  27 siblings, 1 reply; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

---
 drivers/mbmmodem/location-reporting.c |  2 +-
 plugins/mbm.c                         |  6 +++---
 plugins/udevng.c                      | 12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/mbmmodem/location-reporting.c b/drivers/mbmmodem/location-reporting.c
index 7c50ac2..4a2196a 100644
--- a/drivers/mbmmodem/location-reporting.c
+++ b/drivers/mbmmodem/location-reporting.c
@@ -105,7 +105,7 @@ static int enable_data_stream(struct ofono_location_reporting *lr)
 	int fd;
 
 	modem = ofono_location_reporting_get_modem(lr);
-	gps_dev = ofono_modem_get_string(modem, "GPSDevice");
+	gps_dev = ofono_modem_get_string(modem, "GPS");
 
 	options = g_hash_table_new(g_str_hash, g_str_equal);
 	if (options == NULL)
diff --git a/plugins/mbm.c b/plugins/mbm.c
index 7d6f92a..62258af 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -314,8 +314,8 @@ static int mbm_enable(struct ofono_modem *modem)
 
 	DBG("%p", modem);
 
-	modem_dev = ofono_modem_get_string(modem, "ModemDevice");
-	data_dev = ofono_modem_get_string(modem, "DataDevice");
+	modem_dev = ofono_modem_get_string(modem, "Modem");
+	data_dev = ofono_modem_get_string(modem, "Aux");
 
 	DBG("%s, %s", modem_dev, data_dev);
 
@@ -449,7 +449,7 @@ static void mbm_post_online(struct ofono_modem *modem)
 
 	DBG("%p", modem);
 
-	gps_dev = ofono_modem_get_string(modem, "GPSDevice");
+	gps_dev = ofono_modem_get_string(modem, "GPS");
 	if (gps_dev)
 		data->lr = ofono_location_reporting_create(modem, 0,
 					"mbmmodem", data->modem_port);
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 2d9ddbe..36c36b7 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -107,7 +107,7 @@ static gboolean setup_isi(struct modem_info *modem)
 
 static gboolean setup_mbm(struct modem_info *modem)
 {
-	const char *mdm = NULL, *app = NULL, *network = NULL, *gps = NULL;
+	const char *mdm = NULL, *aux = NULL, *network = NULL, *gps = NULL;
 	GSList *list;
 
 	DBG("%s", modem->syspath);
@@ -124,7 +124,7 @@ static gboolean setup_mbm(struct modem_info *modem)
 			if (mdm == NULL)
 				mdm = info->devnode;
 			else
-				app = info->devnode;
+				aux = info->devnode;
 		} else if (g_str_has_suffix(info->sysattr,
 						"GPS Port") == TRUE ||
 				g_str_has_suffix(info->sysattr,
@@ -143,11 +143,11 @@ static gboolean setup_mbm(struct modem_info *modem)
 	if (mdm == NULL || app == NULL)
 		return FALSE;
 
-	DBG("modem=%s data=%s network=%s gps=%s", mdm, app, network, gps);
+	DBG("modem=%s data=%s network=%s gps=%s", mdm, aux, network, gps);
 
-	ofono_modem_set_string(modem->modem, "ModemDevice", mdm);
-	ofono_modem_set_string(modem->modem, "DataDevice", app);
-	ofono_modem_set_string(modem->modem, "GPSDevice", gps);
+	ofono_modem_set_string(modem->modem, "Modem", mdm);
+	ofono_modem_set_string(modem->modem, "Aux", aux);
+	ofono_modem_set_string(modem->modem, "GPS", gps);
 	ofono_modem_set_string(modem->modem, "NetworkInterface", network);
 
 	return TRUE;
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 26/28] udevng: remove 'option' driver setup
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (24 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 25/28] mbm: use standard atom names Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-31 23:18   ` Denis Kenzior
  2017-03-30 20:53 ` [RFC hwdb v1 27/28] udevng: push device existence check into drivers Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 28/28] udevng: consolidate setup functions for several USB devices Jonas Bonn
  27 siblings, 1 reply; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

No driver named 'option' exists so this device can never be instantiated.
---
 plugins/udevng.c | 34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 36c36b7..4f94546 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -279,39 +279,6 @@ done:
 	return TRUE;
 }
 
-static gboolean setup_option(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = NULL, *diag = 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->label, "modem") == 0)
-			mdm = info->devnode;
-		else if (g_strcmp0(info->label, "aux") == 0)
-			aux = info->devnode;
-		else if (g_strcmp0(info->label, "diag") == 0)
-			diag = info->devnode;
-	}
-
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
-	DBG("aux=%s modem=%s diag=%s", aux, mdm, diag);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-	ofono_modem_set_string(modem->modem, "Diag", diag);
-
-	return TRUE;
-}
-
 static gboolean setup_huawei(struct modem_info *modem)
 {
 	const char *qmi = NULL, *mdm = NULL, *net = NULL;
@@ -933,7 +900,6 @@ static struct {
 	{ "hso",	setup_hso,	"hsotype"		},
 	{ "gobi",	setup_gobi	},
 	{ "sierra",	setup_sierra	},
-	{ "option",	setup_option	},
 	{ "huawei",	setup_huawei	},
 	{ "speedupcdma",setup_speedup	},
 	{ "speedup",	setup_speedup	},
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 27/28] udevng: push device existence check into drivers
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (25 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 26/28] udevng: remove 'option' driver setup Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  2017-03-30 20:53 ` [RFC hwdb v1 28/28] udevng: consolidate setup functions for several USB devices Jonas Bonn
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

The drivers themselves know best which "channels" are sufficient for
operation and which channels are optional.  This patch moves the
check for sufficient channels from the udevng setup_* functions into
the drivers' probe functions.
---
 plugins/alcatel.c |  9 +++++++++
 plugins/gobi.c    |  9 +++++++++
 plugins/hso.c     |  9 +++++++++
 plugins/huawei.c  |  9 +++++++++
 plugins/icera.c   |  9 +++++++++
 plugins/linktop.c |  9 +++++++++
 plugins/mbm.c     |  9 +++++++++
 plugins/nokia.c   |  9 +++++++++
 plugins/novatel.c |  9 +++++++++
 plugins/quectel.c |  9 +++++++++
 plugins/speedup.c |  9 +++++++++
 plugins/telit.c   |  9 +++++++++
 plugins/udevng.c  | 39 ---------------------------------------
 plugins/zte.c     |  9 +++++++++
 14 files changed, 117 insertions(+), 39 deletions(-)

diff --git a/plugins/alcatel.c b/plugins/alcatel.c
index fb1d1ae..c04ba3c 100644
--- a/plugins/alcatel.c
+++ b/plugins/alcatel.c
@@ -52,9 +52,18 @@ struct alcatel_data {
 static int alcatel_probe(struct ofono_modem *modem)
 {
 	struct alcatel_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct alcatel_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/gobi.c b/plugins/gobi.c
index df35f94..f0de918 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -81,9 +81,18 @@ static void gobi_debug(const char *str, void *user_data)
 static int gobi_probe(struct ofono_modem *modem)
 {
 	struct gobi_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Device");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "NetworkInterface");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct gobi_data, 1);
 	if (!data)
 		return -ENOMEM;
diff --git a/plugins/hso.c b/plugins/hso.c
index 249bb2c..3a90dd9 100644
--- a/plugins/hso.c
+++ b/plugins/hso.c
@@ -68,9 +68,18 @@ struct hso_data {
 static int hso_probe(struct ofono_modem *modem)
 {
 	struct hso_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Control");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Application");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct hso_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/huawei.c b/plugins/huawei.c
index f02315d..9e71b6b 100644
--- a/plugins/huawei.c
+++ b/plugins/huawei.c
@@ -96,9 +96,18 @@ struct huawei_data {
 static int huawei_probe(struct ofono_modem *modem)
 {
 	struct huawei_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Pcui");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct huawei_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/icera.c b/plugins/icera.c
index 7df5ffd..eb33230 100644
--- a/plugins/icera.c
+++ b/plugins/icera.c
@@ -60,9 +60,18 @@ struct icera_data {
 static int icera_probe(struct ofono_modem *modem)
 {
 	struct icera_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct icera_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/linktop.c b/plugins/linktop.c
index bb0d7b8..68e91af 100644
--- a/plugins/linktop.c
+++ b/plugins/linktop.c
@@ -58,9 +58,18 @@ struct linktop_data {
 static int linktop_probe(struct ofono_modem *modem)
 {
 	struct linktop_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct linktop_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/mbm.c b/plugins/mbm.c
index 62258af..0876e9c 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -74,9 +74,18 @@ struct mbm_data {
 static int mbm_probe(struct ofono_modem *modem)
 {
 	struct mbm_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct mbm_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/nokia.c b/plugins/nokia.c
index ef598fa..18014a0 100644
--- a/plugins/nokia.c
+++ b/plugins/nokia.c
@@ -55,9 +55,18 @@ struct nokia_data {
 static int nokia_probe(struct ofono_modem *modem)
 {
 	struct nokia_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct nokia_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/novatel.c b/plugins/novatel.c
index a64364d..e90d320 100644
--- a/plugins/novatel.c
+++ b/plugins/novatel.c
@@ -60,9 +60,18 @@ struct novatel_data {
 static int novatel_probe(struct ofono_modem *modem)
 {
 	struct novatel_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct novatel_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/quectel.c b/plugins/quectel.c
index ba1aa42..a116edd 100644
--- a/plugins/quectel.c
+++ b/plugins/quectel.c
@@ -64,9 +64,18 @@ static void quectel_debug(const char *str, void *user_data)
 static int quectel_probe(struct ofono_modem *modem)
 {
 	struct quectel_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct quectel_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/speedup.c b/plugins/speedup.c
index d1ea35a..9aa9743 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -63,9 +63,18 @@ struct speedup_data {
 static int speedup_probe(struct ofono_modem *modem)
 {
 	struct speedup_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct speedup_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/telit.c b/plugins/telit.c
index b194b65..24c4d0e 100644
--- a/plugins/telit.c
+++ b/plugins/telit.c
@@ -509,9 +509,18 @@ static void telit_post_online(struct ofono_modem *modem)
 static int telit_probe(struct ofono_modem *modem)
 {
 	struct telit_data *data;
+	const char* device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct telit_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 4f94546..555261e 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -140,9 +140,6 @@ static gboolean setup_mbm(struct modem_info *modem)
 		}
 	}
 
-	if (mdm == NULL || app == NULL)
-		return FALSE;
-
 	DBG("modem=%s data=%s network=%s gps=%s", mdm, aux, network, gps);
 
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
@@ -174,9 +171,6 @@ static gboolean setup_hso(struct modem_info *modem)
 			mdm = info->devnode;
 	}
 
-	if (ctl == NULL || app == NULL)
-		return FALSE;
-
 	DBG("control=%s application=%s modem=%s network=%s",
 						ctl, app, mdm, net);
 
@@ -217,9 +211,6 @@ static gboolean setup_gobi(struct modem_info *modem)
 			gps = info->devnode;
 	}
 
-	if (qmi == NULL || mdm == NULL || net == NULL)
-		return FALSE;
-
 	DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
 
 	/* FIXME: gps node not used... */
@@ -310,9 +301,6 @@ static gboolean setup_huawei(struct modem_info *modem)
 		goto done;
 	}
 
-	if (mdm == NULL || pcui == NULL)
-		return FALSE;
-
 done:
 	DBG("mdm=%s pcui=%s diag=%s qmi=%s net=%s", mdm, pcui, diag, qmi, net);
 
@@ -349,9 +337,6 @@ static gboolean setup_speedup(struct modem_info *modem)
 		}
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -379,9 +364,6 @@ static gboolean setup_linktop(struct modem_info *modem)
 			mdm = info->devnode;
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -411,9 +393,6 @@ static gboolean setup_icera(struct modem_info *modem)
 			mdm = info->devnode;
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s net=%s", aux, mdm, net);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -443,9 +422,6 @@ static gboolean setup_alcatel(struct modem_info *modem)
 		}
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -473,9 +449,6 @@ static gboolean setup_novatel(struct modem_info *modem)
 			mdm = info->devnode;
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -503,9 +476,6 @@ static gboolean setup_nokia(struct modem_info *modem)
 			mdm = info->devnode;
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -538,9 +508,6 @@ static gboolean setup_telit(struct modem_info *modem)
 				net = info->devnode;
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("modem=%s aux=%s gps=%s net=%s", mdm, aux, gps, net);
 
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
@@ -643,9 +610,6 @@ static gboolean setup_zte(struct modem_info *modem)
 			mdm = info->devnode;
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
@@ -704,9 +668,6 @@ static gboolean setup_quectel(struct modem_info *modem)
 		}
 	}
 
-	if (aux == NULL || mdm == NULL)
-		return FALSE;
-
 	DBG("aux=%s modem=%s", aux, mdm);
 
 	ofono_modem_set_string(modem->modem, "Aux", aux);
diff --git a/plugins/zte.c b/plugins/zte.c
index 53beefe..b2b3a70 100644
--- a/plugins/zte.c
+++ b/plugins/zte.c
@@ -60,9 +60,18 @@ struct zte_data {
 static int zte_probe(struct ofono_modem *modem)
 {
 	struct zte_data *data;
+	const char *device;
 
 	DBG("%p", modem);
 
+	device = ofono_modem_get_string(modem, "Modem");
+	if (!device)
+		return -ENODEV;
+
+	device = ofono_modem_get_string(modem, "Aux");
+	if (!device)
+		return -ENODEV;
+
 	data = g_try_new0(struct zte_data, 1);
 	if (data == NULL)
 		return -ENOMEM;
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [RFC hwdb v1 28/28] udevng: consolidate setup functions for several USB devices
  2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
                   ` (26 preceding siblings ...)
  2017-03-30 20:53 ` [RFC hwdb v1 27/28] udevng: push device existence check into drivers Jonas Bonn
@ 2017-03-30 20:53 ` Jonas Bonn
  27 siblings, 0 replies; 35+ messages in thread
From: Jonas Bonn @ 2017-03-30 20:53 UTC (permalink / raw)
  To: ofono

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

This patch consolidates a the setup functions for several USB device
types.  These are the "simple" types that only map a couple of interfaces
to modem functions; the more complex types will be moved to this model
in a later patch.

A new function setup_usb_modem is added that maps udev-labelled interfaces
to ofono modem atoms.  The drivers will use the atoms that they know about
and ignore any others; the udev labelling should, however, normally
ensure that the only labelled interfaces are those that the driver
actually cares about (though that's not actually the case today as there
are labelled interfaces that ofono doesn't use).
---
 plugins/udevng.c | 269 ++++++-------------------------------------------------
 1 file changed, 27 insertions(+), 242 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 555261e..2af7e77 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -150,9 +150,10 @@ static gboolean setup_mbm(struct modem_info *modem)
 	return TRUE;
 }
 
-static gboolean setup_hso(struct modem_info *modem)
+static gboolean setup_usb_modem(struct modem_info* modem)
 {
 	const char *ctl = NULL, *app = NULL, *mdm = NULL, *net = NULL;
+	const char *aux = NULL, *gps = NULL;
 	GSList *list;
 
 	DBG("%s", modem->syspath);
@@ -161,23 +162,33 @@ static gboolean setup_hso(struct modem_info *modem)
 		struct device_info *info = list->data;
 
 		DBG("%s %s %s %s %s", info->devnode, info->interface,
-				info->number, info->label, info->sysattr);
+				info->number, info->label, info->subsystem);
 
 		if (g_strcmp0(info->label, "control") == 0)
 			ctl = info->devnode;
-		else if (g_strcmp0(info->label, "app") == 0)
-			app = info->devnode;
 		else if (g_strcmp0(info->label, "modem") == 0)
 			mdm = info->devnode;
+		else if (g_strcmp0(info->label, "aux") == 0)
+			aux = info->devnode;
+		else if (g_strcmp0(info->label, "app") == 0)
+			app = info->devnode;
+		else if (g_strcmp0(info->label, "net") == 0)
+			net = info->devnode;
+		else if (g_strcmp0(info->label, "gps") == 0)
+			gps = info->devnode;
 	}
 
-	DBG("control=%s application=%s modem=%s network=%s",
-						ctl, app, mdm, net);
+	DBG("driver=%s control=%s application=%s"
+	    " modem=%s aux=%s network=%s gps=%s",
+		modem->driver,
+		ctl, app, mdm, aux, net, gps);
 
 	ofono_modem_set_string(modem->modem, "Control", ctl);
 	ofono_modem_set_string(modem->modem, "Application", app);
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
+	ofono_modem_set_string(modem->modem, "Aux", aux);
 	ofono_modem_set_string(modem->modem, "NetworkInterface", net);
+	ofono_modem_set_string(modem->modem, "GPS", gps);
 
 	return TRUE;
 }
@@ -313,177 +324,6 @@ done:
 	return TRUE;
 }
 
-static gboolean setup_speedup(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0) {
-			aux = info->devnode;
-			if (mdm != NULL)
-				break;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
-			mdm = info->devnode;
-			if (aux != NULL)
-				break;
-		}
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
-static gboolean setup_linktop(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0)
-			aux = info->devnode;
-		else if (g_strcmp0(info->label, "modem") == 0)
-			mdm = info->devnode;
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
-static gboolean setup_icera(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0)
-			aux = info->devnode;
-		else if (g_strcmp0(info->label, "modem") == 0)
-			mdm = info->devnode;
-		else if (g_strcmp0(info->label, "net") == 0)
-			mdm = info->devnode;
-	}
-
-	DBG("aux=%s modem=%s net=%s", aux, mdm, net);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-	ofono_modem_set_string(modem->modem, "NetworkInterface", net);
-
-	return TRUE;
-}
-
-static gboolean setup_alcatel(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0) {
-			aux = info->devnode;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
-			mdm = info->devnode;
-		}
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
-static gboolean setup_novatel(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0)
-			aux = info->devnode;
-		else if (g_strcmp0(info->label, "modem") == 0)
-			mdm = info->devnode;
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
-static gboolean setup_nokia(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0)
-			aux = info->devnode;
-		else if (g_strcmp0(info->label, "modem") == 0)
-			mdm = info->devnode;
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
 static gboolean setup_telit(struct modem_info *modem)
 {
 	const char *mdm = NULL, *aux = NULL, *gps = NULL, *net = NULL;
@@ -591,33 +431,6 @@ static gboolean setup_simcom(struct modem_info *modem)
 	return TRUE;
 }
 
-static gboolean setup_zte(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0)
-			aux = info->devnode;
-		else if (g_strcmp0(info->label, "modem") == 0)
-			mdm = info->devnode;
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
 static gboolean setup_samsung(struct modem_info *modem)
 {
 	const char *control = NULL, *network = NULL;
@@ -648,34 +461,6 @@ static gboolean setup_samsung(struct modem_info *modem)
 	return TRUE;
 }
 
-static gboolean setup_quectel(struct modem_info *modem)
-{
-	const char *aux = NULL, *mdm = 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->label, "aux") == 0) {
-			aux = info->devnode;
-		} else if (g_strcmp0(info->label, "modem") == 0) {
-			mdm = info->devnode;
-		}
-	}
-
-	DBG("aux=%s modem=%s", aux, mdm);
-
-	ofono_modem_set_string(modem->modem, "Aux", aux);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-
-	return TRUE;
-}
-
 static gboolean setup_serial_modem(struct modem_info* modem)
 {
 	struct serial_device_info* info;
@@ -858,23 +643,23 @@ static struct {
 } driver_list[] = {
 	{ "isiusb",	setup_isi,	},
 	{ "mbm",	setup_mbm,	"device/interface"	},
-	{ "hso",	setup_hso,	"hsotype"		},
+	{ "hso",	setup_usb_modem },
 	{ "gobi",	setup_gobi	},
 	{ "sierra",	setup_sierra	},
 	{ "huawei",	setup_huawei	},
-	{ "speedupcdma",setup_speedup	},
-	{ "speedup",	setup_speedup	},
-	{ "linktop",	setup_linktop	},
-	{ "alcatel",	setup_alcatel	},
-	{ "novatel",	setup_novatel	},
-	{ "nokia",	setup_nokia	},
+	{ "speedupcdma",setup_usb_modem	},
+	{ "speedup",	setup_usb_modem	},
+	{ "linktop",	setup_usb_modem	},
+	{ "alcatel",	setup_usb_modem	},
+	{ "novatel",	setup_usb_modem	},
+	{ "nokia",	setup_usb_modem },
 	{ "telit",	setup_telit,	"device/interface"	},
 	{ "telitqmi",	setup_telitqmi	},
 	{ "simcom",	setup_simcom	},
-	{ "zte",	setup_zte	},
-	{ "icera",	setup_icera	},
+	{ "zte",	setup_usb_modem	},
+	{ "icera",	setup_usb_modem	},
 	{ "samsung",	setup_samsung	},
-	{ "quectel",	setup_quectel	},
+	{ "quectel",	setup_usb_modem	},
 	{ "ublox",	setup_ublox	},
 	{ "gemalto",	setup_gemalto	},
 	/* Following are non-USB modems */
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [RFC hwdb v1 20/28] telitqmi: drop unused device rule
  2017-03-30 20:53 ` [RFC hwdb v1 20/28] telitqmi: drop unused device rule Jonas Bonn
@ 2017-03-31  8:35   ` Lukasz Nowak
  2017-03-31 10:37     ` Jonas Bonn
  0 siblings, 1 reply; 35+ messages in thread
From: Lukasz Nowak @ 2017-03-31  8:35 UTC (permalink / raw)
  To: ofono

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

Hi Jonas,

On 30/03/17 21:53, Jonas Bonn wrote:
> The rule might match for some device but setup_telitqmi does not attempt
> to do anything for interfaces that aren't driven by the qmi_wwan driver
> so it's pointless.

As I described before, this rule is not pointless, it prevents this rule:
  	{ "telit",	"option",	"1bc7"		},

from taking over the device, and using setup_telit instead of setup_telitqmi.

Lukasz


> ---
>  plugins/udevng.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/plugins/udevng.c b/plugins/udevng.c
> index 3aef447..d02cc6e 100644
> --- a/plugins/udevng.c
> +++ b/plugins/udevng.c
> @@ -1324,7 +1324,6 @@ static struct {
>  	{ "telit",	"usbserial",	"1bc7"		},
>  	{ "telit",	"option",	"1bc7"		},
>  	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
> -	{ "telitqmi",	"option",	"1bc7", "1201"	},
>  	{ "quectel",	"option",	"05c6", "9090"	},
>  	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
>  	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [RFC hwdb v1 20/28] telitqmi: drop unused device rule
  2017-03-31  8:35   ` Lukasz Nowak
@ 2017-03-31 10:37     ` Jonas Bonn
  2017-03-31 22:35       ` Denis Kenzior
  0 siblings, 1 reply; 35+ messages in thread
From: Jonas Bonn @ 2017-03-31 10:37 UTC (permalink / raw)
  To: ofono

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

On 03/31/2017 10:35 AM, Lukasz Nowak wrote:
> Hi Jonas,
>
> On 30/03/17 21:53, Jonas Bonn wrote:
>> The rule might match for some device but setup_telitqmi does not attempt
>> to do anything for interfaces that aren't driven by the qmi_wwan driver
>> so it's pointless.
> As I described before, this rule is not pointless, it prevents this rule:
>    	{ "telit",	"option",	"1bc7"		},
>
> from taking over the device, and using setup_telit instead of setup_telitqmi.
>
> Lukasz

Yes, but in the context of the transition to hwdb it should not be 
necessary anymore.  That said, I see the problem and I think it still 
persists in the hwdb model.  The problem is the Telit catch-all rule; we 
really need to get rid of it but that risks rendering a bunch of modems 
that work today non-functional.  This needs some thought.

/Jonas

>
>
>> ---
>>   plugins/udevng.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/plugins/udevng.c b/plugins/udevng.c
>> index 3aef447..d02cc6e 100644
>> --- a/plugins/udevng.c
>> +++ b/plugins/udevng.c
>> @@ -1324,7 +1324,6 @@ static struct {
>>   	{ "telit",	"usbserial",	"1bc7"		},
>>   	{ "telit",	"option",	"1bc7"		},
>>   	{ "telit",	"cdc_acm",	"1bc7", "0021"	},
>> -	{ "telitqmi",	"option",	"1bc7", "1201"	},
>>   	{ "quectel",	"option",	"05c6", "9090"	},
>>   	{ "telit",	"cdc_ncm",	"1bc7", "0036"	},
>>   	{ "telit",	"cdc_acm",	"1bc7", "0036"	},
>>


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [RFC hwdb v1 20/28] telitqmi: drop unused device rule
  2017-03-31 10:37     ` Jonas Bonn
@ 2017-03-31 22:35       ` Denis Kenzior
  0 siblings, 0 replies; 35+ messages in thread
From: Denis Kenzior @ 2017-03-31 22:35 UTC (permalink / raw)
  To: ofono

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

Hi Jonas,

On 03/31/2017 05:37 AM, Jonas Bonn wrote:
> On 03/31/2017 10:35 AM, Lukasz Nowak wrote:
>> Hi Jonas,
>>
>> On 30/03/17 21:53, Jonas Bonn wrote:
>>> The rule might match for some device but setup_telitqmi does not attempt
>>> to do anything for interfaces that aren't driven by the qmi_wwan driver
>>> so it's pointless.
>> As I described before, this rule is not pointless, it prevents this rule:
>>        { "telit",    "option",    "1bc7"        },
>>
>> from taking over the device, and using setup_telit instead of
>> setup_telitqmi.
>>
>> Lukasz
>
> Yes, but in the context of the transition to hwdb it should not be
> necessary anymore.  That said, I see the problem and I think it still
> persists in the hwdb model.  The problem is the Telit catch-all rule; we
> really need to get rid of it but that risks rendering a bunch of modems
> that work today non-functional.  This needs some thought.
>

Why don't we unify setup_telit & setup_telitqmi and let the unified 
function figure out whether the particular telit modem is QMI based or 
not.  Similar to what setup_sierra does.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [RFC hwdb v1 11/28] udevng (hso): remove impossible condition
  2017-03-30 20:52 ` [RFC hwdb v1 11/28] udevng (hso): remove impossible condition Jonas Bonn
@ 2017-03-31 22:51   ` Denis Kenzior
  0 siblings, 0 replies; 35+ messages in thread
From: Denis Kenzior @ 2017-03-31 22:51 UTC (permalink / raw)
  To: ofono

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

Hi Jonas,

On 03/30/2017 03:52 PM, Jonas Bonn wrote:
> The hso driver setup function tests for the devnode beginning with "hso"
> in order to detect the network interface.  Since the devnode will always
> begin with "/dev", this condition will never be fulfilled.

That's definitely incorrect.  setup_hso will receive both ttys and 
network devices.  ttys will start with /dev/, but network devices are 
not.  This change would break all option devices with a high speed 
interface.

>
> Given that the 'net' variable never gets set, we could just remove it.
> However, leaving it there for now might be reminder to someone to figure
> out how to set it in case it's actually needed.  That said, this test
> has been in the code since 2011 and, presumably, nobody's noticied so
> this modem might not be something that anybody actually uses anymore.

'net' definitely gets set.  I just tested it on an Option 452 and it 
works just fine.

> ---
>  plugins/udevng.c | 3 ---
>  1 file changed, 3 deletions(-)
>

Regards,
-Denis


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [RFC hwdb v1 25/28] mbm: use standard atom names
  2017-03-30 20:53 ` [RFC hwdb v1 25/28] mbm: use standard atom names Jonas Bonn
@ 2017-03-31 22:54   ` Denis Kenzior
  0 siblings, 0 replies; 35+ messages in thread
From: Denis Kenzior @ 2017-03-31 22:54 UTC (permalink / raw)
  To: ofono

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

Hi Jonas,

On 03/30/2017 03:53 PM, Jonas Bonn wrote:
> ---
>  drivers/mbmmodem/location-reporting.c |  2 +-
>  plugins/mbm.c                         |  6 +++---
>  plugins/udevng.c                      | 12 ++++++------
>  3 files changed, 10 insertions(+), 10 deletions(-)
>

make --no-print-directory all-am
   CC       plugins/udevng.o
plugins/udevng.c: In function ‘setup_mbm’:
plugins/udevng.c:145:21: error: ‘app’ undeclared (first use in this 
function)
   if (mdm == NULL || app == NULL)
                      ^
plugins/udevng.c:145:21: note: each undeclared identifier is reported 
only once for each function it appears in



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [RFC hwdb v1 26/28] udevng: remove 'option' driver setup
  2017-03-30 20:53 ` [RFC hwdb v1 26/28] udevng: remove 'option' driver setup Jonas Bonn
@ 2017-03-31 23:18   ` Denis Kenzior
  0 siblings, 0 replies; 35+ messages in thread
From: Denis Kenzior @ 2017-03-31 23:18 UTC (permalink / raw)
  To: ofono

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

Hi Jonas,

On 03/30/2017 03:53 PM, Jonas Bonn wrote:
> No driver named 'option' exists so this device can never be instantiated.
> ---
>  plugins/udevng.c | 34 ----------------------------------
>  1 file changed, 34 deletions(-)
>

I applied this one.  All Option devices should be handled by hso.  Not 
sure why this one was still around.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2017-03-31 23:18 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 20:52 [RFC hwdb v1 00/28] USB interface labelling via udev Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 01/28] zte: remove unused qcdm property Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 02/28] zte: label interfaces via hwdb Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 03/28] novatel: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 04/28] alcatel: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 05/28] huawei: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 06/28] simcom: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 07/28] ublox: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 08/28] gemalto: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 09/28] speedup: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 10/28] linktop: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 11/28] udevng (hso): remove impossible condition Jonas Bonn
2017-03-31 22:51   ` Denis Kenzior
2017-03-30 20:52 ` [RFC hwdb v1 12/28] hso: label interfaces via udev rules Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 13/28] isiusb: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 14/28] gobi: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 15/28] option: label interfaces via hwdb Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 16/28] nokia: " Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 17/28] samsung: label interfaces via udev rules and hwdb Jonas Bonn
2017-03-30 20:52 ` [RFC hwdb v1 18/28] sierra: label interfaces via udev rules Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 19/28] telitqmi: " Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 20/28] telitqmi: drop unused device rule Jonas Bonn
2017-03-31  8:35   ` Lukasz Nowak
2017-03-31 10:37     ` Jonas Bonn
2017-03-31 22:35       ` Denis Kenzior
2017-03-30 20:53 ` [RFC hwdb v1 21/28] telit: label interfaces via hwdb Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 22/28] icera: " Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 23/28] quectel: " Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 24/28] udevng: drop unused headers Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 25/28] mbm: use standard atom names Jonas Bonn
2017-03-31 22:54   ` Denis Kenzior
2017-03-30 20:53 ` [RFC hwdb v1 26/28] udevng: remove 'option' driver setup Jonas Bonn
2017-03-31 23:18   ` Denis Kenzior
2017-03-30 20:53 ` [RFC hwdb v1 27/28] udevng: push device existence check into drivers Jonas Bonn
2017-03-30 20:53 ` [RFC hwdb v1 28/28] udevng: consolidate setup functions for several USB devices Jonas Bonn

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.