diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-12-27 06:50:06 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-01-24 18:35:40 +0100 |
commit | 3914808120bb852dc22ee1d89ad2a21d6120af9d (patch) | |
tree | 3ca7102fc84f7ae40a1fd6df7f76c15f5351b7b0 | |
parent | 19b0a7e28fa27556db8f09f93c8628a3fa21aeaa (diff) |
zte: support for QMI-based modems
E.g. the ZTE MF190
[/dev/cdc-wdm1] QMI Device supports 4 services:
[/dev/cdc-wdm1] ctl (1.2)
[/dev/cdc-wdm1] wds (1.3)
[/dev/cdc-wdm1] dms (1.2)
[/dev/cdc-wdm1] nas (1.0)
-rw-r--r-- | plugins/zte/mm-plugin-zte.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c index 59d4380d..496ccf2b 100644 --- a/plugins/zte/mm-plugin-zte.c +++ b/plugins/zte/mm-plugin-zte.c @@ -26,6 +26,10 @@ #include "mm-broadband-modem-zte.h" #include "mm-broadband-modem-zte-icera.h" +#if defined WITH_QMI +#include "mm-broadband-modem-qmi.h" +#endif + G_DEFINE_TYPE (MMPluginZte, mm_plugin_zte, MM_TYPE_PLUGIN) int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; @@ -60,6 +64,17 @@ create_modem (MMPlugin *self, GList *probes, GError **error) { +#if defined WITH_QMI + if (mm_port_probe_list_has_qmi_port (probes)) { + mm_dbg ("QMI-powered ZTE modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } +#endif + if (mm_port_probe_list_is_icera (probes)) return MM_BASE_MODEM (mm_broadband_modem_zte_icera_new (sysfs_path, drivers, @@ -86,13 +101,13 @@ grab_port (MMPlugin *self, port = mm_port_probe_peek_port (probe); - /* Ignore net ports on non-Icera modems */ + /* Ignore net ports on non-Icera non-QMI modems */ ptype = mm_port_probe_get_port_type (probe); - if (ptype == MM_PORT_TYPE_NET && !MM_IS_BROADBAND_MODEM_ZTE_ICERA (modem)) { + if (ptype == MM_PORT_TYPE_NET && MM_IS_BROADBAND_MODEM_ZTE (modem)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, - "Ignoring net port in non-Icera ZTE modem"); + "Ignoring net port in ZTE modem"); return FALSE; } @@ -131,7 +146,7 @@ grab_port (MMPlugin *self, G_MODULE_EXPORT MMPlugin * mm_plugin_create (void) { - static const gchar *subsystems[] = { "tty", "net", NULL }; + static const gchar *subsystems[] = { "tty", "net", "usb", NULL }; static const guint16 vendor_ids[] = { 0x19d2, 0 }; return MM_PLUGIN ( @@ -142,6 +157,7 @@ mm_plugin_create (void) MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe, MM_PLUGIN_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE, + MM_PLUGIN_ALLOWED_QMI, TRUE, MM_PLUGIN_ICERA_PROBE, TRUE, NULL)); } |