summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorPhilip Paeps <philip@paeps.cx>2014-06-26 19:08:12 +0200
committerDenis Kenzior <denkenz@gmail.com>2014-06-30 13:26:51 -0500
commit5cffd8af95b1f4c00c386ebc61f8529b88e4082a (patch)
tree4fc1ed5535ab5d1b53aa0c89273b2b726839b826 /plugins
parentd2f6ffc18d067354a00f7a649dab570c1ec25d14 (diff)
downloadofono-5cffd8af95b1f4c00c386ebc61f8529b88e4082a.tar.bz2
udevng: add detection logic for Quectel modems
Diffstat (limited to 'plugins')
-rw-r--r--plugins/udevng.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/udevng.c b/plugins/udevng.c
index d41c6a82..2ee5a24c 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -791,6 +791,46 @@ 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;
+ 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;
+ }
+ }
+
+ 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 struct {
const char *name;
gboolean (*setup)(struct modem_info *modem);
@@ -815,6 +855,7 @@ static struct {
{ "zte", setup_zte },
{ "icera", setup_icera },
{ "samsung", setup_samsung },
+ { "quectel", setup_quectel },
{ }
};
@@ -1026,6 +1067,7 @@ static struct {
{ "nokia", "option", "0421", "0623" },
{ "samsung", "option", "04e8", "6889" },
{ "samsung", "kalmia" },
+ { "quectel", "option", "05c6", "9090" },
{ }
};