Commit Graph

7297 Commits

Author SHA1 Message Date
Aleksander Morgado
c09e8c8a2a shared-qmi: if requested config not installed, fallback to generic
If there is a known match for a specific config, but the config is not
available in the module, we should fallback to the generic
configuration.
2019-04-02 12:14:03 +02:00
Aleksander Morgado
0029f846cd shared-qmi: no active carrier config means default is in use
In addition to any installed MCFG file, the firmware itself as a
'default' config that will be selected when no carrier config is
installed.

So it is not an error if 'QMI PDC Get Selected Config' doesn't return
the 'Active ID' TLV, it just means the default one is selected.
2019-04-02 12:14:03 +02:00
Aleksander Morgado
52b67dc7c3 api,modem: new 'CarrierConfigurationRevision' property
Which reports the version of the currently active carrier
configuration.

We also update the firmware 'version' reported in the firmware
settings so that carrier-specific upgrades can be performed (e.g. when
the firmware stays the same but the MCFG is updated).
2019-04-02 12:14:03 +02:00
Aleksander Morgado
c479d036f7 firmware: export a device id containing the carrier info
In order to support different per-carrier upgrade paths in fwupd.
2019-04-02 12:14:03 +02:00
Aleksander Morgado
147facd2ec plugins,test: setup new simple keyfile tester 2019-04-02 12:14:03 +02:00
Aleksander Morgado
2719265cbd dell,dw5821e: install carrier config mapping 2019-04-02 12:14:03 +02:00
Aleksander Morgado
b4b6dc9e65 shared-qmi: implement QMI PDC based carrier config support
We implement both loading the current configuration in use, as well as
automatically switching to a different one if a mapping file is
available.
2019-04-02 12:14:03 +02:00
Aleksander Morgado
94cf7f0ceb iface-modem: new carrier config support
During initialization phase we will allow querying the modem for the
details of which carrier-specific configuration is being used, and
will expose a description string in the API.

In addition to showing the current configuration, we will also allow
automatically switching the configuration based on the SIM card
detected in the device. In order to allow this, plugins/modems will
need to provide the expected mapping between carrier config
description and MCCMNC. This mapping cannot be generic, because
different manufacturers may use different description strings.
2019-04-02 12:11:25 +02:00
Aleksander Morgado
b8daedd3c0 broadband-modem-mbim: static array to define used QMI services 2019-04-02 12:11:25 +02:00
Aleksander Morgado
51a5b628ad broadband-modem-qmi: static array to define used QMI services 2019-04-02 12:11:25 +02:00
Aleksander Morgado
8c053f637a dell,dw5821e: allow unmanaged GPS even when raw/nmea enabled
The raw/nmea GPS source setup is using QMI LOC operations, so there is
no point in disallowing the control of the unmanaged GPS source, as
the GPS data TTY is exclusively used for unmanaged GPS.
2019-04-02 08:40:26 +00:00
Aleksander Morgado
a0cb8b4dd5 iface-modem-location: allow enabling unmanaged gps even if raw/nmea enabled
But only if the plugin implementation allows to do so.
2019-04-02 08:40:26 +00:00
Aleksander Morgado
5bbcfa8318 base-manager: fix inhibition alloc/dealloc mixup 2019-04-02 00:46:05 +02:00
Ben Chan
43d454ab7f ublox: fix out-of-bounds array accesses
This patch fixes several invalid checks like this:

   array[i] && i < G_N_ELEMENTS (array)

which should instead be:

   i < G_N_ELEMENTS (array) && array[i]

to avoid an out-of-bounds access of the array.

Fixes: c1aa658802
2019-03-29 13:34:10 -07:00
Aleksander Morgado
0944e59252 ublox: parse +UGCNTRD stats as unsigned 64bit values
[1551646332.583651] (ttyACM2): --> 'AT+UGCNTRD<CR>'
  [1551646332.626567] (ttyACM2): <-- '<CR><LF>+UGCNTRD: 1,0,0,0,0<CR><LF><CR><LF>+UGCNTRD: 2,1397316870,113728263578,1397316870,113728263578<CR><LF><CR><LF>OK<CR><LF>'
  [1551646332.627120] Reloading stats failed: Couldn't load primary PDP context 2 statistics: Error parsing session RX bytes
2019-03-29 10:07:29 +00:00
Aleksander Morgado
7330f6d581 libmm-glib,common: new helper methods to read guint64 values
We use strtoull() to read a "unsigned long long" that is always at
least 64bits, even in 32bit systems.
2019-03-29 10:07:29 +00:00
Aleksander Morgado
0a5d638726 ci: run distcheck on default build 2019-03-13 13:35:17 +01:00
Aleksander Morgado
8fba3a2318 ci: include builds without qmi and/or without mbim 2019-03-13 11:20:56 +01:00
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