From cab4b54ad106caadb7f70025348f0aab5522bde4 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 25 Oct 2020 14:23:29 +0100 Subject: core: new 'rpmsg' subsystem Most older Qualcomm SoCs (e.g. MSM8916, MSM8974, ...) communicate with the integrated modem via shared memory (SMD channels). This is similar to QRTR on newer SoCs, but without the "network" layer. In fact, the older SoCs also have QRTR, but the modem QMI services are not exposed there. The mainline Linux kernel exposes SMD channels via the "remote processor messaging bus" (rpmsg). Through special IOCTL calls it is possible to create a char device for a rpmsg/SMD channel. We can then use these to send QMI/AT messages to the modem, much like the ordinary serial char devices when using a Qualcomm modem through USB. This commit introduces support for the new 'rpmsg' subsystem, which allows exporting QMI-capable and AT-capable ports. By default NO rpmsg port is flagged as candidate, it is assumed that the plugin adding support for the rpmsg subsystem will add specific rules to do so (e.g. so that non-modem ports are explicitly not flagged as candidate). All rpmsg ports will be probed for AT or QMI capabilities, unless explicit port type hints (e.g. ID_MM_PORT_TYPE_QMI or ID_MM_PORT_TYPE_AT_PRIMARY) are set. These changes are highly based on the initial integration work done by Stephan Gerhold in postmarketOS, see: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/363 --- src/mm-plugin.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mm-plugin.c') diff --git a/src/mm-plugin.c b/src/mm-plugin.c index be6e39ff..13b46a75 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -781,6 +781,11 @@ mm_plugin_supports_port (MMPlugin *self, probe_run_flags |= MM_PORT_PROBE_MBIM; else probe_run_flags |= MM_PORT_PROBE_AT; + } else if (g_str_equal (mm_kernel_device_get_subsystem (port), "rpmsg")) { + if (self->priv->at) + probe_run_flags |= MM_PORT_PROBE_AT; + if (self->priv->qmi) + probe_run_flags |= MM_PORT_PROBE_QMI; } /* For potential AT ports, check for more things */ -- cgit v1.2.3-70-g09d2