Commit Graph
7368 Commits
Author SHA1 Message Date
Aleksander Morgado 10aa516f07 iface-modem-3gpp-profile-manager: new interface for profile management
This interface will provide support for the profile management
operations in different modem types.

This initial commit introduces support for the interface and provides
handlers for the methods that may be called in the interface.
2021-04-29 10:13:22 +00:00
Aleksander Morgado 62cbf7fa86 modem-helpers: new profile list helpers
The new helpers allow converting a PDP context list returned from the
+CGDCONT? parser to a list of 3GPP profile objects.

The new mm_3gpp_profile_list_find_best() method is equivalent to the
mm_3gpp_select_best_cid() one, but using profile objects as
input/output instead of specific settings.

The unit tests that were testing mm_3gpp_select_best_cid() are also
converted to use mm_3gpp_profile_list_find_best().
2021-04-29 10:13:22 +00:00
Aleksander Morgado dd7938b3e4 bearer-list: allow lookup by connected profile id
Some of the operations performed by the profile management interface
will require checking whether the operation is attempted on a profile
for which there is a known connected bearer object.

We introduce a new method to lookup a bearer in the bearer list by its
connected profile id.
2021-04-29 10:13:22 +00:00
Aleksander Morgado e4ef8319ec base-bearer: propagate connected profile id value in the connect result
Implementations that support profile management will provide the
connected profile id value in the MMBearerConnectResult returned to
the base bearer object during the connection attempt.
2021-04-29 10:13:22 +00:00
Aleksander Morgado 9fd5aced67 api,bearer: new 'ProfileId' property
To report which is the currently active profile with this bearer, if
known. If the modem doesn't support profiles, or if the bearer is
disconnected, -1 (MM_3GPP_PROFILE_ID_UNKNOWN) will be reported.

It is guaranteed that no two connected bearers will have the same
ProfileId property value.
2021-04-29 10:13:22 +00:00
Aleksander Morgado 2d43ea48e1 api,modem: new Modem3gpp.ProfileManager interface
This new interface allows modems to expose the list of available
connection profiles stored in the device and edit or delete them; as
long as the underlying device/protocol allows it.
2021-04-29 10:13:22 +00:00
Aleksander Morgado 793370f2f8 api,bearer: new 'profile-id' setting
We define a new 'profile-id' setting in the bearer properties that
users will use to specify which connection profile of the ones
available in the device should be connected.

When the 'profile-id' is given, the associated bearer object will be
bound to the 'profile-id', and the user is able to provide additional
settings to apply on top (e.g. if the profile storage doesn't allow
some of the settings we support, like 'apn-type', or if the setting is
completely unrelated to profiles, like 'multiplex').

After introducing the 'profile-id' as a valid setting in the bearer
properties, we also reimplement the properties object internals to
make use a 3GPP profile for the subset of common settings between both
objects.
2021-04-29 10:13:22 +00:00
Aleksander Morgado e2789b18a1 libmm-glib,3gpp-profile: new 3GPP profile helper object
Define a new helper object which we're going to use to implement the
new profile management interface.

The 3GPP profile object provides the list of settings that modems may
be able to store in their profile list, e.g. "apn", "ip-type" and so
on. Not all modems will be able to support all the settings defined in
the profile object, and therefore, when looking for a specific 3GPP
profile object with a given set of settings, we must make sure we only
compare those settings that are supported by the modem.

The profile management implementation will be able to load during
runtime a set of "compare flags", specifying which settings should not
be checked during the comparison. E.g. a generic AT-based modem that
supports only "apn" and "ip-type" will be compared with the
NO_APN_TYPE and NO_AUTH flags; and an AT/Icera-based modem (which
supports auth settings) will use only NO_APN_TYPE.

The settings in the 3GPP profile should be considered a subset of the
bearer properties.
2021-04-29 10:13:22 +00:00
Aleksander Morgado ff8e21b535 api,bearer: new 'apn-type' setting
This new setting allows the user setting up the connection to specify
the purpose of the connection being brought up.

Until now, we would always assume that connections are exclusively
brought up for connecting to the Internet, also limited by the
inability to connect to multiple different APNs at the same time.

But that may really not be true as there may be additional services
that may be accessed through other APNs, like MMS services or even
private networks for companies that have their own APNs on a given
operator (e.g. not that uncommon with banks and connected cars).

The new APN type setting will not change the way the bearer is
connected, but will allow the connection manager to decide what kind
of networking setup the specific connection needs.

This new setting can be provided by the user itself, or implicitly
read from the device if the device stores this information.
2021-04-29 10:13:22 +00:00
Freedom Liu 21ae558fe3 mmcli,manager: add 'wwan' subsystem to kernel event auto scan report 2021-04-29 00:58:35 +00:00
Freedom Liu 47ea5c98f4 foxconn: add support for the T99W175 module
0x0489 is the vendor ID of T77W968, 0x105b is the vendor ID of T99W175.
{0x105b, 0xe0b0},{0x105b, 0xe0b1} is T99W175 PCI device, used by Dell.
{0x105b, 0xe0ab} is T99W175 PCI device, used by Lenovo.

If the modem has an mbim port, create a MbimFoxconn object, regardless
of what the product ID is.

The firmware version format in the T99W175 was selected to have
firmware version + carrier config version + apps version.
2021-04-29 00:58:35 +00:00
Freedom Liu c31488608a foxconn: change modem-foxconn-t77w968 to modem-mbim-foxconn
Named the object in a more generic way.
2021-04-29 00:58:35 +00:00
Aleksander Morgado 7b7bbdd999 tools: disable stub tester if no introspection enabled
TEST: test-stub...
    /MM/stub/modem/interface: dbus-daemon[48020]: [session uid=0 pid=48020] Activating service name='org.freedesktop.ModemManager1' requested by ':1.0' (uid=0 pid=48005 comm="/builds/mobile-broadband/ModemManager/tools/tests/")
  Traceback (most recent call last):
    File "/builds/mobile-broadband/ModemManager/tools/test-modemmanager-service.py", line 7, in <module>
      gi.require_version('ModemManager', '1.0')
    File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version
      raise ValueError('Namespace %s not available' % namespace)
  ValueError: Namespace ModemManager not available
  dbus-daemon[48020]: [session uid=0 pid=48020] Activated service 'org.freedesktop.ModemManager1' failed: Process org.freedesktop.ModemManager1 exited with status 1
2021-04-28 22:41:06 +02:00
Aleksander Morgado 4593eec173 ci: disable introspection and gtk-doc in all tests that don't need it
The template image we're using already contains all the necessary
build deps to enable introspection and gtk-doc, so we need to
explicitly disable them where we don't need them, or otherwise they'll
be automatically enabled as the deps are found.
2021-04-28 22:13:35 +02:00
Aleksander Morgado d9072562cd ci: use latest ubuntu LTS by default 2021-04-28 22:13:35 +02:00
Aleksander Morgado 1051dd162c build: require libmbim 1.25.3
Including the latest QDU service enum value.
2021-04-28 21:56:25 +02:00
Aleksander Morgado 26243e7ed7 bearer-qmi: reorder methods in connection state machine
The "ready" methods for each step in the state machine must be ordered
from bottom to top, so that the readers can read the methods in that
order when following the logic.
2021-04-23 22:29:45 +02:00
Aleksander Morgado e7c1eb8287 port-qmi: WDS clients also mux-id specific
In addition to differentiating between IPv4 and IPv6 clients, we also
need to explicitly allocate different clients in different bearer
objects when in multiplexing.
2021-04-23 22:29:40 +02:00
Bjørn Mork 1c6258056e bearer-qmi: fix dual-stack connections
Connecting the second family of a dual stack connections fails with
'PolicyMismatch' when muxing is setup after family selection.

Switching the order of the family selection and muxing setup to
fix the problem. Looks like family selection must be the very last
WDS request before connecting the client.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-04-23 20:25:12 +02:00
Aleksander Morgado f170950451 port-qmi: fix WITH_QRTR check 2021-04-22 10:06:29 +02:00
Bjørn Mork 26533c84b8 port-qmi: fix crash when QRTR is disabled
Fix typo causing crash when WITH_QRTR is undefined:

 [6596]: <debug> [1619029470.854688] [cdc-wdm0/probe] probing QMI...

 Thread 1 "ModemManager" received signal SIGSEGV, Segmentation fault.
 0x77a7310f in install_property_internal () from /usr/lib/libgobject-2.0.so.0
 (gdb) bt
 #0  0x77a7310f in install_property_internal () from /usr/lib/libgobject-2.0.so.0
 #1  0x77a731db in validate_and_install_class_property () from /usr/lib/libgobject-2.0.so.0
 Backtrace stopped: frame did not save the PC

Fixes: ec375bd959 ("port-qmi: add support for QRTR")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-04-22 09:29:07 +02:00
Loic Poulain e57c59bf88 qmi: Increase qmi_device_open timeout
SDX55 modem can take slighlty more than 25 seconds to start all
its services from cold boot/reset (including QMI services), causing
QMI port opening timeout error. This patch increases the qmi_device_open
timeout from 25 seconds to 45 seconds to prevent such issue.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:55:23 +02:00
Loic Poulain 05b0059517 bearer: mbim: Check for multiplex support
If multiplexing is not supported by the network driver, do not enable
it by default and fail in case it is required.

This is the case for mhi_net driver, that do no implement multi MBIM
session (only session 0 is supported).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Loic Poulain fefbf4d302 plugins: generic: Add 'wwan' subsystem support
wwan is a new subsystem for WWAN devices, allowing to expose the
WWAN device and its ports in a generic way.

The sysfs hierarchy for such device is

/sys/class/wwanX
/sys/class/wwanX/wwanXpYP

Where X is the WWAN device index, Y the port index and P the
control protocol name (QMI, MBIM...). A control port is also
exposed as character device in /dev.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Loic Poulain 441902470a broadband-modem-mbim: Add MHI MBIM port peek support
For MHI data port (mhi-net), simply return the primary MBIM port.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Loic Poulain 6895ca836b broadband-modem-qmi: Add MHI QMI port peek support
For MHI data port (mhi-net), simply return the primary QMI port.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Loic Poulain 6db2e8f04d base: Add support for wwan subsystem
Add support for the Linux wwan subsystem that started to expose
control channel as character devices (e.g. /dev/wwan0p1MBIM...).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Loic Poulain b1db6527cf filter: Add wwan port devices
Allow WWAN control ports.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Loic Poulain aaf8c17e35 udev: add wwan port devices as valid candidates
The new Linux WWAN subsystem exposes the various WWAN control ports
as character devices. WWAN port device naming follows the following
convention: wwanXpYP, where X is the wwan device index, Y the port
index and P the port type/protocol.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Aleksander Morgado 4ae623c37b build: disable gtkdocize in autoreconf
We have a custom modified gtk-doc.make file in our sources, which
disables the gtkdoc-rebase on local install step, so we don't want
autoreconf to copy a different one when we're bootstrapping.
2021-04-21 11:35:08 +02:00
Clayton Craft 43c39d5226 sms-part-3gpp: add flag for indicating PDU is transfer-route message
When the message is a transfer-route MT, there is no SMSC address to
parse out. This flag allows indicating when the PDU is one such message.
2021-04-20 15:16:50 -07:00
Clayton Craft 205e9edf3e broadband-modem-qmi: Handle transfer-route MT messages
This handles transfer-route MT messages, automatically ACKing any that
need to be ACKed.

Based on work by Angus Ainslie and Elias Rudberg
2021-04-20 14:19:08 -07:00
Dylan Van Assche 1beea40270 quectel: set QGPSXTRA to enable assistance support
Quectel modems require to enable XTRA GNSS assistance first with QGPSXTRA=1, before it can be used.
2021-04-20 15:29:29 +00:00
Vincent Palatin f7ec13deb8 sim-mbim: increase the timeout for the MBIM_CID_HOME_PROVIDER query
Increase the timeout from 10 seconds to 30 seconds when reading the
operator information through the MBIM_CID_HOME_PROVIDER query.
We have observed cases where it took more than 12 seconds on a Fibocom
L850-GL modem with specific China Unicom SIMs.

This timeout was actually the cause of a corruption of the operator name
(e.g. returning '@' rather than the real operator name) on the Intel
XMM7360 based L850-GL. The following scenario was happening:
- the base-sim code sends a first MBIM 'home-provider' query to read the
  operator identifier.
- this query times-out after 10 seconds.
- the base-sim immediately sends another MBIM 'home-provider' query to
  read the operator name.
- the modem returns a corrupted operator identifier.
Intel helped for the debugging and indicates that when the first query
happens, the modem starts reading the SIM files (EF SPN/PNN), apparently
it's taking a long time, when it's receives the second query while the
first one is not entirely processed, this triggers a bug (in the modem
firmware) and returns a corrupted name.
2021-04-19 08:22:28 +02:00
Aleksander Morgado a74c1c9bd8 data,icon: resize to fit the contents 2021-04-14 13:03:12 +02:00
Aleksander Morgado 00e8196213 port-qmi: minor alignment fixes 2021-04-14 11:27:27 +02:00
Aleksander Morgado 125d2a0901 port-qmi: add support for QMAPv4 with checksum offload enabled 2021-04-14 11:27:27 +02:00
Aleksander Morgado 483f8f0559 port-qmi: new helper macro to check for supported QMAP values 2021-04-14 11:27:27 +02:00
Andrew Lassalle c2114e50d5 plugin: probe QRTR ports for QMI support 2021-04-14 11:27:27 +02:00
Andrew Lassalle f82f50fb13 base-modem: create modem for QRTR subsystem
Add support for QRTR devices so modems can be created based on ports
using the QRTR subsystem.
2021-04-14 11:27:27 +02:00
Andrew Lassalle 5f1bac5cf8 port-probe: create port-qmi using a QRTR node
For QRTR devices, create the qmi ports using the QRTR node.
2021-04-14 11:27:27 +02:00
Aleksander Morgado aeed8c9e5b qcom-soc-plugin: add support for QRTR+IPA based setups 2021-04-14 11:27:27 +02:00
Andrew Lassalle ec375bd959 port-qmi: add support for QRTR
Extend mm-port-qmi to accept a QRTR node to work with modems using the
QRTR protocol.
2021-04-14 11:27:27 +02:00
Aleksander Morgado 312f753046 port-qmi: initialize endpoint info for all backends
Connect the signal to initialize endpoint info in the generic object
initialization, also applicable for QRTR ports.
2021-04-14 11:27:27 +02:00
Aleksander Morgado c35bf66678 port-qmi: net ports using IPA driver expect rmnet based multiplexing
When using the IPA driver we cannot blindly use the master network
interface, we must always use RMNET based multiplexing.
2021-04-14 11:27:27 +02:00
Aleksander Morgado bf519fcc1b port-qmi: avoid using QmiDeviceExpectedDataFormat in the port setup
The QmiDeviceExpectedDataFormat is specific to modules exposed by the
qmi_wwan driver, it has nothing to do with other drivers we may find
in the system like bam-dmux or ipa, which don't allow changing the
expected data format.

The port setup logic is now updated to use a new flags bitmask that
specifies which kernel data modes are supported or currently
available.
2021-04-14 11:27:27 +02:00
Aleksander Morgado 768d76e0aa context: allow disabling QRTR on runtime even if support is built 2021-04-14 11:27:27 +02:00
Aleksander Morgado 591d904f5c kernel-device,qrtr: common physdev UID for all QRTR nodes
Add a common physdev UID to all ports in the Qualcomm SoC, so that they
are all bound together to the same modem object.

This change assumes that no external plugged device ever exports a
QRTR node in the QRTR bus (e.g. that no PCI or USB device would ever
do that). This assumption is likely wrong, but given that we're
currently limiting the QRTR support to the Qualcomm SoC plugin, the
assumption is valid for us for now.
2021-04-14 11:27:27 +02:00
Andrew Lassalle 2b126725bf qrtr-bus-watcher: add a class to watch for QRTR nodes
Add a watcher to listen for QRTR add/remove signals.
2021-04-14 11:27:27 +02:00
Andrew Lassalle daf27a9933 kernel-device,qrtr: add MMKernelDeviceQrtr skeleton
Add the skeleton of MMKernelDeviceQrtr and allow building it by the
introduction of with-qrtr.
2021-04-14 11:27:27 +02:00