summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2015-02-17 10:57:22 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-02-17 10:57:22 +0100
commit66af2b4424e05b9dba99a66660b834a08d4aaabe (patch)
treeac24c85a1a819e7f1ba3a460586f289137594d70
parent7958ac55dc54babfb797bc85d64bf44b951463f2 (diff)
downloadModemManager-aleksander/dell.tar.gz
plugin: add implicit QMI and MBIM forbidden drivers checkaleksander/dell
-rw-r--r--src/mm-plugin.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index 58a99405b..7a3986cc9 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -214,9 +214,20 @@ apply_pre_probing_filters (MMPlugin *self,
}
/* The plugin may specify that only some drivers are supported, or that some
- * drivers are not supported. If that is the case, filter by driver */
+ * drivers are not supported. If that is the case, filter by driver.
+ *
+ * The QMI and MBIM *forbidden* drivers filter is implicit. This is, if the
+ * plugin doesn't explicitly specify that QMI is allowed and we find a QMI
+ * port, the plugin will filter the device. Same for MBIM.
+ *
+ * The opposite, though, is not applicable. If the plugin specifies that QMI
+ * is allowed, we won't take that as a mandatory requirement to look for the
+ * QMI driver (as the plugin may handle non-QMI modems as well)
+ */
if (self->priv->drivers ||
- self->priv->forbidden_drivers) {
+ self->priv->forbidden_drivers ||
+ !self->priv->qmi ||
+ !self->priv->mbim) {
static const gchar *virtual_drivers [] = { "virtual", NULL };
const gchar **drivers;
@@ -271,6 +282,36 @@ apply_pre_probing_filters (MMPlugin *self,
}
}
}
+
+ /* Implicit filter for forbidden QMI driver */
+ if (!self->priv->qmi) {
+ guint j;
+
+ for (j = 0; drivers[j]; j++) {
+ /* If we match the QMI driver: unsupported */
+ if (g_str_equal (drivers[j], "qmi_wwan")) {
+ mm_dbg ("(%s) [%s] filtered by implicit QMI driver",
+ self->priv->name,
+ g_udev_device_get_name (port));
+ return TRUE;
+ }
+ }
+ }
+
+ /* Implicit filter for forbidden MBIM driver */
+ if (!self->priv->mbim) {
+ guint j;
+
+ for (j = 0; drivers[j]; j++) {
+ /* If we match the MBIM driver: unsupported */
+ if (g_str_equal (drivers[j], "cdc_mbim")) {
+ mm_dbg ("(%s) [%s] filtered by implicit MBIM driver",
+ self->priv->name,
+ g_udev_device_get_name (port));
+ return TRUE;
+ }
+ }
+ }
}
vendor = mm_device_get_vendor (device);