aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-10-24 09:29:39 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-11-09 18:41:57 +0100
commitc92dc21a18e6e79de2195bf6d2ec821c7f6195ef (patch)
treec6a3c7764f6fc11770fec4620d8ed5ce2042c8a2
parente01c8b379cbd77b7085e40f9448df68b368faae2 (diff)
api: new ID_MM_PORT_TYPE_QMI and ID_MM_PORT_TYPE_MBIM udev hints
It is no longer true that all QMI ports are exposed by the qmi_wwan driver and that all MBIM ports are exposed by the cdc_mbim driver. There are other generic setups that allow exposing these types of ports using different drivers, and usually we can also know the type of port in advance via other means. Therefore, allow adding udev port type hints for QMI and MBIM ports as well.
-rw-r--r--docs/reference/api/ModemManager-docs.xml4
-rw-r--r--docs/reference/api/ModemManager-sections.txt2
-rw-r--r--include/ModemManager-tags.h30
-rw-r--r--src/mm-port-probe.c46
4 files changed, 73 insertions, 9 deletions
diff --git a/docs/reference/api/ModemManager-docs.xml b/docs/reference/api/ModemManager-docs.xml
index 42dbf1f6..61850603 100644
--- a/docs/reference/api/ModemManager-docs.xml
+++ b/docs/reference/api/ModemManager-docs.xml
@@ -139,4 +139,8 @@
<title>Index of new symbols in 1.12</title>
<xi:include href="xml/api-index-1.12.xml"></xi:include>
</chapter>
+ <chapter id="api-index-1-16" role="1.16">
+ <title>Index of new symbols in 1.16</title>
+ <xi:include href="xml/api-index-1.16.xml"></xi:include>
+ </chapter>
</book>
diff --git a/docs/reference/api/ModemManager-sections.txt b/docs/reference/api/ModemManager-sections.txt
index e63ce121..478f4793 100644
--- a/docs/reference/api/ModemManager-sections.txt
+++ b/docs/reference/api/ModemManager-sections.txt
@@ -164,6 +164,8 @@ ID_MM_PORT_TYPE_AT_SECONDARY
ID_MM_PORT_TYPE_GPS
ID_MM_PORT_TYPE_QCDM
ID_MM_PORT_TYPE_AUDIO
+ID_MM_PORT_TYPE_QMI
+ID_MM_PORT_TYPE_MBIM
ID_MM_TTY_BAUDRATE
ID_MM_TTY_FLOW_CONTROL
</SECTION>
diff --git a/include/ModemManager-tags.h b/include/ModemManager-tags.h
index 633060b7..2566cebb 100644
--- a/include/ModemManager-tags.h
+++ b/include/ModemManager-tags.h
@@ -214,6 +214,36 @@
#define ID_MM_PORT_TYPE_AUDIO "ID_MM_PORT_TYPE_AUDIO"
/**
+ * ID_MM_PORT_TYPE_QMI:
+ *
+ * This is a port-specific tag applied to generic ports that we know in advance
+ * are QMI ports.
+ *
+ * This tag will also prevent other types of probing (e.g. AT, MBIM) on the
+ * port.
+ *
+ * This tag is not required for QMI ports exposed by the qmi_wwan driver.
+ *
+ * Since: 1.16
+ */
+#define ID_MM_PORT_TYPE_QMI "ID_MM_PORT_TYPE_QMI"
+
+/**
+ * ID_MM_PORT_TYPE_MBIM:
+ *
+ * This is a port-specific tag applied to generic ports that we know in advance
+ * are MBIM ports.
+ *
+ * This tag will also prevent other types of probing (e.g. AT, QMI) on the
+ * port.
+ *
+ * This tag is not required for MBIM ports exposed by the cdc_mbim driver.
+ *
+ * Since: 1.16
+ */
+#define ID_MM_PORT_TYPE_MBIM "ID_MM_PORT_TYPE_MBIM"
+
+/**
* ID_MM_TTY_BAUDRATE:
*
* This is a port-specific tag applied to TTYs that require a specific
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 947be83b..e2b57bda 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -101,6 +101,8 @@ struct _MMPortProbePrivate {
gboolean maybe_at_secondary;
gboolean maybe_at_ppp;
gboolean maybe_qcdm;
+ gboolean maybe_qmi;
+ gboolean maybe_mbim;
/* Current probing task. Only one can be available at a time */
GTask *task;
@@ -1428,30 +1430,54 @@ mm_port_probe_run (MMPortProbe *self,
return;
}
- /* If this is a port flagged as a GPS port, don't do any AT or QCDM probing */
+ /* If this is a port flagged as a GPS port, don't do any other probing */
if (self->priv->is_gps) {
mm_obj_dbg (self, "GPS port detected");
- mm_port_probe_set_result_at (self, FALSE);
+ mm_port_probe_set_result_at (self, FALSE);
mm_port_probe_set_result_qcdm (self, FALSE);
+ mm_port_probe_set_result_qmi (self, FALSE);
+ mm_port_probe_set_result_mbim (self, FALSE);
}
- /* If this is a port flagged as an audio port, don't do any AT or QCDM probing */
+ /* If this is a port flagged as an audio port, don't do any other probing */
if (self->priv->is_audio) {
mm_obj_dbg (self, "audio port detected");
- mm_port_probe_set_result_at (self, FALSE);
+ mm_port_probe_set_result_at (self, FALSE);
mm_port_probe_set_result_qcdm (self, FALSE);
+ mm_port_probe_set_result_qmi (self, FALSE);
+ mm_port_probe_set_result_mbim (self, FALSE);
}
- /* If this is a port flagged as being an AT port, don't do any QCDM probing */
+ /* If this is a port flagged as being an AT port, don't do any other probing */
if (self->priv->maybe_at_primary || self->priv->maybe_at_secondary || self->priv->maybe_at_ppp) {
- mm_obj_dbg (self, "no QCDM probing in possible AT port");
+ mm_obj_dbg (self, "no QCDM/QMI/MBIM probing in possible AT port");
mm_port_probe_set_result_qcdm (self, FALSE);
+ mm_port_probe_set_result_qmi (self, FALSE);
+ mm_port_probe_set_result_mbim (self, FALSE);
}
- /* If this is a port flagged as being a QCDM port, don't do any AT probing */
+ /* If this is a port flagged as being a QCDM port, don't do any other probing */
if (self->priv->maybe_qcdm) {
- mm_obj_dbg (self, "no AT probing in possible QCDM port");
- mm_port_probe_set_result_at (self, FALSE);
+ mm_obj_dbg (self, "no AT/QMI/MBIM probing in possible QCDM port");
+ mm_port_probe_set_result_at (self, FALSE);
+ mm_port_probe_set_result_qmi (self, FALSE);
+ mm_port_probe_set_result_mbim (self, FALSE);
+ }
+
+ /* If this is a port flagged as being a QMI port, don't do any other probing */
+ if (self->priv->maybe_qmi) {
+ mm_obj_dbg (self, "no AT/QCDM/MBIM probing in possible QMI port");
+ mm_port_probe_set_result_at (self, FALSE);
+ mm_port_probe_set_result_qcdm (self, FALSE);
+ mm_port_probe_set_result_mbim (self, FALSE);
+ }
+
+ /* If this is a port flagged as being a MBIM port, don't do any other probing */
+ if (self->priv->maybe_mbim) {
+ mm_obj_dbg (self, "no AT/QCDM/QMI probing in possible MBIM port");
+ mm_port_probe_set_result_at (self, FALSE);
+ mm_port_probe_set_result_qcdm (self, FALSE);
+ mm_port_probe_set_result_qmi (self, FALSE);
}
/* Check if we already have the requested probing results.
@@ -1819,6 +1845,8 @@ set_property (GObject *object,
self->priv->maybe_at_secondary = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_AT_SECONDARY);
self->priv->maybe_at_ppp = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_AT_PPP);
self->priv->maybe_qcdm = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_QCDM);
+ self->priv->maybe_qmi = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_QMI);
+ self->priv->maybe_mbim = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_MBIM);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);