Commit Graph

6079 Commits

Author SHA1 Message Date
Aleksander Morgado
5ef3c8eeb1 dell,dw5821e: firmware update support only if QMI is enabled 2019-03-13 10:57:43 +01:00
Aleksander Morgado
efcbdd9144 broadband-modem: reorder voice properties after messaging properties 2019-03-03 22:35:20 +01:00
Daniele Palmas
c7be4af542 telit: add Telit MBIM broadband modem
Modes and band support are added through AT commands.
2019-02-28 16:09:10 +01:00
Daniele Palmas
3921c120b3 telit: move shared functions to mm-shared-telit 2019-02-28 15:42:28 +01:00
Aleksander Morgado
1093c124b4 dell,dw5821e: use DMS extension method to load properly formatted firmware version
And require libqmi 1.23.1.
2019-02-26 23:57:29 +01:00
Daniele Palmas
301bdcfef7 port-qmi: increase qmi_device_open retries
Telit modems LM940/960 need more time for becoming responsive
to qmi requests after device appearance.
2019-02-22 13:44:29 +01:00
Beniamino Galvani
35d84ac840 broadband-modem-qmi: log reason of QMI port open failure
If ModemManager fails to open a QMI port with data format update, it
retries without update. It would be useful to log the reason why the
first try failed; for example on RHEL 7.6 ModemManager fails to write
to sysfs due to SELinux. With this commit, the following message would
be logged:

 <debug> QMI port open operation finished
 <debug> Couldn't open QMI port with data format update: Expected data
 format not updated properly: Failed to open file
 '/sys/class/net/wwp0s29u1u2i8/qmi/raw_ip' for R/W: Permission denied
 <debug> Opening QMI device...

instead of just:

 <debug> QMI port open operation finished
 <debug> Opening QMI device...

While at it, also fix the GError leak.
2019-02-15 15:03:35 +01:00
Eric Caruso
bf0b5a07ca Add .gitlab-ci.yml
This allows us to run unit tests on every commit to the gitlab
instance.
2019-02-14 13:31:58 -08:00
scootergrisen
94e14d7cfc po: add Danish translation
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/68
2019-02-11 17:26:21 +01:00
Aleksander Morgado
de81520c43 cli: report modem removal in --monitor-state
If the modem ends up not being managed by ModemManager, detect it
during the '--monitor-state' mmcli operation and report it.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/106
2019-02-11 15:08:09 +01:00
Aleksander Morgado
0f6f89801e ublox: fix parser to report only bands supported by the module
We were filtering the 4G bands supported by the module when parsing
+UBANDSEL responses, e.g. so that we would not reply unsupported bands
for a given ubandsel value.

But we need the same filtering in 2G and 3G bands, because for example
some modules may support a specific 4G band with a given ubandsel
value, but NOT the associated 3G band. E.g. the TOBY-R200 supports
EUTRAN-4 but not UTRAN-4.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
278a72643a ublox,tests: fix R-200 UBANDSEL response tester 2019-01-30 12:10:03 +01:00
Aleksander Morgado
74bdc97b34 ublox: use fixed array sizes when iterating 2019-01-30 12:10:03 +01:00
Aleksander Morgado
8b9053822b ublox: fix loop looking for a specific 4g band value
We cannot have the ubandsel value comparision inside the for(;;) stop
conditions, because that would mean the loop would stop whenever the
comparison fails. We want to look for a value, so we need to loop the
whole array and stop once we find it only.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
36b5e1ee20 ublox: the whole list of supported bands is known
So, assert() if for any reason we're asking to use a band that we
don't find in the list.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
fec1c43f80 ublox: don't create array with totally unrelated size 2019-01-30 12:10:03 +01:00
Aleksander Morgado
de5b9e441f ublox: coding style fixes 2019-01-30 12:10:03 +01:00
Aleksander Morgado
d8cf219644 ublox,helpers: remove unit tests for supported bands
We're hardcoding the supported bands for each u-blox model, so there
really is no point in having unit tests for them.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
437fb830c8 ublox,helpers: assume all SARA/LARA devices require COPS 2019-01-30 12:10:03 +01:00
Aleksander Morgado
ea01ac73e2 ublox: COPS based registration requests with 120s AT command timeout 2019-01-30 12:10:03 +01:00
Aleksander Morgado
1d7f2c1a61 ublox: initial power state logic only required when CFUN used
When we're changing modes or bands, we only need to keep track of the
initial power state when CFUN=4/CFUN=1 based logic is used. When using
COPS, we do not need to track initial power state or recover it after
the operation.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
d12b919787 ublox,helpers: fix missing ubandsel support initializations 2019-01-30 12:10:03 +01:00
Aleksander Morgado
b1d69a69f9 ublox,helpers: rename enum
We're not going to use CFUN/COPS just for bands, but also for modes,
so use more generic names.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
308d9e4ddb ublox: fix band setting operation
If both UBANDSEL and UACT are unsupported, we were not initializing
the command variable.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
2677524f6a ublox: fix current bands loading completion
If both UACT and UBANDSEL are unsupported, the async operation was
never completed.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
c3f4fe063f ublox: rework support config loading
Make mm_ublox_get_support_config() return FALSE only when GError is
set. And also, prepare a preload_support_config() method to be run
before using any information from the support configuration (i.e.
don't do it in load_supported_bands(), do it in load_current_bands()
or in set_current_bands().
2019-01-30 12:10:03 +01:00
Aleksander Morgado
f2e3798bb3 ublox: really subclass register_in_network()
The implemented register_in_network() was totally unused.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
755964c9eb ublox: fix missing return in method definition
acquire_power_operation (MMBroadbandModemUblox  *self,
     ^~~~~~~~~~~~~~~~~~~~~~~
    ublox/mm-broadband-modem-ublox.c:74:1: error: no previous prototype for ‘acquire_power_operation’ [-Werror=missing-prototypes]
2019-01-30 12:10:03 +01:00
Aleksander Morgado
421b5e48e0 ublox,helpers: remove unused variable
ublox/mm-modem-helpers-ublox.c:1291:14: error: unused variable ‘found’ [-Werror=unused-variable]
         gboolean found;
                  ^~~~~
2019-01-30 12:10:03 +01:00
Aleksander Morgado
3575fe3528 ublox,helpers: fix mixed declarations and code
ublox/mm-modem-helpers-ublox.c:1298:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
       guint i, j, k;
       ^~~~~
2019-01-30 12:10:03 +01:00
Aleksander Morgado
4b507f3255 ublox: fix double task completion
If mm_ublox_get_supported_bands() and mm_ublox_get_support_config()
both failed, we would be completing the GTask twice. Fix it by
chaining both steps so that the second one is not run if the first one
is already failed.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
bbb96cd3f9 ublox: minor indentation fixes 2019-01-30 12:10:03 +01:00
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