Add setup_speedupcdma in order to support the specificities of cdma modems

---
 plugins/udevng.c |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index e0f5fd8..35f8c1e 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -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   },
-- 
1.7.4.1

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to