From d2544ac044aea6b24e2f60e71fb3c1291552a2f9 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 5 Sep 2014 08:47:30 +0200 Subject: base-modem: always grab ports marked as ignored Modems may expose ports that are either just not used (e.g. modems exposing more than 2 functional AT ports) or explicitly avoided (e.g. WWAN ports when we don't know how to use them). Those kind of ports are part of the modem, but not used by ModemManager. Still, ModemManager should list them in the list of ports available for the modem, with IGNORED type. --- src/mm-base-modem.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index faf391d7..84ecf8d2 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -202,8 +202,16 @@ mm_base_modem_grab_port (MMBaseModem *self, return FALSE; } + /* Explicitly ignored ports, grab them but explicitly flag them as ignored + * right away, all the same way (i.e. regardless of subsystem). */ + if (ptype == MM_PORT_TYPE_IGNORED) { + port = MM_PORT (g_object_new (MM_TYPE_PORT, + MM_PORT_DEVICE, name, + MM_PORT_TYPE, MM_PORT_TYPE_IGNORED, + NULL)); + } /* Serial ports... */ - if (g_str_equal (subsys, "tty")) { + else if (g_str_equal (subsys, "tty")) { if (ptype == MM_PORT_TYPE_QCDM) /* QCDM port */ port = MM_PORT (mm_port_serial_qcdm_new (name)); -- cgit v1.2.3-70-g09d2