Commit Graph
4311 Commits
Author SHA1 Message Date
Aleksander Morgado fb0dfb8751 iface-modem-3gpp: fix variant ref handling in scan output 2022-01-07 21:35:43 +01:00
Aleksander Morgado 3fac73a113 iface-modem-simple: explicit short wait after enabling
When we have just enabled, we want to give it some time before
starting the registration process, so that any pending registration
update that may have been scheduled during the enabling phase is
applied. We don't want to trigger a new automatic registration if
e.g. we're already registered.
2021-12-26 11:02:45 +01:00
Aleksander Morgado 1ffd693f54 iface-modem-simple: fix connection attempt start place
The 'ENABLE + 1' step is 'WAIT_FOR_ENABLED' really, and that should be
only used when the current state is not a final one. If we're already
enabled, or registered, or connected, then jump to 'REGISTER' right
away.
2021-12-26 11:02:45 +01:00
Aleksander Morgado 1199fa934d broadband-modem-mbim: schedule reg info updates as soon as enabled
During the enabling phase, the modem may receive a lot of asynchronous
updates reporting registration info changes, but we were fully
ignoring them because the modem was not yet enabled. The problem with
this is that as soon as we reach the enabled state, we may not receive
additional info, so we would be left in 'enabled' state until new
asynchronous updates are received or until we start a connection
attempt.

We can solve this by triggering an explicit update with the
registration information that we have cached as soon as we're enabled.
2021-12-26 11:02:45 +01:00
Aleksander Morgado 73eda8cdc8 broadband-modem-mbim: don't miss operator id/name on packet service updates 2021-12-26 11:01:50 +01:00
Aleksander Morgado 59c79b07ae iface-modem: minor coding style changes 2021-12-26 11:01:50 +01:00
Aleksander Morgado f2f2dfec13 broadband-modem-mbim: reload ATDS location on reg state changes
Only if transitioning into a "registered" state ("home", "roaming",
"partner") or if "denied"; otherwise, assume LAC/TAC/CID are all
unknown.

This change makes the logic also reload the location info on
registration updates reported asynchronously via notifications.
2021-12-26 11:01:50 +01:00
Aleksander Morgado f9487cf3d1 core: new '--test-mbimex-profile-management' option
The profile management APIs implemented by Microsoft in the MBIM
extensions provide certain features that are not available via other
means (e.g. ip type, access type preference, roaming allowance...).

Unfortunately, these APIs require the current list of profiles
installed in the modem to be a bit special; e.g. with one profile max
for each context/APN type. If this does not happen, the operations
will fail, or they will update contexts that should not be updated.

So, we disable for now the MBIM extension profile management support;
the logic is there, but not used by default.
2021-12-26 10:12:33 +01:00
Aleksander Morgado 853aa29be8 iface-modem-3gpp-profile-manager: support 'apn-type' as index field
The modem may report the 'apn-type' field is the one to be used as
index; if that's the case, allow setting and deleting profiles based
on the given 'apn-type' field.

This change also makes the internal profile management operations use
one index field or another, based on what the protocol implements.
2021-12-26 10:12:11 +01:00
Aleksander Morgado 0d0ad722d9 iface-modem-3gpp-profile-manager: initialize the 'IndexField' property 2021-12-26 10:12:05 +01:00
Aleksander Morgado b90d64192a broadband-modem-mbim: support profile properties from MbimProvisionedContextElementV2
Microsoft defined a new extended version of the "provisioned contexts"
operation from the generic MBIM basic connect service. This extended
version adds several new settings that can be stored in the profile
(e.g. IP type, media type, roaming allowance...).

But this new version has a huge drawback; we cannot specify single
profiles via their unique id while we perform update/delete operations
in the modem. Instead, Microsoft explains that we should use the
context type to identify the target context; but this will ONLY work
if we have one context defined for each type. As soon as we have
multiple contexts of the same type, this operation may fail or
otherwise update multiple contexts at once.
2021-12-24 14:06:11 +01:00
Aleksander Morgado 6ba245cedc broadband-modem-mbim: new profile settings not available in MBIM protocol
At least not yet.
2021-12-24 14:05:35 +01:00
Aleksander Morgado 1b37ccc27a broadband-modem-qmi: new profile settings not available in QMI protocol
At least not yet.
2021-12-24 14:05:35 +01:00
Aleksander Morgado ebe9a33411 broadband-modem: new profile settings not available in generic AT protocol 2021-12-24 14:05:35 +01:00
Aleksander Morgado 87eaac8f9d iface-modem-3gpp: don't compare new properties when matching initial EPS bearer 2021-12-24 14:05:35 +01:00
Aleksander Morgado 93709f8dc2 broadband-modem-mbim: implement 5GNR registration settings update 2021-12-24 12:41:27 +00:00
Aleksander Morgado 296cce0bbb broadband-modem-mbim: implement 5GNR registration settings loading 2021-12-24 12:41:27 +00:00
Aleksander Morgado 61675e1555 iface-modem-3gpp: implement support for updating 5GNR registration settings 2021-12-24 12:41:27 +00:00
Aleksander Morgado 396f9c533a iface-modem-3gpp: minor coding style change 2021-12-24 12:41:27 +00:00
Aleksander Morgado 60fe68f609 iface-modem-3gpp: implement loading 5GNR registration settings during init 2021-12-24 12:41:27 +00:00
Jakob Hauser db228b2859 broadband-modem-qmi: Introduce udev flag for reduced facility lock query
The udev flag "ID_MM_QMI_FACILITY_LOCK_QUERY_REDUCED" allows to skip
facility lock state query "get_ck_status" on the DMS path for devices
where this isn't implemented properly.

On devices that have enabled "device locks", this flag won't work well.
Skipping the query doesn't disable the locks.

Fixes #448
2021-12-20 05:10:14 +01:00
Aleksander Morgado 029ea68ce4 base-bearer: make sure 'ReloadStatsSupported' is set before transitioning to 'Connected'
By the time we report the bearer as 'Connected', the DBus client
should also be able to know right away the value of
'ReloadStatsSupported', instead of needing to wait for it to be
updated asynchronously.

This logic adds one additional step in the generic connection
sequence for this purpose, which is run after the modem is connected
but before we report the state change via DBus.
2021-12-13 09:35:28 +00:00
Frederic Martinsons 9fc3d15d29 api, dbus, bearer: Add ReloadStatsSupported bearer dbus property
This property means that the current bearer can reload stats and read TX
and RX bytes transmitted.

The property is initiliazed as soon as the bearer is connected.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-12-13 09:35:28 +00:00
Aleksander Morgado b094fe4427 port-probe: duplicate amount of AT probing attempts
We originally did only 3 attempts every 3s, so the maximum probing
time for a given TTY port looking for AT capabilities was 9 seconds.
We now duplicate the amount of times, so up to 18s of port probing,
which is quite a lot more than before, but unfortunately it's needed
because most new modems take a lot of time to boot up internally.

The way to avoid this long probing time is to make sure port type
hints for the possible AT ports are set correctly.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/379
2021-12-11 20:22:57 +00:00
Aleksander Morgado 2c34ebe80c port-mbim: support MBIMEx v3.0
The ModemManager codebase has been ported to support Basic Connect v3
messages as defined in MBIMEx v3.0, so at this point we can now switch
to use it by default whenever possible.
2021-12-11 13:13:37 +01:00
Aleksander Morgado 2cf8b7858e broadband-modem-mbim,bearer-mbim: support packet service from MBIMEx v3.0
Whenever MBIMEx v3.0 is enabled, the logic should create requests and
parse responses using the updated format.

Based on an initial implementation by Som_SP <somashekhar.puttagangaiah@intel.com>
2021-12-11 13:13:33 +01:00
Aleksander Morgado 3382e421cc broadband-modem-mbim,bearer-mbim: support connect from MBIMEx v3.0
Whenever MBIMEx v3.0 is enabled, the logic should create requests and
parse responses using the updated format.

Based on an initial implementation by Som_SP <somashekhar.puttagangaiah@intel.com>
2021-12-11 13:12:55 +01:00
Aleksander Morgado 9940bd9dbe broadband-modem-mbim: treat 'no eSIM profile' as initialized
When an eSIM doesn't have any profile set, we should treat it as fully
ready to be used; i.e. so that a new SIM object can be created and
initialized.

In this state, the "eSIM status" property will say "No profiles".
2021-12-11 12:53:37 +01:00
Aleksander Morgado 36402df05b sim-mbim: load 'SimType', 'Removability' and 'EsimStatus' properties
We can use the MBIMEx v3.0 support to load the SIM type, SIM
removability details and eSIM status.
2021-12-11 12:53:37 +01:00
Aleksander Morgado c76da3bed9 broadband-modem-mbim,sim-mbim: support subscriber ready status from MBIMEx 3.0
Whenever MBIMEx v3.0 is enabled, the logic should parse the response
and indication messages using the updated format.
2021-12-11 12:53:37 +01:00
Aleksander Morgado 83ebc2b4a8 base-sim: new 'SimType', 'Removability' and 'EsimStatus' properties
We implement the methods to load the properties during SIM object
initialization.
2021-12-11 12:53:37 +01:00
Aleksander Morgado 8cfddef2be base-sim: reorder init ready() methods
The ready() methods for each step in the initialization sequence must
be ordered from bottom to top, so that we can read the logic in that
same order.
2021-12-11 12:53:37 +01:00
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