Commit Graph
4279 Commits
Author SHA1 Message Date
Aleksander Morgado 8aef73ab53 base-sim: reorder load_preferred_networks()
Add it along with the other initialization property loaders.
2021-12-11 12:53:37 +01:00
Aleksander Morgado 3f8ea6e8a1 sim-mbim: common method for Subscriber Ready Status
Instead of running the Susbcriber Ready Status separately for IMSI and
ICCID, we run it only once and store the results in a new private
struct.

It only saves one request/response right now, but it will save more
once introduced other SIM parameters loaded with the same method.
2021-12-11 12:53:37 +01:00
Aleksander Morgado 559df16deb filter: allow 'option' string in the TTY driver filter list
Fixes
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/475
2021-12-08 14:30:59 +01:00
Aleksander Morgado e9f254ba3f udev: avoid [0-9]* as shell globbing patterns
The udev rules expect matches based on shell globbing pattern, not
based on regex. This means that "[0-9]*" doesn't mean "zero or more
digits", it actually means "one digit and zero or more other
characters".

So, avoid the regex like match, even if it worked for us, because it
didn't mean what we thought it meant, plus, it breaks our custom udev
rules processing logic, in which we convert the input patterns into
real regex expressions.

See https://bbs.archlinux.org/viewtopic.php?pid=1415916#p1415916

While at it, also make sure that the wildcard matching is done
exclusively for prefix and suffix matches, never in the middle of
a string, or our custom rules parser would not match correctly.
2021-12-01 22:12:06 +01:00
Aleksander Morgado 558a681fc8 sms-part-cdma: remove trailing whitespaces 2021-11-26 09:38:18 +01:00
Matthew Via 6db9a48c34 sms-part-cdma: merge WDP multipart CDMA WAP messages.
CDMA WAPs have multipart message information in a 3 byte header in-band
with the user data, as described in WAP-259-WDP-20010614-a.  Set the
message concat parameters and use the message-id as the reference.
2021-11-21 21:17:20 +00:00
Aleksander Morgado afb213ac05 bearer-mbim: fix error handling in connection status reload
We should not set the GError as autoptr(), as we're returning it as
part of the GTask.
2021-11-21 15:18:27 +01:00
Aleksander Morgado 647a438b43 bearer-mbim: plug leak when checking if already disconnected fails
If the modem reports any error during the connection status check,
we're creating a GError but never disposing it. We don't need that
GError for anything, so just discard it.
2021-11-21 14:51:24 +01:00
som 74ed6eeeff broadband-modem-mbim: support lte attach info from MBIMEx 3.0
whenever MBIM version is set to 3.0, lte attach info should
invoke the MBIMEx 3.0 specific CID to fetch the data.
2021-11-19 23:32:51 +01:00
Aleksander Morgado 81302efa66 iface-modem: use external dispatcher to attempt FCC unlock
We remove the built-in FCC unlock procedures from the ModemManager, we
will no longer run them automatically, and instead rely on external
scripts/programs to do that.

Packages providing the external FCC unlock tools can install them in
${pkglibdir}/fcc-unlock.d.

Users manually enabling external FCC unlock tools can install them in
${pkgsysconfdir}/fcc-unlock.d.

The user-enabled path takes precedence over the package-enabled one.
2021-11-17 11:30:01 +01:00
Prakash Pabba 103eb9cf29 shared-qmi,modem-helpers-qmi: Add support for NR5G band preference
Implement support for the NR5G band list to get current NR5G bands.
This will also allow us to configure supported NR5G bands via mmcli.
2021-11-14 20:19:37 +05:30
Prakash Pabba 6e1cb371ca shared-qmi,modem-helpers-qmi: Add support for NR5G band capability
Implement support for the NR5G band list to get supported NR5G
band capabilities.

  localhost ~ # qmicli -d qrtr://0 --dms-get-band-capabilities
  [qrtr://0] Device band capabilities retrieved:
        Bands: 'bc-0-a-system, bc-0-b-system, bc-1-all-blocks, gsm-dcs-1800, gsm-900-extended, bc-10, gsm-850, gsm-pcs-1900, wcdma-2100, wcdma-pcs-1900, wcdma-1700-us, wcdma-850-us, wcdma-800, wcdma-900, wcdma-850-japan'
        LTE bands: '1, 2, 3, 4, 5, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 21, 25, 26, 28, 29, 30, 32, 34, 38, 39, 40, 41, 42, 43'
        LTE bands (extended): '1, 2, 3, 4, 5, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 21, 25, 26, 28, 29, 30, 32, 34, 38, 39, 40, 41, 42, 43, 46, 48, 66, 68, 71'
        NR5G bands: '1, 2, 3, 5, 7, 8, 12, 13, 14, 18, 20, 25, 26, 28, 29, 30, 38, 40, 41, 48, 66, 70, 71, 77, 78, 79'
2021-11-14 20:19:37 +05:30
Prakash Pabba 35d5287dda mm-shared-qmi: Add check for 5g modem iface type 2021-11-14 20:19:37 +05:30
Prakash Pabba a498e4674d broadband-modem-qmi: Process Signal Info for NR5G
MM was not processing NR5G signal strength for QMI signal info
response/indication message. Thus modem access technology and
signal quality was not reported for NR5G-only modems.

Process and consider NR5G signal strength too while getting
signal quality for modem interface.

As 5GNR does not have RSSI, take NR5G signal quality to be minimum
of percentage strength computed using RSRP, SNR and RSRQ values
individually.
2021-11-14 20:19:37 +05:30
Prakash Pabba 07512ef2a4 broadband-modem-qmi: Process System Info for NR5G
MM was not processing NR5G service info for QMI system info
response/indication message. This led to NR5G-only modems never
having 'registered' status.

Process NR5G system info and accordingly update the 5gs
registration status for qmi modems.

This commit also removes some stale comments.
2021-11-14 20:19:37 +05:30
Aleksander Morgado 59ad8409a6 kerneldevice,generic: simplify DEVPATH matching logic
Use autoptr to avoid the embedded goto.
2021-11-09 10:50:26 +01:00
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