Setup LE910V2 in default USB composition with 6 CDC-ACM serial ports and 1 CDC-NCM network adapter. --- plugins/udevng.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/plugins/udevng.c b/plugins/udevng.c index 50089129..90ddeeab 100644 --- a/plugins/udevng.c +++ b/plugins/udevng.c @@ -957,6 +957,41 @@ static gboolean setup_gemalto(struct modem_info* modem) return TRUE; } +static gboolean setup_le910v2(struct modem_info *modem) +{ + const char *aux = NULL, *mdm = NULL, *network = 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 %s", info->devnode, info->interface, + info->number, info->label, info->sysattr); + + 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, "06") == 0) + mdm = info->devnode; + } else if (info->sysattr && (g_str_has_suffix(info->sysattr, + "CDC NCM") == TRUE)) { + network = info->devnode; + } + } + DBG("aux=%s modem=%s network=%s", aux, mdm, network); + + if (aux == NULL || mdm == NULL || network == NULL) + return FALSE; + + ofono_modem_set_string(modem->modem, "Aux", aux); + ofono_modem_set_string(modem->modem, "Modem", mdm); + ofono_modem_set_string(modem->modem, "NetworkInterface", network); + + return TRUE; +} + static struct { const char *name; gboolean (*setup)(struct modem_info *modem); @@ -984,6 +1019,7 @@ static struct { { "quectel", setup_quectel }, { "ublox", setup_ublox }, { "gemalto", setup_gemalto }, + { "le910v2", setup_le910v2, "device/interface" }, { } }; @@ -1226,6 +1262,8 @@ static struct { { "gemalto", "option", "1e2d", "0053" }, { "gemalto", "cdc_wdm", "1e2d", "0053" }, { "gemalto", "qmi_wwan", "1e2d", "0053" }, + { "le910v2", "cdc_ncm", "1bc7", "0036" }, + { "le910v2", "cdc_acm", "1bc7", "0036" }, { } }; -- 2.11.0