aboutsummaryrefslogtreecommitdiff
path: root/src/mm-port-probe.c
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 /src/mm-port-probe.c
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.
Diffstat (limited to 'src/mm-port-probe.c')
-rw-r--r--src/mm-port-probe.c46
1 files changed, 37 insertions, 9 deletions
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);