plugin: if no QMI or no MBIM still grab the WWAN ports, flagged as ignored

E.g. this would be the result when having ModemManager compiled without QMI
support, and a modem with 2 QMI/WWAN pairs:

    $ mmcli -m 2

    /org/freedesktop/ModemManager1/Modem/2 (device id '417e4dcff7f232b62cfe6c972e2099701848fd7f')
      -------------------------
      Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
               |          model: 'MC7304'
               |       revision: 'SWI9X15C_05.05.02.00 r19147 carmd-fwbuild1 2013/11/15 13:54:28'
               |      supported: 'gsm-umts'
               |        current: 'gsm-umts'
               |   equipment id: 'unknown'
      -------------------------
      System   |         device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7'
               |        drivers: 'qcserial, qmi_wwan'
               |         plugin: 'Gobi'
               |   primary port: 'ttyUSB8'
               |          ports: 'ttyUSB8 (at), wwp0s29u1u7i8 (unknown), ttyUSB6 (qcdm), wwp0s29u1u7i10 (unknown)'

The /dev/cdc-wdm ports don't even appear (as they were not even probed), but the
newly ignored WWAN ports do appear in the list, but flagged as UNKNOWN type
(instead of NET).
This commit is contained in:
Aleksander Morgado
2014-09-05 08:52:22 +02:00
parent d2544ac044
commit 8450e563bb

View File

@@ -869,20 +869,28 @@ mm_plugin_create_modem (MMPlugin *self,
else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET &&
g_str_equal (mm_device_utils_get_port_driver (mm_port_probe_peek_port (probe)),
"qmi_wwan")) {
grabbed = FALSE;
inner_error = g_error_new (MM_CORE_ERROR,
MM_CORE_ERROR_UNSUPPORTED,
"ignoring QMI net port");
/* Try to generically grab the port, but flagged as ignored */
grabbed = mm_base_modem_grab_port (modem,
mm_port_probe_get_port_subsys (probe),
mm_port_probe_get_port_name (probe),
mm_port_probe_get_parent_path (probe),
MM_PORT_TYPE_IGNORED,
MM_PORT_SERIAL_AT_FLAG_NONE,
&inner_error);
}
#endif
#if !defined WITH_MBIM
else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET &&
g_str_equal (mm_device_utils_get_port_driver (mm_port_probe_peek_port (probe)),
"cdc_mbim")) {
grabbed = FALSE;
inner_error = g_error_new (MM_CORE_ERROR,
MM_CORE_ERROR_UNSUPPORTED,
"ignoring MBIM net port");
/* Try to generically grab the port, but flagged as ignored */
grabbed = mm_base_modem_grab_port (modem,
mm_port_probe_get_port_subsys (probe),
mm_port_probe_get_port_name (probe),
mm_port_probe_get_parent_path (probe),
MM_PORT_TYPE_IGNORED,
MM_PORT_SERIAL_AT_FLAG_NONE,
&inner_error);
}
#endif
else if (MM_PLUGIN_GET_CLASS (self)->grab_port)