From 4a6007ba2d29965a2f1ecd54223c674635fe4aea Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 18 Sep 2017 20:31:52 -0500 Subject: [PATCH] udevng: Add basic detection for MBIM Currently only Telit LN930 has been tested to work --- plugins/udevng.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/plugins/udevng.c b/plugins/udevng.c index ec4d34eb..a87d8b79 100644 --- a/plugins/udevng.c +++ b/plugins/udevng.c @@ -924,6 +924,41 @@ static gboolean setup_quectelqmi(struct modem_info *modem) return TRUE; } +static gboolean setup_mbim(struct modem_info *modem) +{ + const char *ctl = NULL, *net = NULL, *atcmd = 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 %s", info->devnode, info->interface, + info->number, info->label, + info->sysattr, info->subsystem); + + if (g_strcmp0(info->subsystem, "usbmisc") == 0) /* cdc-wdm */ + ctl = info->devnode; + else if (g_strcmp0(info->subsystem, "net") == 0) /* wwan */ + net = info->devnode; + else if (g_strcmp0(info->subsystem, "tty") == 0) { + if (g_strcmp0(info->number, "02") == 0) + atcmd = info->devnode; + } + } + + if (ctl == NULL || net == NULL) + return FALSE; + + DBG("ctl=%s net=%s atcmd=%s", ctl, net, atcmd); + + ofono_modem_set_string(modem->modem, "Device", ctl); + ofono_modem_set_string(modem->modem, "NetworkInterface", net); + + return TRUE; +} + static gboolean setup_serial_modem(struct modem_info* modem) { struct serial_device_info* info; @@ -1183,6 +1218,7 @@ static struct { { "ublox", setup_ublox }, { "gemalto", setup_gemalto }, { "xmm7xxx", setup_xmm7xxx }, + { "mbim", setup_mbim }, /* Following are non-USB modems */ { "ifx", setup_ifx }, { "u8500", setup_isi_serial }, @@ -1511,6 +1547,7 @@ static struct { { "mbm", "cdc_acm", "413c" }, { "mbm", "cdc_ether", "413c" }, { "mbm", "cdc_ncm", "413c" }, + { "mbim", "cdc_mbim" }, { "mbm", "cdc_acm", "03f0" }, { "mbm", "cdc_ether", "03f0" }, { "mbm", "cdc_ncm", "03f0" },