diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-09-05 08:52:22 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-09-05 09:16:11 +0200 |
commit | 8450e563bb79bd1e300bba1d2e89c6d39a173694 (patch) | |
tree | 15534ceb9a8c9eca29c09ca09f52d125de953a5e | |
parent | d2544ac044aea6b24e2f60e71fb3c1291552a2f9 (diff) |
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).
-rw-r--r-- | src/mm-plugin.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index cbdf06d0..f1f3796e 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -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) |