libmbim 1.17.4 (commit 3eeaa4248b98 "ms-basic-connect-extensions: rename
service") added a MS prefix to the Basic Connectivity Extensions
service. This patch updates the MMBroadbandModemMbim code accordingly.
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.
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
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
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>
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
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.
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.
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.
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
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))
^
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))
^~
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.
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.
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.
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.
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