Commit Graph

226 Commits

Author SHA1 Message Date
Aleksander Morgado
692d076ba6 shared-qmi: implement reworked mode and capabilities management
This commit introduces several improvements and changes in the way
modes and capabilities are managed in QMI capable devices. It is
organized into a single commit, as all changes in all 6 operations
(load current capabilities, load supported capabilities, set current
capabilities, load supported modes, load current modes, set current
modes) are related one to the other (given that the same QMI commands
are used for both capabilities and mode management).

The primary change is related to which capabilities are reported as
supported for a given device. In the previous implementation we
allowed switching between every combination possible for GSM/UMTS+LTE,
CDMA/EVDO+LTE or GSM/UMTS+CDMA/EVDO+LTE devices. E.g. we would allow
"LTE only" and "GSM/UMTS only" capabilities for GSM/UMTS+LTE devices,
even if they would both be managed in exactly the same way. That setup
wasn't ideal, because it meant that switching to a "LTE only"
configuration would require a power cycle, as capability switching
requires a power cycle, even if no change was expected in the exposed
DBus interfaces (which is why we require the power cycle). So, instead
of allowing every possible capability combination, we use capability
switching logic exclusively for configuring GSM/UMTS+CDMA/EVDO devices
(regardless of whether it has LTE or not) to add or remove the
GSM/UMTS and CDMA/EVDO capabilities. E.g. for a GSM/UMTS+CDMA/EVDO+LTE
device we would allow 3 combinatios: "GSM/UMTS+LTE", "CDMA/EVDO+LTE"
and "GSM/UMTS+CDMA/EVDO+LTE".

The "GSM/UMTS+CDMA/EVDO+LTE" is a special case because for this one we
allow switching to "LTE only" capabilities while we forbid switching
to "4G only" mode. As the same commands are used for mode and
capability switching, if we didn't have "LTE only" and we allowed "4G
only" mode instead and rebooted the device, we would end up not being
able to know which other capabilities (GSM/UMTS or CDMA/EVDO or both)
were also enabled.

Now that we have capability switching confined to a very subset of
combinations, we can use the mode switching logic to e.g. allow "4G
only" configurations in all non multimode devices, as well as masks of
allowed modes with one being preferred, which we didn't allow before.
In the previous implementation all mode switching logic was disabled
for LTE capable QMI devices. In the new implementation, we use the
"Acquisition Order Preference" TLV in NAS Set System Selection
Preference to define the full list of mode preferences for all
supported modes.

We also no longer just assume that NAS Technology Preference is always
available and NAS System Selection Preference only after NAS >= 1.1.
This logic is flawed, instead we're going to probe for those features
once when loading current capabilities, and we then just implement the
capabilities/mode switching logic based on that.
2018-09-12 17:25:19 +00:00
Aleksander Morgado
f6a2d01c7e build: require libqmi 1.21.3 with QMI LOC support 2018-08-21 13:26:08 +00:00
Ben Chan
2773475f43 build: require libmbim 1.17.3
libmbim 1.17.3 adds the support for MBIM_CID_PCO, which is used by
commit d68078b2ce ("broadband-modem-mbim: check if modem implements
MBIM_CID_PCO").
2018-08-09 13:37:05 +02:00
Aleksander Morgado
518d62e731 helpers-qmi: fix UMTS band 6 and 19 definitions
Also bump required libqmi version, as this change uses flags from the
latest available API.

UMTS B19 is NTT DoCoMo's 800MHz band.
UMTS B6  is NTT DoCoMo's 850MHz band
2018-08-08 18:39:32 +00:00
Ben Chan
1990d9e982 modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError
Commit 2a97e39cdd in libmim ("libmbim-glib: add additional cause codes
to MbimNwError") added additional cause codes to MbimNwError. This
patch maps some of those MbimNwError to MMMobileEquipmentError.

This patch requires libmbim >= 1.17.1
2018-06-02 18:25:57 +02:00
Aleksander Morgado
b4748ba674 build: post release version bump to 1.9.0 2018-06-02 17:46:48 +02:00
Aleksander Morgado
c187c5fef5 release: bump version to 1.8.0 2018-06-02 17:33:53 +02:00
Aleksander Morgado
c9dee2b960 build: bump version to 1.7.991 (1.8-rc2) 2018-03-27 13:27:27 +02:00
Aleksander Morgado
223b754fcc build: bump version to 1.7.990 (1.8-rc1) 2018-01-21 22:56:53 +01:00
Aleksander Morgado
c5c9ab279d build: require libmbim 1.16.0 2018-01-20 15:39:26 +01:00
Aleksander Morgado
fbd1780e60 build: require libqmi 1.20.0 2018-01-20 15:39:26 +01:00
Eric Caruso
098c4c0271 mm-broadband-modem-qmi: reprobe on qmi-proxy death
This allows us to reprobe the modem and respawn the
qmi-proxy in case it dies on us. This gets us access
to the modem and unsolicited notifications again. Do
this by connecting to the device-removed signal on
QmiDevice.

---
Rebased on top of git master by
Aleksander Morgado <aleksander@aleksander.es>
2017-10-22 11:53:32 +02:00
Aleksander Morgado
984625165e i18n: deprecate intltool and use only gettext 0.19.8
Instead of mixing both intltool and gettext, which not always work
correctly together, this patch obsoletes intltool and uses only
gettext, which includes support for translating XML files with ITS
rules.

See migration steps for GNOME projects here:
  https://wiki.gnome.org/MigratingFromIntltoolToGettext

The gettext ITS rules for polkit policy files are imported from the
upstream polkit repository. We don't use the polkit-installed rule
files yet because there is no tagged release that contains those files
yet, so we cannot build-depend on any specific polkit version.
  https://bugs.freedesktop.org/show_bug.cgi?id=96940
2017-09-07 13:04:34 +02:00
Aleksander Morgado
4d6896f0d9 build: rename --with-suspend-resume to --with-systemd-suspend-resume
And only define WITH_SYSTEMD_SUSPEND_RESUME when enabled.

We already have other systemd specific features under the
--with-systemd-* name scheme, so consolidate that, given that we don't
have any other method to support suspend/resume notifications.
2017-06-22 10:51:40 +02:00
Aleksander Morgado
341555504e build: only define WITH_SYSTEMD_JOURNAL if enabled 2017-06-22 10:40:58 +02:00
Aleksander Morgado
acf36f2ae0 build: only define WITH_POLKIT if enabled 2017-06-22 10:26:12 +02:00
Torsten Hilbrich
fd0bed1df9 log: Add support for journal logging
This logging is available if the software was build with the configure
option --with-systemd-journal.

It will be enabled by default if libsystemd is found.

The runtime parameter --log-journal enables to output of log messages
to the systemd journal.

Please note that the journal priority field has the same value as the
syslog level so no conversion is required here.
2017-06-21 13:08:17 +02:00
Aleksander Morgado
957195469e build: bump libqmi required version to 1.17.900
Since we process the WDS Event Report Indication messages, we need
libqmi from git master, so we bump the required version to the first
tag that contains those QMI messages.
2017-03-13 09:55:06 +01:00
Aleksander Morgado
40e6fa48c4 build: make sure subdir exists before running glib-mkenums
Reported-by: Colin Helliwell <colin.helliwell@ln-systems.com>
2017-02-28 10:59:46 +01:00
Sam Spilsbury
a0b95db2b9 Makefile: Move to AM_DISTCHECK_CONFIGURE_FLAGS
Since automake 1.11.2 it is recommended that packages
use AM_DISTCHECK_CONFIGURE_FLAGS instead of
DISTCHECK_CONFIGURE_FLAGS as the latter is intended
to be a user variable.

https://bugs.freedesktop.org/show_bug.cgi?id=95826
2016-10-26 17:28:03 +02:00
Aleksander Morgado
af90506da4 build: disable GLib deprecation warnings until fully ported to GTask
Otherwise the build log is very very dense...

    ../../src/mm-broadband-modem-qmi.c: In function 'modem_load_own_numbers':
    ../../src/mm-broadband-modem-qmi.c:1406:5: warning: 'g_simple_async_result_new' is deprecated (declared at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:51): Use 'g_task_new' instead [-Wdeprecated-declarations]
         result = g_simple_async_result_new (G_OBJECT (self),
         ^
    ../../src/mm-broadband-modem.c: In function 'signal_quality_qcdm_ready':
    ../../src/mm-broadband-modem-mbim.c: In function 'modem_3gpp_scan_networks_finish':
    ../../src/mm-broadband-modem.c:1986:9: warning: 'g_simple_async_result_take_error' is deprecated (declared at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:116) [-Wdeprecated-declarations]
             g_simple_async_result_take_error (ctx->result, error);
             ^
    ../../src/mm-broadband-modem-mbim.c:2824:5: warning: 'g_simple_async_result_propagate_error' is deprecated (declared at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:119) [-Wdeprecated-declarations]
         if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
         ^
2016-10-13 12:00:26 +02:00
Lubomir Rintel
6dc08a69ad build: limit the available glib functionality to the version we support
Otherwise we can accidentally use something that we ought not. Also,
there's deprecation warnings for stuff that's not deprecated in the
version we support yet:

  mm-modem-simple.c: In function 'mm_modem_simple_connect_finish':
  mm-modem-simple.c:117:5: warning: 'g_simple_async_result_propagate_error' is deprecated [-Wdeprecated-declarations]
       if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
       ^~
2016-10-12 10:45:28 +02:00
Aleksander Morgado
58c955f5f2 core: allow building and running without udev
Instead of relying on the udev daemon and GUDev to manage the devices reported
by the kernel, we can now run ModemManager relying solely on the kernel events
reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan'
option is implicit for the ModemManager daemon when udev is disabled in the
build.

Additionally, a new custom implementation of the kernel device object is
provided, which uses sysfs to load the properties and attributes required in
each kernel device, instead of using a GUdevDevice.

The udev rule files are kept in place, and a simple custom parser is provided
which preloads all rules in memory once and then applies them to the different
kernel objects reported via ReportKernelEvent(), e.g. to set port type hints.
A simple unit test setup is prepared to validate the udev rules during the
`check' Makefile target.
2016-09-29 15:43:05 +02:00
Aleksander Morgado
dce9f05673 build: post release version bump to 1.7.0 2016-07-26 13:27:37 +02:00
Aleksander Morgado
397761c975 release: bump version to 1.6.0 2016-07-26 13:07:49 +02:00
Aleksander Morgado
24fd3ef5fb examples: add SMS sender in python 2016-07-25 12:51:45 +02:00
Aleksander Morgado
d757c32b94 release: bump version to 1.5.993 (1.6-rc4) 2016-07-07 20:22:31 +02:00
Aleksander Morgado
f5cd7476f4 broadband-modem-mbim: try to use FCC Auth through QMI-over-MBIM if power up fails 2016-07-07 19:51:28 +02:00
Aleksander Morgado
59f57befa4 release: bump version to 1.5.992 (1.6-rc3) 2016-04-18 08:11:45 +02:00
Aleksander Morgado
1f13909d9b build: make '--with-suspend-resume' auto by default
If systemd is found, enable suspend resume support.
2016-04-03 21:54:19 +02:00
Aleksander Morgado
ae2988da93 build: use 'no' to disable suspend/resume support, instead of 'none' 2016-04-03 21:33:56 +02:00
Aleksander Morgado
0e5fdadcd3 build: use 'no' to disable polkit, instead of 'none' 2016-04-03 21:33:50 +02:00
Aleksander Morgado
d6cee7782b release: bump version to 1.5.991 (1.6-rc2) 2016-03-25 11:15:14 +01:00
poma
6197a06931 UPower signaling obsolescence
"Newer upower versions no longer emit that signal since this handled by systemd."
by Michael Biebl <mbiebl@gmail.org>
https://lists.freedesktop.org/archives/devkit-devel/2014-March/001575.html

See also "Plans for UPower 1.0"
by Richard Hughes <hughsient@gmail.com>
https://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html

Signed-off-by: poma <pomidorabelisima@gmail.com>
2016-03-21 23:44:51 +01:00
Aleksander Morgado
6512fde74d build: fix missing MMCLI_LIBS variable 2016-03-21 11:14:25 +01:00
Aleksander Morgado
07f899a9d3 release: bump version to 1.5.900 (1.6-rc1)
Also bump soname of libmm-glib, as the interface has grown since the last tag.
2016-03-18 12:56:08 +01:00
Aleksander Morgado
c6dda5e502 build: require libmbim 1.12 and libqmi 1.14
Preparing for the new ModemManager stable release, we now require the latest
stable series of both libmbim and libqmi.
2016-03-18 11:36:52 +01:00
Aleksander Morgado
e00fd54a20 build: bump required gettext version to 0.19.3
Otherwise:
    configure.ac:86: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
    configure.ac:86: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
    configure.ac:86: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
2016-03-13 17:39:20 +01:00
Aleksander Morgado
9cbd0c61b0 sim-qmi: implement SIM verify/unblock/change/enable with UIM service
Newer modems like the MC7455 don't implement the "DMS UIM" commands in the
DMS service, and therefore these modems need to use the UIM service directly.

We include a new flag to detect whether any of the DMS UIM commands is flagged
as invalid, and if so, we'll fallback to the UIM specific implementations for
all.

libqmi version bump to 1.13.7, which includes the new required methods.
2016-02-11 10:51:53 +01:00
Aleksander Morgado
f8ba106a20 port-qmi: support new Qualcomm chipsets working always in raw-ip
The port opening logic is changed completely.

Before this change, the logic would only try 802.3 setting via CTL when the
QmiDevice was being open.

With this new change, instead, we'll use WDA and the new libqmi APIs to query
the link layer protocol expected by both the device and the kernel. If the LLP
matches in both, we assume we're done; if they differ we'll try to update the
LLP expected by the kernel to the one setup in WDA. This change will allow us
to run with the modem using raw-ip if that is what WDA reports by default.

Also bumped the libqmi version to 1.13.6, which has support for the new required
APIs.
2016-01-24 17:23:18 +01:00
Aleksander Morgado
1bdb1a558a build: require GLib 2.36
We now need it for GTask support.
2016-01-24 15:26:12 +01:00
Aleksander Morgado
30cbf7202c build: on configure errors, show the specific libqmi or libmbim version required 2015-10-25 15:48:42 +01:00
Aleksander Morgado
35ab3dedd6 sim-qmi: try to gather from the optional TLV whether MNC is 2 or 3 digits
We bump libqmi requiremetn to 1.13.5, which is the one with support for the new TLV.
2015-10-25 15:48:42 +01:00
Aleksander Morgado
d5adce08f5 build: only compile dbus tests if GIO >= 2.34 is available 2015-04-17 09:58:24 +02:00
Aleksander Morgado
de9446e13b build: refactor and cleanup configure.ac 2015-02-26 10:37:23 +01:00
Aleksander Morgado
9f7006616c build: disable static libraries by default 2015-02-26 10:37:23 +01:00
Aleksander Morgado
ee41e57507 build: setup silent-rules
And bump automake requirement to 1.11.
2015-02-26 10:37:23 +01:00
Aleksander Morgado
a83d1c70b1 broadband-modem-qmi: use 'DMS Set FCC Authentication' if online mode fails
Some new devices, like the Dell DW5770, will return an internal error when
trying to bring the power mode to online. We can avoid this by sending the
magic "DMS Set FCC Auth" message before retrying.

Bumping libqmi version to 1.13.4, which is the one that supports this new
message.

https://bugzilla.kernel.org/show_bug.cgi?id=92101
2015-02-07 21:39:15 +01:00
Aleksander Morgado
b6f8e5f08d suspend: invalidate and remove modems on suspend, reprobe on resume 2015-02-07 12:57:48 +01:00
Aleksander Morgado
a92b6f286b suspend: imported suspend/resume support from NetworkManager
We're going to make this optional during build, not mandatory as was the case
in NM.
2015-02-07 12:57:48 +01:00