summaryrefslogtreecommitdiff
path: root/plugins/udevng.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2017-09-18 20:31:52 -0500
committerDenis Kenzior <denkenz@gmail.com>2017-10-05 11:08:38 -0500
commit4a6007ba2d29965a2f1ecd54223c674635fe4aea (patch)
treed880cbcbc387ec99fa321dae215e8c8b8a6a38fd /plugins/udevng.c
parent649d204158796b03fcb572f8bcf1c475f4ded9a3 (diff)
downloadofono-4a6007ba2d29965a2f1ecd54223c674635fe4aea.tar.gz
udevng: Add basic detection for MBIM
Currently only Telit LN930 has been tested to work
Diffstat (limited to 'plugins/udevng.c')
-rw-r--r--plugins/udevng.c37
1 files changed, 37 insertions, 0 deletions
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" },