Commit Graph

7059 Commits

Author SHA1 Message Date
Aleksander Morgado
b77aa7ab0e location,agps: explicitly specify that MSA A-GPS is implemented
The A-GPS based implementations we currently have assume MSA A-GPS, so
rename the MMModemLocationSource enum value to reflect that.
2019-04-09 12:24:39 +00:00
Aleksander Morgado
619d2ce5ac cli,location: minor refactor to handle the location setup flags 2019-04-09 12:24:39 +00:00
Ben Chan
79df43f0d7 broadband-modem: remove unused CallManagerStateContext defintion 2019-04-09 11:11:54 +00:00
Ben Chan
49f391b10d altair-lte: remove unused fields in DetailedDisconnectContext 2019-04-08 13:30:14 -07:00
Aleksander Morgado
210dc0be47 plugins,dell: port type hints for the DW5820e module 2019-04-08 12:45:28 +02:00
Ben Chan
9dac5ece77 build: make compiler warning options compatible with clang
This patch updates m4/compiler-warnings.m4 as follows to make it more
compatible with clang:

* clang doesn't support -Wunused-but-set-variable, which can be replaced
  with -Wunused-variable as the latter covers unused variables with or
  without an assigned value and is supported by gcc and clang.

* -Wno-unused-function is added to let clang ignore unused functions that
  are auto-generated.
2019-04-05 08:02:14 +00:00
Ben Chan
7f78ef5010 via: fix memory leak in parent_setup_registration_checks_ready
This patch fixes a potential memory leak in
parent_setup_registration_checks_ready() where the allocated
SetupRegistrationChecksResults may be leaked when the MMIfaceModemCdma
parent's setup_registration_checks() fails.
2019-04-03 10:57:14 -07:00
Ben Chan
84fe52a1e6 modem-helpers: fix memory leak in mm_3gpp_parse_pdu_cmgl_response
This patch fixes a potential memory leak in
mm_3gpp_parse_pdu_cmgl_response() where the allocated MM3gppPduInfo may
be leaked when failing to parse the +CMGL response.
2019-04-03 10:53:01 -07:00
Sven Schwermer
7e4a8d9566 ublox: add LISA/SARA-U2 alternative port types
When configuring these modems with AT+UUSBCONF=2, i.e. CDC-ECM + 4x
CDC-ACM, they also enumerate with a different PID on the USB. We need to
adjust the udev rules for that case in order to ignore the non-AT ports.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-04-03 13:17:19 +02:00
Dan Williams
1c14ca7262 libwmc: remove it
The WMC protocol was only present on older Panasonic/Verizon devices
from the 2006 - 2011 timeframe. The last device to support WMC was
the UML290 which also supported QMI (which is much more functional).
ModemManager also never used WMC support and it was never significantly
reverse engineered.

So remove WMC code from git; it'll still be in the history if anyone
cares in the future.
2019-04-02 11:20:11 -05:00
Dan Williams
88fac7f14a build: fix -Wunused-but-set-variable support and handle clang better
By default the build used -Wno-unused-but-set-variable but that's
clearly not what we want. Fix those problems.

When using clang, the compiler doesn't error on unknown compile
options, so let's add -Werror to the checking too.

CC='clang'
configure:3408: checking for gcc
configure:3435: result: clang
...
configure:17644: checking whether gcc understands -Wno-unused-but-set-variable
configure:17657: clang -c -Wall -std=gnu89 -g -O2 -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wstrict-prototypes -Wno-unused-parameter -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-but-set-variable  conftest.c >&5
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
1 warning generated.
configure:17657: $? = 0
configure:17666: result: yes

Reported-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
2019-04-02 10:48:40 -05:00
Aleksander Morgado
093174c84d shared-qmi: always use newest carrier config if more than one found 2019-04-02 12:14:03 +02:00
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