aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-03-27 17:00:08 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-03-28 17:33:08 +0100
commitd6ac6508d95aeab49f7ed9a5fe225c7685107f73 (patch)
tree378e56357682db454fef373e12bf80fe51d6a7cc
parentb76dc134bf6bed78c0a83fdc12d2e1f66821148c (diff)
plugin: explicitly request QMI probing
Plugins which may support QMI ports need to explicitly request QMI probing in cdc-wdm devices. This should also avoid probing cdc-wdm ports when we know that the plugin doesn't support them (e.g. with Ericsson MBM devices). https://bugzilla.gnome.org/show_bug.cgi?id=696701
-rw-r--r--plugins/anydata/mm-plugin-anydata.c1
-rw-r--r--plugins/generic/mm-plugin-generic.c1
-rw-r--r--plugins/gobi/mm-plugin-gobi.c1
-rw-r--r--plugins/huawei/mm-plugin-huawei.c1
-rw-r--r--plugins/pantech/mm-plugin-pantech.c7
-rw-r--r--plugins/sierra/mm-plugin-sierra.c1
-rw-r--r--src/mm-plugin.c29
-rw-r--r--src/mm-plugin.h1
8 files changed, 37 insertions, 5 deletions
diff --git a/plugins/anydata/mm-plugin-anydata.c b/plugins/anydata/mm-plugin-anydata.c
index 1ae8f468..73df9e08 100644
--- a/plugins/anydata/mm-plugin-anydata.c
+++ b/plugins/anydata/mm-plugin-anydata.c
@@ -78,6 +78,7 @@ mm_plugin_create (void)
MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
NULL));
}
diff --git a/plugins/generic/mm-plugin-generic.c b/plugins/generic/mm-plugin-generic.c
index 1a48f033..33bee3dd 100644
--- a/plugins/generic/mm-plugin-generic.c
+++ b/plugins/generic/mm-plugin-generic.c
@@ -84,6 +84,7 @@ mm_plugin_create (void)
MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
NULL));
}
diff --git a/plugins/gobi/mm-plugin-gobi.c b/plugins/gobi/mm-plugin-gobi.c
index 6f2280d0..823b95db 100644
--- a/plugins/gobi/mm-plugin-gobi.c
+++ b/plugins/gobi/mm-plugin-gobi.c
@@ -77,6 +77,7 @@ mm_plugin_create (void)
MM_PLUGIN_ALLOWED_DRIVERS, drivers,
MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
NULL));
}
diff --git a/plugins/huawei/mm-plugin-huawei.c b/plugins/huawei/mm-plugin-huawei.c
index d24d989a..b7d2eaad 100644
--- a/plugins/huawei/mm-plugin-huawei.c
+++ b/plugins/huawei/mm-plugin-huawei.c
@@ -506,6 +506,7 @@ mm_plugin_create (void)
MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
MM_PLUGIN_CUSTOM_INIT, &custom_init,
NULL));
}
diff --git a/plugins/pantech/mm-plugin-pantech.c b/plugins/pantech/mm-plugin-pantech.c
index c50f435b..bd586a6f 100644
--- a/plugins/pantech/mm-plugin-pantech.c
+++ b/plugins/pantech/mm-plugin-pantech.c
@@ -96,11 +96,12 @@ mm_plugin_create (void)
return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_PANTECH,
- MM_PLUGIN_NAME, "Pantech",
+ MM_PLUGIN_NAME, "Pantech",
MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
- MM_PLUGIN_ALLOWED_AT, TRUE,
- MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_AT, TRUE,
+ MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
NULL));
}
diff --git a/plugins/sierra/mm-plugin-sierra.c b/plugins/sierra/mm-plugin-sierra.c
index 4bbf9ee8..dc7ae3b5 100644
--- a/plugins/sierra/mm-plugin-sierra.c
+++ b/plugins/sierra/mm-plugin-sierra.c
@@ -276,6 +276,7 @@ mm_plugin_create (void)
MM_PLUGIN_ALLOWED_DRIVERS, drivers,
MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_ALLOWED_QCDM, TRUE,
+ MM_PLUGIN_ALLOWED_QMI, TRUE,
MM_PLUGIN_CUSTOM_INIT, &custom_init,
MM_PLUGIN_ICERA_PROBE, TRUE,
MM_PLUGIN_REMOVE_ECHO, FALSE,
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index 55bee783..4b1ae8b0 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -76,6 +76,7 @@ struct _MMPluginPrivate {
gboolean at;
gboolean single_at;
gboolean qcdm;
+ gboolean qmi;
gboolean icera_probe;
MMPortProbeAtCommand *custom_at_probe;
guint64 send_delay;
@@ -103,6 +104,7 @@ enum {
PROP_ALLOWED_AT,
PROP_ALLOWED_SINGLE_AT,
PROP_ALLOWED_QCDM,
+ PROP_ALLOWED_QMI,
PROP_ICERA_PROBE,
PROP_ALLOWED_ICERA,
PROP_FORBIDDEN_ICERA,
@@ -703,10 +705,18 @@ mm_plugin_supports_port (MMPlugin *self,
probe_run_flags |= (MM_PORT_PROBE_AT | MM_PORT_PROBE_AT_ICERA);
} else {
/* cdc-wdm ports... */
- probe_run_flags = MM_PORT_PROBE_QMI;
+ probe_run_flags = self->priv->qmi ? MM_PORT_PROBE_QMI : MM_PORT_PROBE_NONE;
}
- g_assert (probe_run_flags != MM_PORT_PROBE_NONE);
+ /* If no explicit probing was required, just request to grab it without probing anything.
+ * This may happen, e.g. with cdc-wdm ports which do not need QMI probing. */
+ if (probe_run_flags == MM_PORT_PROBE_NONE) {
+ g_simple_async_result_set_op_res_gpointer (async_result,
+ GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_DEFER_UNTIL_SUGGESTED),
+ NULL);
+ g_simple_async_result_complete_in_idle (async_result);
+ goto out;
+ }
/* If a modem is already available and the plugin says that only one AT port is
* expected, check if we alredy got the single AT port. And if so, we know this
@@ -945,6 +955,10 @@ set_property (GObject *object,
/* Construct only */
self->priv->qcdm = g_value_get_boolean (value);
break;
+ case PROP_ALLOWED_QMI:
+ /* Construct only */
+ self->priv->qmi = g_value_get_boolean (value);
+ break;
case PROP_ICERA_PROBE:
/* Construct only */
self->priv->icera_probe = g_value_get_boolean (value);
@@ -1027,6 +1041,9 @@ get_property (GObject *object,
case PROP_ALLOWED_QCDM:
g_value_set_boolean (value, self->priv->qcdm);
break;
+ case PROP_ALLOWED_QMI:
+ g_value_set_boolean (value, self->priv->qmi);
+ break;
case PROP_ALLOWED_UDEV_TAGS:
g_value_set_boxed (value, self->priv->udev_tags);
break;
@@ -1219,6 +1236,14 @@ mm_plugin_class_init (MMPluginClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property
+ (object_class, PROP_ALLOWED_QMI,
+ g_param_spec_boolean (MM_PLUGIN_ALLOWED_QMI,
+ "Allowed QMI",
+ "Whether QMI ports are allowed in this plugin",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property
(object_class, PROP_ICERA_PROBE,
g_param_spec_boolean (MM_PLUGIN_ICERA_PROBE,
"Icera probe",
diff --git a/src/mm-plugin.h b/src/mm-plugin.h
index a423ceb0..37cac68d 100644
--- a/src/mm-plugin.h
+++ b/src/mm-plugin.h
@@ -52,6 +52,7 @@
#define MM_PLUGIN_ALLOWED_AT "allowed-at"
#define MM_PLUGIN_ALLOWED_SINGLE_AT "allowed-single-at"
#define MM_PLUGIN_ALLOWED_QCDM "allowed-qcdm"
+#define MM_PLUGIN_ALLOWED_QMI "allowed-qmi"
#define MM_PLUGIN_ICERA_PROBE "icera-probe"
#define MM_PLUGIN_ALLOWED_ICERA "allowed-icera"
#define MM_PLUGIN_FORBIDDEN_ICERA "forbidden-icera"