Skip to contentSkip to conversation

udevng: Add support of SU-7300

PATCH New Nicolas Bertrand 1 participant 1 message Nov 17, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udevng: Add support of SU-7300

Add setup_speedupcdma in order to support the specificities of cdma modems

---
 plugins/udevng.c |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)
plugins/udevng.c +43 -1
index e0f5fd8..35f8c1e 100644
@@ -289,6 +289,48 @@ static gboolean setup_huawei(struct modem_info *modem)
 	return TRUE;
 }
 
+static gboolean setup_speedupcdma(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;
+		} 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)
+				aux = info->devnode;
+			else if (g_strcmp0(info->number, "03") == 0)
+				aux = info->devnode;
+		}
+	}
+
+	if (aux == NULL || mdm == NULL)
+		return FALSE;
+
+	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_speedup(struct modem_info *modem)
 {
 	const char *aux = NULL, *mdm = NULL;
@@ -614,7 +656,7 @@ static struct {
 	{ "sierra",	setup_sierra	},
 	{ "huawei",	setup_huawei	},
 	{ "huaweicdma",	setup_huawei	},
-	{ "speedupcdma",setup_speedup	},
+	{ "speedupcdma",setup_speedupcdma},
 	{ "speedup",	setup_speedup	},
 	{ "linktop",	setup_linktop	},
 	{ "alcatel",	setup_alcatel	},
Signature · 1 line
1.7.4.1