Commit Graph

7297 Commits

Author SHA1 Message Date
Mark-Jablonsky
c1aa658802 ublox: add band detection support for additional modems
The u-blox plugin was originally written to support the TOBY-L4 only.
This caused issues with mmcli reporting the correct supported and
current bands because the logic was based only for the TOBY-L4 and
the AT commands used in the implementaion are only supported by
a couple of modems.

There is now a hard-coded modem list that contains the supported bands
and the supported modes. A hard-coded list was chosen over a logic
based list because ublox modems only report the frequency of the bands
they support in the current mode they are in. For further justification,
the reported frequency could relate to multiple bands that are not all
supported by the modem, and not all the supported bands are always caught
depending on the mode the modem is in (e.g. 2G, 3G, 4G). The only
realiable way to retrieve the correct supported bands is to have the list
hard-coded. Based off of the modem, the code chooses whether it is
appropriate to issue +UACT or +UBANDSEL to retrieve the current bands list.
Additionally, the appropriate AT command of +CFUN=4 or +COPS=2 is chosen
to detach from the network when the mmcli --set-current-bands command is
issued. The new setup also adds a header file that contains the modem list.
This should make adding support for future additional modems easier as long
as future modems stick to the same AT command interface that is currently
supported by the plugin.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
2d80dbfbfe build: post release version bump to 1.11.0 2019-01-17 16:37:19 +01:00
Aleksander Morgado
9268d4f9ef release: bump version to 1.10.0 2019-01-17 16:14:25 +01:00
Aleksander Morgado
f49f325715 libmm-glib,firmware-update-settings: skip dictionary if method is NONE
No need to process the detailed dictionary if no explicit method is
reported as supported. Avoids unnecessary warnings:

  $ mmcli -m 1 --firmware-status
  ** (mmcli:6887): WARNING **: 15:52:54.664: Invalid initial update settings: Missing required 'device-ids' setting
  error: firmware status unsupported
2019-01-16 15:56:59 +01:00
Aleksander Morgado
6dd8876124 NEWS: update for MM 1.10 2019-01-16 10:15:07 +01:00
Aleksander Morgado
5123add860 api,doc: add note about when each modem interface is available 2019-01-15 15:40:10 +01:00
Aleksander Morgado
478a076d30 libmm-glib,manager: use g_async_initable_new_finish() explicitly
We're running g_async_initable_new_async() ourselves in
mm_manager_new(), so our finish() method should call
g_async_initable_new_finish() explicitly.

There's no change in the logic here, as the generated
mm_gdbus_object_manager_client_new_finish() was already doing this
implicitly.
2019-01-13 18:11:41 +01:00
Aleksander Morgado
495a466aaa libmm-glib,manager: simplify object creation
The G_OBJECT() casts accept NULL safely.
2019-01-13 18:02:22 +01:00
Aleksander Morgado
3eb3854fcb libmm-glib,manager: cleanup internal proxy on name owner updates
The MMManager object keeps an internal proxy object for the Manager
interface, and we must make sure we cleanup this object any time the MM
daemon is restarted. Otherwise, the MMManager may end up trying to use
a stale proxy associated to a previous run of the daemon, and e.g. not
showing properly the runtime version info.

E.g., in this sequence with the example python tester, the runtime
version of the daemon was valid only for the first time the daemon
runs, and if the daemon is restarted, mm_manager_get_version()
would keep returning NULL.

    $ ./modem-watcher-python
    [ModemWatcher] ModemManager service not available in bus
    [ModemWatcher] ModemManager 1.9.990 service is available in bus
    [ModemWatcher] Dell Inc. (DW5821e Snapdragon X20 LTE) modem managed by ModemManager [None]: /org/freedesktop/ModemManager1/Modem/0
    [ModemWatcher] ModemManager service not available in bus
    [ModemWatcher] ModemManager None service is available in bus
    [ModemWatcher] Dell Inc. (DW5821e Snapdragon X20 LTE) modem managed by ModemManager [None]: /org/freedesktop/ModemManager1/Modem/0
    [ModemWatcher] ModemManager service not available in bus
    [ModemWatcher] ModemManager None service is available in bus
    [ModemWatcher] Dell Inc. (DW5821e Snapdragon X20 LTE) modem managed by ModemManager [None]: /org/freedesktop/ModemManager1/Modem/0
2019-01-13 18:01:54 +01:00
Aleksander Morgado
479590412e examples,watcher: print runtime MM version 2019-01-13 17:36:14 +01:00
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
Aleksander Morgado
0f58888808 cli,firmware: fix reporting fastboot AT command
The update method is a bitmask, so check for the flag.
2019-01-12 16:09:24 +01:00
Aleksander Morgado
3ba89881cc cli,firmware: fix reporting firmware update methods in key-value output
It's a bitmask, so we report a list of strings.
2019-01-12 16:09:24 +01:00
Aleksander Morgado
251ca4a847 build: update copyright years to 2019 2019-01-11 15:57:36 +01:00
Aleksander Morgado
5869efff72 man,mmcli: update for MM 1.10 2019-01-11 15:54:14 +01:00
Aleksander Morgado
4ae62ace7f build: bump version to 1.9.990 (1.10-rc1) 2019-01-08 15:49:55 +01:00
Aleksander Morgado
86c0ed814a api,firmware: fix html generation 2019-01-08 15:49:55 +01:00
Aleksander Morgado
e826a24e44 build: require libmbim 1.18.0 and libqmi 1.22.0 2019-01-08 15:35:16 +01:00
Aleksander Morgado
09c5ac061b mmcli,modem: new --inhibit action on the modem object
Modem device inhibition is really a manager action for which we
provide the full modem device 'uid'.

This new operation allows to perform device inhibition using the modem
object as reference, which is more handy than first looking at the
device 'uid' and then running the manager action.

    $ sudo mmcli -m 0 --inhibit
    successfully inhibited device with uid '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2'
    type Ctrl+C to abort this program and remove the inhibition
    ^C cancelling the operation...
    successfully uninhibited device with uid '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2'
2019-01-03 21:05:58 +01:00
Aleksander Morgado
2212d3e054 api,manager: new InhibitDevice() method
This new method allows users of the ModemManager API to take full
control of a given device.

Unlike other operations in the API, the inhibition is maintained as
long as the caller exists in the bus, or until the same caller
uninhibits the device.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/98
2019-01-03 21:05:58 +01:00
Aleksander Morgado
e3766aef5d dell,dw5821e: also report QMI PDC based update available 2019-01-03 18:53:52 +00:00
Aleksander Morgado
87712c27f5 api,firmware: MMModemFirmwareUpdateMethod as flags, not enum
Devices may require/support more than one update method, so instead of
reporting the method as a single enum value, use a set of flags
instead.
2019-01-03 18:53:52 +00:00
Aleksander Morgado
f35d64a899 api,firmware: expose firmware version 2019-01-03 18:53:52 +00:00
Aleksander Morgado
67b3b830c8 api,firmware: expose device ids 2019-01-03 18:53:52 +00:00
Aleksander Morgado
bc39201f76 kerneldevice: allow loading device revision 2019-01-03 18:53:52 +00:00
Aleksander Morgado
dcd49dee88 mmcli,firmware: avoid empty output if firmware status unsupported 2019-01-03 18:53:52 +00:00
Aleksander Morgado
f69098819b iface-modem-firmware: List() and Select() are now optional
Since the Firmware interface now contains more actions and properties
apart from List() and Select(), these two actions are now optional.

Not all modems implementing the Firmware interface must implement
these two methods.
2019-01-03 18:53:52 +00:00
Aleksander Morgado
fc02b1320c quectel: report fastboot-based firmware update method and settings
We'll check for AT+QFASTBOOT support during runtime.
2019-01-03 18:53:52 +00:00
Aleksander Morgado
4b21546f53 dell,dw5821e: report fastboot-based firmware update method and settings
The DW5821e uses the AT^FASTBOOT command to reset the module in
fastboot mode, ready to download new firmware.

Note: we cannot use AT^FASTBOOT=? to query for support, as that
command also triggers the reset :/
2019-01-03 18:53:52 +00:00
Aleksander Morgado
3c7437d791 iface-modem-firmware: make the interface always available
We no longer "check for support" of this interface, it will always be
available for all modem objects.

The only implementation that used this interface was the QMI one, and
only for a very small subset of devices (those supporting the "QMI DMS
List Stored Images" operation). The logic was changed so that the list
of stored images wasn't preloaded during the support check; it will
now instead be preloaded during the first call to List().
2019-01-03 18:53:52 +00:00
Aleksander Morgado
8e342cf120 api,firmware: new UpdateSettings property 2019-01-03 18:53:52 +00:00
Aleksander Morgado
edf8d34939 api,firmware: remove unimplemented Install() method details 2019-01-03 18:53:52 +00:00
Aleksander Morgado
55c3026643 api: deprecate 'number' in bearer properties
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/99
2019-01-03 16:42:18 +00:00
Aleksander Morgado
5dc79ce606 libmm-glib: add autoptr cleanup functions for all types
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/100
2019-01-03 16:40:47 +00:00
Khem Raj
2b18af89b4 Do not pass null string to %s printf formatted string
Here the string is already decided to be NULL and passing
a null pointer to %s will not work

Fixes
error: '%s' directive argument is null

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-12-18 23:30:10 -08:00
Aleksander Morgado
ef942ca564 iface-modem-firmware: fix reporting empty firmware list
ModemManager[2804]: <warn>  [1545055222.508649] No valid firmware images listed. Assuming firmware unsupported.
    ModemManager[2804]: <debug> [1545055222.508665] firmware list loading failed: unsupported
    ModemManager[2804]: <debug> [1545055222.508683] Couldn't load firmware image list: firmware list unknown
    ModemManager[2804]: <debug> [1545055222.508728] Couldn't load current firmware image: current firmware unknown

    (ModemManager:2804): GLib-CRITICAL **: 15:00:22.508: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed

    Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap.
    0x00007ffff75b39b6 in ?? () from /usr/lib/libglib-2.0.so.0
    (gdb) bt
    #0  0x00007ffff75b39b6 in  () at /usr/lib/libglib-2.0.so.0
    #1  0x00007ffff75b4363 in g_logv () at /usr/lib/libglib-2.0.so.0
    #2  0x00007ffff75b4560 in g_log () at /usr/lib/libglib-2.0.so.0
    #3  0x00007ffff758867d in g_variant_builder_end () at /usr/lib/libglib-2.0.so.0
    #4  0x00005555555e4d12 in load_current_ready (self=0x55555579c330, res=0x5555557388e0, ctx=0x5555557d6d80) at mm-iface-modem-firmware.c:84
    #5  0x00007ffff778f194 in  () at /usr/lib/libgio-2.0.so.0
    #6  0x00007ffff778f1c9 in  () at /usr/lib/libgio-2.0.so.0
    #7  0x00007ffff75c4271 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
    #8  0x00007ffff75c5f89 in  () at /usr/lib/libglib-2.0.so.0
    #9  0x00007ffff75c6f62 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
    #10 0x0000555555597aa0 in main (argc=2, argv=0x7fffffffe488) at main.c:181
2018-12-17 15:06:56 +01:00
Aleksander Morgado
85ac6f12f5 docs,libmm-glib: update copyright 2018-12-17 14:45:55 +01:00
Aleksander Morgado
1a14b687de ublox,tests: avoid using deprecated band symbols 2018-12-16 09:20:35 +01:00
Aleksander Morgado
7d9c7e0bf4 telit: avoid using deprecated band symbols 2018-12-16 09:20:25 +01:00
Aleksander Morgado
04720d0795 libmm-glib,modem-3gpp: add guards around deprecated symbols 2018-12-16 09:15:52 +01:00
Ben Chan
0d6e2dc9f5 altair-lte: use mm_autoptr instead of g_autoptr
commit 397faef3c5 ("mm-common-helpers: add mm_autoptr helpers for
GRegex and GMatchInfo") introduces mm_autoptr(), which implements
g_autoptr() that isn't available before glib 2.44. This patch fixes the
code to consistently uses mm_autoptr().
2018-12-13 10:48:21 +01:00
Bob Ham
1cee215f83 base-call: Increase incoming call timeout to ten seconds
The standard says a RING or CRING should be emitted whenever the
network sends an incoming call notification, which is nation-specific:

  "Interpretation of indications from the network to determine what
  constitutes a "ring" is defined by national regulations.  This
  result code should be repeated each time the network repeats the
  incoming call indication."  -- ITU-T Rec. V.250, p. 42

On the giffgaff (O2) network in the UK, a SIMCom SIM7100E modem emits
RING indicators every six seconds.  The current timeout is only five
seconds resulting in a stream of timed-out ModemManager call objects
whenever there is an incoming call.  To fix this, we increase the
timeout to ten seconds.
2018-12-12 17:05:42 +00:00
Bob Ham
318d453532 base-call: Fix in-call URC regex to match handler logic
The handler assumes the regex sub-expressions each have the same index
so they need to be within the same set of parentheses rather than each
individually parenthesised.  Without this fix, call state changes are
missed.
2018-12-12 11:13:02 +00:00
Aleksander Morgado
6d273839e9 docs,libmm-glib: add missing methods for the Version property 2018-12-10 13:23:54 +01:00
LiuQiFeng
26e269ec70 dell: support XMM-based devices 2018-12-10 13:13:53 +01:00
Aleksander Morgado
e198ec7f2a base-manager: load subsys/name once in device_added() 2018-12-09 10:02:18 +01:00
Bob Ham
e34699cc9e policy: Call method name should be SendDtmf rather than SendTone
The method on MMBaseCall is send_tone but the D-Bus method call is
SendDtmf.  Without this patch, calls return
org.freedesktop.DBus.Error.AccessDenied.
2018-12-07 16:47:43 +00:00
Aleksander Morgado
cae7377a61 iface-modem: always connect all method handlers, even in failed state
So that the returned error is much more descriptive.

E.g. instead of this:
    $ sudo mmcli -m 0 -e
    error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method Enable is not implemented on interface org.freedesktop.ModemManager1.Modem'
We'll get this:
    $ sudo mmcli -m 0 -e
    error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: modem in failed state'

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/96
2018-12-07 16:23:52 +00:00
Aleksander Morgado
27276bf862 iface-modem: remove redundant logic to update failed state
When the MMIfaceModem initialization returns with the SIM_NOT_INSERTED
error, the base logic is already updating the modem failed reason to
SIM_MISSING. There is no need to do that explicitly for the case where
SIM hot swap is supported.
2018-12-07 16:23:52 +00:00
Aleksander Morgado
f4941ede66 xmm,dell: add defaults for MBIM-derived objects
For subclasses of MMBroadbandModemMbim, also apply the same property
defaults. E.g. we want to avoid peridic signal quality polling and we
also want to report that SIM hot swap is supported.
2018-12-07 16:23:21 +00:00