Commit Graph
4458 Commits
Author SHA1 Message Date
Aleksander Morgado a32538fa32 helpers-mbim: report correct network availability from mbim bitmask
MbimProviderState is a bitset, so don't try to match exact values in a
switch statement when converting to MMModem3gppNetworkAvailability.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/524
2022-07-25 20:43:07 +00:00
Dylan Van Assche ba96ccc615 build: make tests optional
Add a meson option -Dtests and --without-tests automake option
to disable the compilation of all available testcases.
This is useful for compiling projects with Flatpak such as
GNOME Control Center which disables all possible integrations since they
only need the DBus part of ModemManager.

Contributes to https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1392
2022-07-25 11:01:51 +02:00
Aleksander Morgado 041f53af8b base-sms: don't clear parts on send/store error
The part generation logic is independent to whether the SMS send or
store operation failed, so just avoid doing the parts cleanup. E.g.
if we created the parts for store() but storing failed, the same parts
could still be used for send() successfully.
2022-07-24 13:14:26 +00:00
Aleksander Morgado 4aaea37022 base-sms: fix segfault when storing already sent messages
The internal list of parts in the base SMS object is created either
when the message is sent or when the message is stored.

The daemon should not expect the list of SMS parts to be empty upon a
store() operation requested via DBus, as the list of parts may have
already been created during send().

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/598
2022-07-24 13:14:26 +00:00
Aleksander Morgado 1615c8627c broadband-modem: don't make fatal SIM swap check of IMSI or ICCID
If the SIM swap check using ICCID or IMSI fail, don't completely fail
the operation, as the other one may still succeed.

Fail the operation only if both checks failed.
2022-07-16 22:24:33 +02:00
Aleksander Morgado 76f837697a broadband-modem: plug leaks in sim_swap_context_free() 2022-07-16 22:24:28 +02:00
Aleksander Morgado 41ff262006 shared-qmi: improve logging of steps in SIM hot swap setup 2022-07-16 22:24:25 +02:00
Aleksander Morgado e96a111a63 shared-qmi: only transfer state to priv info if SIM hotswap setup succeeds
Don't transfer state to the private info until we know the operation
has fully succeeded.
2022-07-16 22:24:23 +02:00
Aleksander Morgado c994ae1b3a shared-qmi: move indication callbacks out of the SIM hot swap setup 2022-07-16 22:24:20 +02:00
Aleksander Morgado ba3b15fe29 shared-qmi: return error if none of the methods succeeded in SIM hot swap setup 2022-07-16 22:24:17 +02:00
Aleksander Morgado b7da236567 shared-qmi: avoid jumps in the SIM hot swap setup state machine
Always transition to the next step, and decide what to do based on the
state tracked by the previously run steps.
2022-07-16 22:24:14 +02:00
Aleksander Morgado 21d24657eb shared-qmi: make refresh all non-fatal during SIM hot swap setup
If for any reason "Refresh all" fails, don't return an error, as we
may have already configured SIM slot status correctly.
2022-07-16 22:24:02 +02:00
Aleksander Morgado d2bc73f394 shared-qmi: add slot status indication in its own step during SIM hot swap setup 2022-07-16 22:23:57 +02:00
Aleksander Morgado 405f5867c7 shared-qmi: add slot status check in its own step during SIM hot swap setup
Also, don't make the "Get Slot Status" operation fatal; just go on
assuming that the slot status indications are unsupported.
2022-07-16 22:23:53 +02:00
Aleksander Morgado 76c0896535 shared-qmi: new step in SIM hot swap setup to connect to refresh signal
Instead of connecting to the signal in multiple places, do it in one
single place in the logic.
2022-07-16 22:23:45 +02:00
Prakash Pabba 5c0db37432 mm-iface-modem,mm-broadband-modem,mm-shared-qmi: support SIM IMSI switch
It is possible that SIM IMSI might change in roaming conditions for a sim.

Register for UIM refresh indication always and reprobe if ICCID or IMSI changes for QMI modem.
2022-07-16 22:22:59 +02:00
Dylan Van Assche efb497e2e6 mm-call-qmi: implement DTMF support
Overwrite the base class with a QMI implementation
to send DTMF characters during a call. Uses the continuous DTMF
QMI messages to support both CDMA and 3GPP networks.
2022-07-16 13:33:29 +00:00
Dylan Van Assche ea3f5ccad8 mm-call-qmi: drop unnecessary white space 2022-07-16 13:33:29 +00:00
Dylan Van Assche 3e61d07419 mm-call-qmi: fix comment consistency
Do not use caps for 'call'
2022-07-16 13:33:29 +00:00
Daniele Palmas fbf497c701 iface-modem-3gpp-profile-manager: add default index_field
If check_support functions are not defined when implementing
iface-modem-3gpp-profile-manager, set "profile-id" as default
index_field.
2022-07-15 16:47:34 +02:00
Carlo Lobrano 7464940971 mm-iface-modem-3gpp-profile-manager: do not override Bearer 3gpp profile properties during connection
When connecting via AT commands requiring a 3gpp profile with undefined
profile-id, the corresponding bearer 3gpp profile is later modified
adding the selected PDP context.

For this reason when a next connection is requested with the same
properties (that is no profile-id) the already existing bearers is not
selected because of the different profile-id value and a new one is
created.

This change lets the connection logic use a copy of the user-requested
bearer's 3gpp profile which can be modified for the logic needs, but it
is not stored and then does not compromise a bearer comparison in a next
connection request.
2022-07-15 11:18:36 +00:00
Carlo Lobrano 85d4ad1158 mm-iface-modem-3gpp-profile-manager: do not try to deactivate unused profile
'mm_3gpp_profile_list_find_best' can return an unused profile ID, which
is later tested for being already activated in
'profile_manager_check_activated_profile_ready' with +GCACT?. Since the
profile does not exist, this check always fails, but the profile manager
still tries to deactivate it, which is unnecessary.

This change checks the return error from 'check_activated_profile' and skips
SET_PROFILE_STEP_DEACTIVATE_PROFILE step if error is
MM_CORE_ERROR_NOT_FOUND.
2022-07-15 11:18:36 +00:00
Ulrich Mohr 249e46a70a mbim: Make use of uim qmi service if available 2022-07-14 13:16:09 +02:00
Ulrich Mohr 9f44dfa45e mm-sim-qmi: use shared qmi interface instead of using qmi modem class directly 2022-07-14 13:16:09 +02:00
Jack Song 71a3942b3f mm-bearer-mbim: ignore mbim status error 'SIM not inserted' while disconnecting
Ignore the error SIM_NOT_INSERTED when ModemManager disable modem after SIM card removed

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/578
2022-07-06 11:07:06 +08:00
Aleksander Morgado 1f2bea9184 port-mbim: monitor consecutive timeouts 2022-06-30 11:15:04 +02:00
Aleksander Morgado 7a3cbfec64 port-qmi: monitor consecutive timeouts 2022-06-30 11:15:04 +02:00
Aleksander Morgado b91823012a base-modem: setup timeout monitoring in all control ports
If any of the control ports ends up timing out 10 consecutive times,
the modem will be flagged as invalid and it will be reprobed from
scratch.

This allows us to detect modems that end up irresponsive in QMI or
MBIM while they're still exposed in e.g. the USB bus.
2022-06-30 11:15:04 +02:00
Aleksander Morgado 8387629a8c port: make 'timed-out' a signal for all port types, not just serial 2022-06-30 01:08:15 +02:00
Dmitry Skorykh a87a1f8ced mm-sms-part-3gpp: sms_decode_text: avoid decoding an empty text message
Fix segfault that can occur during message text decoding if there are no
elements in SMS text
2022-06-27 12:09:15 +03:00
Daniele Palmas d6203265c2 port-probe: avoid QCDM port probing if not for specific plugins
The QCDM/DIAG port is usually nowadays exclusively used by applications
gathering traces from the modem, so avoid port probing and grabbing
when plugins set the property MM_PLUGIN_ALLOWED_QCDM.

A new property MM_PLUGIN_REQUIRED_QCDM is created for those plugins
requiring the QCDM port for properly using a modem.
2022-06-19 13:40:48 +00:00
Sven Schwermer 661a63b37b broadband-bearer: Save profile ID upon successful connection
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-06-19 15:11:10 +02:00
Prakash Pabba 8934ce865c mm-broadband-modem-qmi: set endc_available as false by default 2022-06-09 09:25:47 +00:00
Rukun Mao 3da84c2079 suspend: add suspend/resume support with powerd on ChromeOS
ModemManager handles suspend and resume signals sent from powerd

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-06-09 08:32:13 +00:00
Aleksander Morgado 63d02f9da2 iface-modem: allow state updates without bearer list
E.g. if we reach the failed state before the bearer list is created.
2022-05-25 11:15:27 +02:00
Aleksander Morgado 9c773fcad4 iface-modem: report failed modems with unknown capabilities
Instead of not creating a modem object, create it in failed state with
the "unknown capabilities" failed state reason.
2022-05-25 11:15:06 +02:00
Aleksander Morgado e90a7410b4 iface-modem: minor coding style fix 2022-05-25 11:15:05 +02:00
Aleksander Morgado 234f185c3a iface-modem: fail initialization if eSIM without profiles
A modem using an eSIM without profiles should not be allowed to get
enabled, it should be really treated as a modem without a physical
SIM.
2022-05-25 11:14:45 +02:00
Aleksander Morgado 0123030136 iface-modem: skip setting up carrier config on esim without profiles 2022-05-25 11:14:40 +02:00
Aleksander Morgado fe91a3044d iface-modem: load current modes and current bands even without SIM
These are current settings in the modem, they don't really depend on
whether there is a SIM or not.
2022-05-25 11:14:39 +02:00
Aleksander Morgado 061f9a275a iface-modem: move helper method out of the initialization logic 2022-05-25 11:14:38 +02:00
Aleksander Morgado a535b2fddc base-sim: skip loading SIM identifier in eSIM without profiles 2022-05-25 11:14:37 +02:00
Aleksander Morgado 38f631e00e broadband-modem: rework checking for SIM swap
Avoid calling the MMBaseSim class method directly, and use the helper
mm_base_sim_load_sim_identifier() instead.

Also, rework a bit the logic to have a single completion method once
we know the current ICCID.
2022-05-25 11:14:35 +02:00
Aleksander Morgado 638841281e base-sim: disallow SIM user operations in eSIM without profiles 2022-05-25 11:14:34 +02:00
Aleksander Morgado 38a69011bd base-sim: skip loading SIM properties based on SIM type
If the reported eSIM doesn't have profiles, there is no point in
trying to load properties like ICCID, IMSI or operator name/id.

If the reported SIM is a physical SIM, there is no point in trying
to load properties like EID or eSIM status.
2022-05-25 11:14:03 +02:00
Aleksander Morgado 073404313e broadband-modem-mbim: improve logging of found SIM slots 2022-05-25 10:59:17 +02:00
Aleksander Morgado f593421d8d iface-modem: minor coding style fix 2022-05-25 10:59:17 +02:00
Aleksander Morgado 1b30d10ad1 base-sim: don't reload properties that may have been already initialized
If we created the SIM objects during the SIM slots processing, we
should not attempt to reload the settings that were already set during
the re-initialization, as that may end up clearing the initial
properties.
2022-05-25 10:59:17 +02:00
Aleksander Morgado ac3f9be3d3 base-sim: remove bogus comments in initialization
All properties loaded during initialization are meant to be loaded
only once, no point in saying that for each property.
2022-05-25 10:59:17 +02:00
Aleksander Morgado eee6e46d4e broadband-modem-mbim: assume no lock is required in eSIM without profiles 2022-05-25 10:59:17 +02:00