summaryrefslogtreecommitdiffstats
path: root/plugins/udevng.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-01-13 04:56:02 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-01-13 04:56:02 +0100
commitf2bfaed174e7253db03186369f4dea8f7eb2233d (patch)
treee3176b0ed4ca1b9be91210e4d009b18a35105182 /plugins/udevng.c
parent3029e73c169a90e49c31ee26dad0a42271fac24c (diff)
downloadofono-f2bfaed174e7253db03186369f4dea8f7eb2233d.tar.bz2
udev: Add detection support for SIM COM modems
Diffstat (limited to 'plugins/udevng.c')
-rw-r--r--plugins/udevng.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 315b8af9..9764a9da 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -521,6 +521,51 @@ static gboolean setup_telit(struct modem_info *modem)
return TRUE;
}
+static gboolean setup_simcom(struct modem_info *modem)
+{
+ const char *mdm = NULL, *aux = NULL, *gps = 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, "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)
+ 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;
+ }
+ }
+
+ if (aux == NULL || mdm == NULL)
+ return FALSE;
+
+ DBG("modem=%s aux=%s gps=%s diag=%s", mdm, aux, gps, diag);
+
+ ofono_modem_set_string(modem->modem, "Modem", mdm);
+ ofono_modem_set_string(modem->modem, "Data", aux);
+ ofono_modem_set_string(modem->modem, "GPS", gps);
+
+ return TRUE;
+}
+
static gboolean setup_zte(struct modem_info *modem)
{
const char *aux = NULL, *mdm = NULL, *qcdm = NULL;
@@ -613,6 +658,7 @@ static struct {
{ "novatel", setup_novatel },
{ "nokia", setup_nokia },
{ "telit", setup_telit },
+ { "simcom", setup_simcom },
{ "zte", setup_zte },
{ "samsung", setup_samsung },
{ }
@@ -801,6 +847,7 @@ static struct {
{ "alcatel", "option", "1bbb", "0017" },
{ "novatel", "option", "1410" },
{ "zte", "option", "19d2" },
+ { "simcom", "option", "05c6", "9000" },
{ "telit", "usbserial", "1bc7" },
{ "telit", "option", "1bc7" },
{ "nokia", "option", "0421", "060e" },