Aleksander Morgado bb0820d012 port-mbim: do not clear the progress flag until really finished opening
When the MBIM port open involved transparently trying to open a QMI
device as well, we were clearing the progress flag before the full
operation had finished, and so the port could have been closed by
the time we really finish the open operation, leading to a crash:

    ModemManager[28824]: <info>  [1547386038.726136] (usbmisc/cdc-wdm3): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3'
    ModemManager[28824]: <info>  [1547386038.728084] (tty/ttyUSB0): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3'
    ModemManager[28824]: <info>  [1547386038.728738] (tty/ttyUSB1): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3'
    ModemManager[28824]: <info>  [1547386038.730769] (tty/ttyUSB2): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3'
    ModemManager[28824]: <info>  [1547386038.731256] (tty/ttyUSB3): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3'
    ModemManager[28824]: <debug> [1547386038.731301] Removing empty device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3'
    ModemManager[28824]: <debug> [1547386038.731445] (ttyUSB0) forced to close port
    ModemManager[28824]: <debug> [1547386038.731547] (ttyUSB1) forced to close port
    ModemManager[28824]: <debug> [1547386038.731638] (ttyUSB2) forced to close port
    ModemManager[28824]: <debug> [1547386038.731715] (ttyUSB3) forced to close port
    ModemManager[28824]: <debug> [1547386039.580136] [cdc-wdm3] error: couldn't open QmiDevice: MBIM error: Transaction timed out
    ModemManager[28824]: <info>  [1547386039.580190] [cdc-wdm3] MBIM device is not QMI capable
    **
    ERROR:mm-broadband-modem-mbim.c:2119:track_mbim_device_removed: assertion failed: (device)

    Thread 1 "ModemManager" received signal SIGABRT, Aborted.
    0x00007ffff7390d7f in raise () from /usr/lib/libc.so.6

    (gdb) bt
    #0  0x00007ffff7390d7f in raise () at /usr/lib/libc.so.6
    #1  0x00007ffff737b672 in abort () at /usr/lib/libc.so.6
    #2  0x00007ffff7559042 in  () at /usr/lib/libglib-2.0.so.0
    #3  0x00007ffff75865dc in g_assertion_message_expr () at /usr/lib/libglib-2.0.so.0
    #4  0x00005555556407f9 in track_mbim_device_removed (self=0x5555557a2830, mbim=0x5555557ea190) at mm-broadband-modem-mbim.c:2119
    #5  0x000055555564093e in mbim_port_open_ready (mbim=0x5555557ea190, res=0x55555573fcf0, task=0x5555557d29d0) at mm-broadband-modem-mbim.c:2161
    #6  0x00007ffff77742f4 in  () at /usr/lib/libgio-2.0.so.0
    #7  0x00007ffff7776cd7 in  () at /usr/lib/libgio-2.0.so.0
    #8  0x000055555565fcd5 in qmi_device_open_ready (dev=0x55555578f250, res=0x55555573fb50, task=0x55555573fcf0) at mm-port-mbim.c:191
    #9  0x00007ffff77742f4 in  () at /usr/lib/libgio-2.0.so.0
    #10 0x00007ffff7776cd7 in  () at /usr/lib/libgio-2.0.so.0
    #11 0x00007ffff7c03fe6 in open_version_info_ready (client_ctl=0x7fffe8010c20, res=0x555555739e80, task=0x55555573fb50) at qmi-device.c:2050
    #12 0x00007ffff77742f4 in  () at /usr/lib/libgio-2.0.so.0
    #13 0x00007ffff7776cd7 in  () at /usr/lib/libgio-2.0.so.0
    #14 0x00007ffff7c2034f in get_version_info_ready (device=0x55555578f250, res=0x5555557ea2a0, task=0x555555739e80) at qmi-ctl.c:3746
    #15 0x00007ffff778ebcf in g_simple_async_result_complete () at /usr/lib/libgio-2.0.so.0
    #16 0x00007ffff778ec5a in  () at /usr/lib/libgio-2.0.so.0
    #17 0x00007ffff75a98d1 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
    #18 0x00007ffff75ab5e9 in  () at /usr/lib/libglib-2.0.so.0
    #19 0x00007ffff75ac5c2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
    #20 0x0000555555599eb0 in main (argc=2, argv=0x7fffffffe4c8) at main.c:181
2019-01-13 14:41:57 +01:00
2013-08-14 13:30:35 +02:00
2018-10-27 10:09:51 +02:00
2017-09-07 13:45:57 +02:00
2013-08-14 15:43:28 +02:00
2017-09-07 13:45:57 +02:00
2018-06-02 17:33:53 +02:00
2018-01-25 09:52:12 +01:00

ModemManager.
ModemManager provides a unified high level API for communicating with mobile
broadband modems, regardless of the protocol used to communicate with the
actual device (Generic AT, vendor-specific AT, QCDM, QMI, MBIM...).

Using.
ModemManager is a system daemon and is not meant to be used directly from
the command line. However, since it provides a DBus API, it is possible to use
'dbus-send' commands or the new 'mmcli' command line interface to control it
from the terminal. The devices are queried from udev and automatically updated
based on hardware events, although a manual re-scan can also be requested to
look for RS232 modems.

Implementation.
ModemManager is a DBus system bus activated service (meaning it's started
automatically when a request arrives). It is written in C, using glib and gio.
Several GInterfaces specify different features that the modems support,
including the generic MMIfaceModem3gpp and MMIfaceModemCdma which provice basic
operations for 3GPP (GSM, UMTS, LTE) or CDMA (CDMA1x, EV-DO) modems. If a given
feature is not available in the modem, the specific interface will not be
exported in DBus.

Plugins.
Plugins are loaded on startup, and must implement the MMPlugin interface. It
consists of a couple of methods which tell the daemon whether the plugin
supports a port and to create custom MMBroadbandModem implementations. It most
likely makes sense to derive custom modem implementations from one of the
generic classes and just add (or override) operations which are not standard.
There are multiple fully working plugins in the plugins/ directory that can be
used as an example for writing new plugins. Writing new plugins is highly
encouraged! The plugin API is open for changes, so if you're writing a plugin
and need to add or change some public method, feel free to suggest it!

License.
The ModemManager and mmcli binaries are both GPLv2+.
The libmm-glib library is LGPLv2+.
S
Description
No description provided
Readme
19 MiB
Languages
C 98.6%
Meson 0.8%
Python 0.4%
Shell 0.2%