From 4ffa871228fa9b267f1647bf73238811e20e51b7 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 27 Dec 2012 06:48:23 +0100 Subject: [PATCH] zte: ignore net ports in non-Icera based modems Plain non-Icera ZTE modems will use ATD calls and PPP to establish the connection, so ignore 'net' ports that may be found in the way (e.g. when the modem is a QMI modem and we're not using QMI support). --- plugins/zte/mm-plugin-zte.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c index 75c879cf..da3cc06a 100644 --- a/plugins/zte/mm-plugin-zte.c +++ b/plugins/zte/mm-plugin-zte.c @@ -82,9 +82,20 @@ grab_port (MMPlugin *self, { GUdevDevice *port; MMAtPortFlag pflags = MM_AT_PORT_FLAG_NONE; + MMPortType ptype; port = mm_port_probe_peek_port (probe); + /* Ignore net ports on non-Icera modems */ + ptype = mm_port_probe_get_port_type (probe); + if (ptype == MM_PORT_TYPE_NET && !MM_IS_BROADBAND_MODEM_ZTE_ICERA (modem)) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Ignoring net port in non-Icera ZTE modem"); + return FALSE; + } + if (mm_port_probe_is_at (probe)) { /* Look for port type hints */ if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_MODEM")) @@ -103,7 +114,7 @@ grab_port (MMPlugin *self, return mm_base_modem_grab_port (modem, mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe), - mm_port_probe_get_port_type (probe), + ptype, pflags, error); }