aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build1
-rw-r--r--meson_options.txt1
-rw-r--r--src/plugins/cellient/77-mm-cellient.rules18
-rw-r--r--src/plugins/cellient/mm-plugin-cellient.c92
-rw-r--r--src/plugins/meson.build17
-rw-r--r--src/plugins/mm-builtin-plugins.c6
-rw-r--r--src/plugins/tests/test-udev-rules.c11
7 files changed, 146 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 92cf3af1..4cbe0a6b 100644
--- a/meson.build
+++ b/meson.build
@@ -327,6 +327,7 @@ plugins_options_reqs = {
'altair-lte': {'available': true, 'shared': []},
'anydata': {'available': true, 'shared': []},
'broadmobi': {'available': true, 'shared': []},
+ 'cellient': {'available': true, 'shared': []},
'cinterion': {'available': true, 'shared': []},
'dell': {'available': true, 'shared': dell_shared_reqs},
'dlink': {'available': true, 'shared': []},
diff --git a/meson_options.txt b/meson_options.txt
index 799d6c34..c0609fe8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -30,6 +30,7 @@ option('plugin_generic', type: 'feature', value: 'auto', description: 'enable ge
option('plugin_altair_lte', type: 'feature', value: 'auto', description: 'enable altair lte plugin support')
option('plugin_anydata', type: 'feature', value: 'auto', description: 'enable anydata plugin support')
option('plugin_broadmobi', type: 'feature', value: 'auto', description: 'enable broadmobi plugin support')
+option('plugin_cellient', type: 'feature', value: 'auto', description: 'enable cellient plugin support')
option('plugin_cinterion', type: 'feature', value: 'auto', description: 'enable cinterion plugin support')
option('plugin_dell', type: 'feature', value: 'auto', description: 'enable dell plugin support')
option('plugin_dlink', type: 'feature', value: 'auto', description: 'enable dlink plugin support')
diff --git a/src/plugins/cellient/77-mm-cellient.rules b/src/plugins/cellient/77-mm-cellient.rules
new file mode 100644
index 00000000..361bd663
--- /dev/null
+++ b/src/plugins/cellient/77-mm-cellient.rules
@@ -0,0 +1,18 @@
+# do not edit this file, it will be overwritten on update
+ACTION!="add|change|move|bind", GOTO="mm_cellient_end"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="2692", GOTO="mm_cellient_generic"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="05c6", GOTO="mm_cellient_qualcomm"
+GOTO="mm_cellient_end"
+
+LABEL="mm_cellient_generic"
+# Cellient MPL200: Disable QMI WDS PCO
+ATTRS{idVendor}=="2692", ATTRS{idProduct}=="9025", ENV{ID_MM_QMI_PCO_DISABLED}="1"
+GOTO="mm_cellient_end"
+
+# Cellient products rebranded as Qualcomm
+LABEL="mm_cellient_qualcomm"
+
+# Cellient MPL200 (rebranded Qualcomm 05c6:9025): Disable QMI WDS PCO
+ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9025", ENV{ID_MM_QMI_PCO_DISABLED}="1"
+
+LABEL="mm_cellient_end"
diff --git a/src/plugins/cellient/mm-plugin-cellient.c b/src/plugins/cellient/mm-plugin-cellient.c
new file mode 100644
index 00000000..ec0936e3
--- /dev/null
+++ b/src/plugins/cellient/mm-plugin-cellient.c
@@ -0,0 +1,92 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details:
+ *
+ * Copyright (C) 2024 Stig Magnus Baugstø <stig@peerconsulting.no>
+ */
+
+#define _LIBMM_INSIDE_MM
+#include "mm-plugin-common.h"
+#include "mm-log-object.h"
+
+#if defined WITH_QMI
+# include "mm-broadband-modem-qmi.h"
+#else
+# include "mm-broadband-modem.h"
+#endif
+
+#define MM_TYPE_PLUGIN_CELLIENT mm_plugin_cellient_get_type ()
+MM_DEFINE_PLUGIN (CELLIENT, cellient, Cellient)
+
+/*****************************************************************************/
+
+static MMBaseModem *
+create_modem (MMPlugin *self,
+ const gchar *uid,
+ const gchar *physdev,
+ const gchar **drivers,
+ guint16 vendor,
+ guint16 product,
+ guint16 subsystem_vendor,
+ GList *probes,
+ GError **error)
+{
+#if defined WITH_QMI
+ if (mm_port_probe_list_has_qmi_port (probes)) {
+ mm_obj_dbg (self, "QMI-powered Cellient modem found...");
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
+ physdev,
+ drivers,
+ mm_plugin_get_name (self),
+ vendor,
+ product));
+ }
+#endif
+
+ mm_obj_dbg (self, "Generic Cellient modem found...");
+ return MM_BASE_MODEM (mm_broadband_modem_new (uid,
+ physdev,
+ drivers,
+ mm_plugin_get_name (self),
+ vendor,
+ product));
+}
+
+/*****************************************************************************/
+
+MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin *
+mm_plugin_create_cellient (void)
+{
+ static const gchar *subsystems[] = { "tty", "net", "usbmisc", "wwan", NULL };
+ static const guint16 vendor_ids[] = { 0x2692, 0 };
+
+ return MM_PLUGIN (
+ g_object_new (MM_TYPE_PLUGIN_CELLIENT,
+ MM_PLUGIN_NAME, MM_MODULE_NAME,
+ MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
+ MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
+ MM_PLUGIN_ALLOWED_AT, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
+ NULL));
+}
+
+static void
+mm_plugin_cellient_init (MMPluginCellient *self)
+{
+}
+
+static void
+mm_plugin_cellient_class_init (MMPluginCellientClass *klass)
+{
+ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
+
+ plugin_class->create_modem = create_modem;
+}
diff --git a/src/plugins/meson.build b/src/plugins/meson.build
index 3742ced5..b21b5e36 100644
--- a/src/plugins/meson.build
+++ b/src/plugins/meson.build
@@ -357,6 +357,23 @@ if plugins_options['broadmobi']
plugins_udev_rules += files('broadmobi/77-mm-broadmobi-port-types.rules')
endif
+# plugin: cellient
+if plugins_options['cellient']
+ test_udev_rules_dir_c_args = ['-DTESTUDEVRULESDIR_CELLIENT="@0@"'.format(plugins_dir / 'cellient')]
+ plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args
+
+ sources = files(
+ 'cellient/mm-plugin-cellient.c',
+ )
+
+ plugins += {'plugin-cellient': {
+ 'plugin': true,
+ 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="cellient"']},
+ }}
+
+ plugins_udev_rules += files('cellient/77-mm-cellient.rules')
+endif
+
# plugin: cinterion (previously siemens)
if plugins_options['cinterion']
test_udev_rules_dir_c_args = ['-DTESTUDEVRULESDIR_CINTERION="@0@"'.format(plugins_dir / 'cinterion')]
diff --git a/src/plugins/mm-builtin-plugins.c b/src/plugins/mm-builtin-plugins.c
index 0fd96700..c7f91633 100644
--- a/src/plugins/mm-builtin-plugins.c
+++ b/src/plugins/mm-builtin-plugins.c
@@ -28,6 +28,9 @@ MMPlugin *mm_plugin_create_anydata (void);
#if defined ENABLE_PLUGIN_BROADMOBI
MMPlugin *mm_plugin_create_broadmobi (void);
#endif
+#if defined ENABLE_PLUGIN_CELLIENT
+MMPlugin *mm_plugin_create_cellient (void);
+#endif
#if defined ENABLE_PLUGIN_CINTERION
MMPlugin *mm_plugin_create_cinterion (void);
#endif
@@ -163,6 +166,9 @@ mm_builtin_plugins_load (void)
#if defined ENABLE_PLUGIN_BROADMOBI
PREPEND_PLUGIN (broadmobi);
#endif
+#if defined ENABLE_PLUGIN_CELLIENT
+ PREPEND_PLUGIN (cellient);
+#endif
#if defined ENABLE_PLUGIN_CINTERION
PREPEND_PLUGIN (cinterion);
#endif
diff --git a/src/plugins/tests/test-udev-rules.c b/src/plugins/tests/test-udev-rules.c
index 91698f0b..8f5ffd64 100644
--- a/src/plugins/tests/test-udev-rules.c
+++ b/src/plugins/tests/test-udev-rules.c
@@ -112,6 +112,14 @@ test_x22x (void)
}
#endif
+#if defined ENABLE_PLUGIN_CELLIENT
+static void
+test_cellient (void)
+{
+ common_test (TESTUDEVRULESDIR_CELLIENT);
+}
+#endif
+
#if defined ENABLE_PLUGIN_CINTERION
static void
test_cinterion (void)
@@ -238,6 +246,9 @@ int main (int argc, char **argv)
#if defined ENABLE_PLUGIN_X22X
g_test_add_func ("/MM/test-udev-rules/x22x", test_x22x);
#endif
+#if defined ENABLE_PLUGIN_CELLIENT
+ g_test_add_func ("/MM/test-udev-rules/cellient", test_cellient);
+#endif
#if defined ENABLE_PLUGIN_CINTERION
g_test_add_func ("/MM/test-udev-rules/cinterion", test_cinterion);
#endif