Commit Graph
4263 Commits
Author SHA1 Message Date
Aleksander Morgado 03fce4775e kerneldevice,generic: input pattern to string match is not regex
The input pattern given to the string_match() method is not a regex
pattern and we cannot use it as that, because all the special
characters (e.g. '.') would not be treated correctly.

Also, the prefix matching with the wildcard at the end of the string
needs to be converted to a proper regex wildcard, i.e. '.*'.

This logic also adds support for suffix matching, with a wildcard at
the beginning of the string, e.g. as the ones used for the wwan kernel
device name matching rules (i.e. '*MBIM').

Unit tests are added to cover all cases, most of these tests were
failing without the fixes implemented here.
2021-11-09 10:50:26 +01:00
Aleksander Morgado 73b44ea51b kerneldevice,generic: move string match method to helpers
So that we can propertly unit-test it.
2021-11-09 10:50:26 +01:00
Daniele Palmas e5f08b7766 broadband-modem-qmi: prefer system info indication if available
Prefer system info indication if available and fall back to
serving system indication if the former is not supported.
2021-11-09 08:34:01 +00:00
Daniele Palmas ba84f97855 broadband-modem-qmi: prefer signal info indication if available
Prefer signal info indication if available and fall back to
signal strength indication if the former is not supported.
2021-11-09 08:34:01 +00:00
Daniele Palmas a1fdba508d broadband-modem-qmi: replace get serving system 3gpp with get system info
Set get system info as default and fall back to get serving system 3gpp
for those modems not supporting the former.
2021-11-09 08:34:01 +00:00
Daniele Palmas 639d0c62a9 broadband-modem-qmi: replace get signal strength with get signal info
Set get signal info as default and fall back to get signal strength
for those modems not supporting the former.
2021-11-09 08:34:01 +00:00
Iñigo Martínez ec2e5403f1 build,meson: Make feature options boolean
Different options are set as `feature`, also every possible plugin,
but this may cause confusion.

All options set as `feature` but plugins have been made `boolean` to
avoid further confusions.

`help2man` is also installed in the CI image because is required to
build different libraries.
2021-11-08 09:28:55 +00:00
Aleksander Morgado 93bff5a061 broadband-bearer: minor fix in code comment 2021-11-04 22:53:27 +01:00
Aleksander Morgado a37ce05a02 core: replace 'slave' with 'secondary' 2021-11-04 22:50:23 +01:00
Aleksander Morgado e8ebd3af7e core: replace 'master' with 'main' 2021-11-04 22:50:00 +01:00
Aleksander Morgado 9f679d4cac core: replace 'dummy' with 'placeholder' 2021-11-04 22:44:20 +01:00
Aleksander Morgado 3444b02932 core: replace 'whitelist' with 'allowlist' and 'blacklist' with 'blocklist'
We keep the 'WHITELIST-ONLY' filter type name still as an option in
--filter-policy=[POLICY], but deprecated and with the better
'ALLOWLIST-ONLY' replacement suggested from now on.
2021-11-04 22:40:28 +01:00
Aleksander Morgado cf376204e8 base-bearer: allow reporting uplink/downlink speeds via indications 2021-11-03 12:43:39 +01:00
Aleksander Morgado 21c8cadb41 bearer-mbim: implement support for 'uplink-speed' and 'downlink-speed'
During the packet service attach operation we'll get notified of which
is the agreed uplink/downlink bitrates, so include them in the stats.
2021-11-03 12:41:51 +01:00
Aleksander Morgado 16acff930b base-bearer: implement support for 'uplink-speed' and 'downlink-speed'
We let protocol implementations provide the uplink and downlink speeds
agreed with the network as part of the connect result, and we then move
them to the bearer stats in DBus.
2021-11-03 12:41:51 +01:00
Aleksander Morgado 447adafebc modem-helpers-mbim: sync MbimContexType with MMBearerApnType 2021-11-03 10:39:35 +01:00
Aleksander Morgado f9343692e3 broadband-modem: implement support for 'SetPacketServiceState()' 2021-11-02 09:50:17 +00:00
Aleksander Morgado c3f61547d2 broadband-modem-mbim: implement support for 'SetPacketServiceState()' 2021-11-02 09:50:17 +00:00
Som_SP 0316afee06 iface-modem-3gpp: implement handling of 'SetPacketServiceState()'
Includes updates by Aleksander Morgado to fix coding style issues and
to place this logic in the correct interface.
2021-11-02 09:50:17 +00:00
Aleksander Morgado 49a2954749 broadband-modem-mbim: fix reporting CS/PS/EPS/5GS reg status
Until now we just reported any registration status change as PS, and
that was fine because we wouldn't need to have any logic on top to
build a consolidated registration state.

But now we need to know whether the reported registration status is
for a packet domain (e.g. PS/EPS/5GS) in order to correctly update the
PacketServiceStatus property in DBus.

So, monitor the packet service status reported by the modem, and
decide which domain registration we're updating every time.
2021-11-02 09:50:17 +00:00
Aleksander Morgado d6b5e76d1f iface-modem-3gpp: implicitly update packet service state based on reg domains
If we're registered in either PS, EPS or 5GS, we can assume packet
domain service is attached.

If we're only registered in CS, packet domain is detached.

This change relies on protocol implementations to properly report
separate CS/PS/EPS/5GS domain registration states.
2021-11-02 09:50:17 +00:00
Aleksander Morgado 98738521ef helpers-mbim: detect 5G access tech using Microsoft extensions 2021-11-02 09:50:17 +00:00
Aleksander Morgado 115e7debb2 helpers-mbim: detect 5G capabilities using Microsoft extensions 2021-11-02 09:50:17 +00:00
Frederic Martinsons 2ae5f3cc27 iface-modem-firmware: Initialize context to null
Without setting memory to NULL it is possible that ctx->list
point to an unitialized pointer and trig a segfault when we
free it (for example when the firmware list is not supported)

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-10-23 10:58:15 +02:00
Frederic Martinsons 9d82d30978 cli, plugins: factorize usage of iso8601 datetime format
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-22 13:48:20 +02:00
Frederic Martinsons 0510e9aef8 api,bearer: new 'start-date' field in bearer statistics
It stores the epoch timestamp of the current bearer session start.
If there is no connected bearer, it is set to 0 and not displayed
in mmcli output.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-22 13:48:13 +02:00
Aleksander Morgado 53bcdaa8c3 broadband-modem-mbim: update extended signal info on MBIM notifications
We process the MBIM signal state notification and use it to update the
extended signal quality information in the Signal interface.
2021-10-21 00:10:06 +02:00
Som_SP bcdaaeddb0 broadband-modem-mbim: support for setting up signal thresholds
Includes updates by Aleksander Morgado to fix coding style issues and
rework the coded point transformations.
2021-10-20 22:18:19 +02:00
Aleksander Morgado e8c4b88493 libmm-glib: new 'MMSignalThresholdProperties' helper object
To avoid needing to work with GVariants directly.
2021-10-20 22:14:57 +02:00
Aleksander Morgado f27d7f9362 iface-modem-signal: bind together polling and threshold based setups
The values exposed in the Signal interface must not be cleared every
time polling is disabled, because the user may have also enabled
threshold based loading. And viceversa; if the user disables threshold
based polling, we should not unconditionally clear the values as
polling may still be enabled.

We setup a common Private context associated to the interface, and we
keep the current state there, which is also in sync with the DBus
interface.

We will only clear the signal values if both polling-based and
threshold-based setups are disabled.

Following the same reasoning, the mm_iface_modem_signal_update()
method used by implementations to report new signal quality details
is updated so that it's a no-op if no polling-based or threshold-based
setup has been enabled.
2021-10-20 22:14:04 +02:00
Som_SP 92539fa71f iface-modem-signal: implement support for SetupThresholds()
Also allow updating the per-access technology signal quality
information via indications.

Includes updates by Aleksander Morgado to fix coding style issues and
some other GTask related problems.
2021-10-20 22:09:57 +02:00
Aleksander Morgado d3b41f0b74 broadband-modem-mbim: early complete successful mode changes
When changing the allowed modes using the "Register State Set"
request, the response would arrive once we have been registered in the
network. This is obviously not ideal, as we just want to know if the
mode preference was changed, we don't care if we're registered or not.

Instead of waiting for the response to arrive or to timeout, we now
also process incoming indications that arrive during the wait time,
and if any of them shows the preferred modes to be the same ones as we
just requested, we complete the operation right away.
2021-10-19 08:27:23 +00:00
Aleksander Morgado c091860618 broadband-modem-mbim: sync current modes and registration requests
In MBIM we use the same "Register State Set Request" for 2 different
things: configuring the allowed modes, and selecting the operator to
use (manual/automatic).

We need to keep track of which were the last things requested by the
user so that we don't overwrite previous user actions when we process
newer ones.
2021-10-19 08:27:23 +00:00
Aleksander Morgado af7d488325 broadband-modem-mbim: fix MM_MODEM_MODE_ANY handling in set current modes 2021-10-19 08:27:23 +00:00
Aleksander Morgado 0fbcf8ddc1 broadband-modem-mbim: add 5G support to supported modes loading 2021-10-19 08:27:23 +00:00
Aleksander Morgado 316c91da0a helpers-mbim: add support for 3GPP2 data classes
Just for completeness.
2021-10-19 08:27:23 +00:00
Aleksander Morgado 27cc47f796 broadband-modem-mbim: flag 5G as supported based on data capabilities 2021-10-19 08:27:23 +00:00
Aleksander Morgado db6f397e3e broadband-modem-mbim: implement current mode switching using 'Register State v2'
Use the new Preferred Data Classes field in the Register State v2
message in order to know if the modes requested in the Set message are
the expected ones or not.

Based on an initial implementation by Som_SP <somashekhar.puttagangaiah@intel.com>
2021-10-19 08:27:23 +00:00
Aleksander Morgado d6aa727366 broadband-modem-mbim: fix signal quality reporting with MBIMEx v2.0
When we enable MBIMEx v2.0, the "Signal State" responses and
indications no longer report a valid RSSI value; and instead, they
report per access technology RSRP/RSRQ values.

  >>>>>> Header:
  >>>>>>   length      = 116
  >>>>>>   type        = indicate-status (0x80000007)
  >>>>>>   transaction = 0
  >>>>>> Fragment header:
  >>>>>>   total   = 1
  >>>>>>   current = 0
  >>>>>> Contents:
  >>>>>>   service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
  >>>>>>   cid     = 'signal-state' (0x0000000b)
  >>>>>> Fields:
  >>>>>>   Rssi = '99'
  >>>>>>   ErrorRate = '99'
  >>>>>>   SignalStrengthInterval = '5'
  >>>>>>   RssiThreshold = '2'
  >>>>>>   ErrorRateThreshold = '4294967295'
  >>>>>>   RsrpSnr = '{
  >>>>>>     [0] = {
  >>>>>>           Rsrp = '0'
  >>>>>>           Snr = '0'
  >>>>>>           RsrpThreshold = '4294967295'
  >>>>>>           SnrThreshold = '4294967295'
  >>>>>>           SystemType = '5g-nsa'
  >>>>>>     },
  >>>>>>     [1] = {
  >>>>>>           Rsrp = '49'
  >>>>>>           Snr = '45'
  >>>>>>           RsrpThreshold = '4294967295'
  >>>>>>           SnrThreshold = '4294967295'
  >>>>>>           SystemType = 'lte'
  >>>>>>     },
  >>>>>>   }'
2021-10-18 00:04:59 +02:00
Aleksander Morgado c01f22804e modem-helpers: setup common RSSI to signal quality converter 2021-10-18 00:04:09 +02:00
Aleksander Morgado e1bc4b0999 modem-helpers: remove unexistent method header 2021-10-18 00:04:01 +02:00
Andrew Lassalle b2a7591bcf broadband-modem-qmi: Add the profile name to profiles 2021-10-17 17:56:44 +02:00
Aleksander Morgado c3fe738e7d port-mbim: request MBIMEx v2.0
The ModemManager codebase has been ported to support Basic Connect v2
messages as defined in MBIMEx v2.0, so at this point we can now switch
to use it by default whenever possible.
2021-10-16 22:28:29 +02:00
Aleksander Morgado d8137789ed broadband-modem-mbim: support 'Signal State' from MBIMEx v2.0 2021-10-16 22:03:39 +02:00
Aleksander Morgado b32d85b1bf bearer-mbim: support 'Packet Service' from MBIMEx v2.0 2021-10-16 22:03:39 +02:00
Aleksander Morgado aca14b92c6 broadband-modem-mbim: support 'Packet Service' from MBIMEx v2.0 2021-10-16 22:03:39 +02:00
Aleksander Morgado 6b4a79f8ae broadband-modem-mbim: support 'Register State' from MBIMEx v2.0 2021-10-16 22:03:39 +02:00
Aleksander Morgado f7b595d066 broadband-modem-mbim: pass MbimDevice to notification parsers
We're going to enable the Microsoft extensions by default, and in
order to properly parse the notification messages, we'll need to know
which is the currently agreed MBIMEx version.

So, pass down the MbimDevice to every notification parser. Not all of
them will need it, so just for completeness.
2021-10-16 22:03:39 +02:00
Aleksander Morgado c06ca6df3f qcom-soc: require udev tag for ports
Since the 'wwan' subsystem addition to the qcom-soc plugin, the rules
to say a modem is handled by this plugin are too broad, and the plugin
attempts to support any kind of device exposed by the WWAN subsystem,
not just those from Qualcomm SoCs.

Update the plugin to require a new ID_MM_QCOM_SOC udev tag that is set
in the plugin udev rules, given that these rules already check for the
expected SoC drivers (bam-dmux, ipa, qcom-q6v5-mss).
2021-10-14 12:54:21 +00:00
Iñigo Martínez 803ce03d6a build,meson: Remove unnecessary empty line 2021-10-14 07:57:55 +00:00