The logic implementing the operating mode update is composed of
multiple steps, some of which need to be skipped depending on previous
state.
Switch the logic to a state machine with a clear step enumeration
indicating the order of the updates.
When relying on the power update indications, we were completing the
operation as soon as the indication was received, regardless of
whether the request response was received or not.
Avoid doing that, and instead complete the operation only when both
indication and the response are received. This avoid misalignment in
the operation completion if a new one is scheduled just after the one
we have completed.
The GTask stored in the private modem struct indicates whether a power
update operation is ongoing. We should keep this task stored always
until just before completing the GTask.
We also make sure that any additional step (e.g. disabling DMS event
report indications) is included in the power update operation, so that
they are correctly synchronized also in the modem.
This fix should solve a crash triggered by a DMS event report
indication being received while setting up the next power update
operation.
0x0000007aa67de878 (libc.so.6 + 0x0007e878) pthread_key_delete
0x0000007aa6799d28 (libc.so.6 + 0x00039d28) gsignal
0x0000007aa6786e2c (libc.so.6 + 0x00026e2c) abort
0x0000007aa6feb188 (libglib-2.0.so.0 - gtestutils.c: 3256) g_assertion_message
0x0000007aa6feb1f8 (libglib-2.0.so.0 - gtestutils.c: 3282) g_assertion_message_expr
0x0000005a58199b7c (ModemManager - mm-broadband-modem-qmi.c: 1926) dms_set_event_report_operating_mode_activate_ready
0x0000007aa6e4b7a0 (libgio-2.0.so.0 - gtask.c: 1232) g_task_return_now
0x0000007aa6e4a6b0 (libgio-2.0.so.0 - gtask.c: 1301) g_task_return
0x0000007aa6b58400 (libqmi-glib.so.5 - qmi-dms.c: 32600) set_event_report_ready
0x0000007aa6e3642c (libgio-2.0.so.0 - gsimpleasyncresult.c: 804) g_simple_async_result_complete
0x0000007aa6e36538 (libgio-2.0.so.0 - gsimpleasyncresult.c: 816) complete_in_idle_cb
0x0000007aa6fc6390 (libglib-2.0.so.0 - gmain.c: 3444) g_main_context_dispatch
0x0000007aa6fc66c4 (libglib-2.0.so.0 - gmain.c: 4238) g_main_context_iterate
0x0000007aa6fc6a34 (libglib-2.0.so.0 - gmain.c: 4438) g_main_loop_run
0x0000005a58119274 (ModemManager - main.c: 221) main
0x0000007aa67870f8 (libc.so.6 + 0x000270f8) __libc_init_first
0x0000007aa67871c8 (libc.so.6 + 0x000271c8) __libc_start_main
0x0000005a58118aec (ModemManager + 0x000a8aec) _start
To address limitations in reading IP_TYPE information (in some cases) for profile requests,
default to IPv4v6 (dual-stack) for profile requests and IPv4 only for user requests (to ensure backward compatibility)
if nothing specific is requested. This ensures network compatibility across IPv4 and IPv6 networks,
preventing potential connectivity issues in IPv6 environments.
We now enable low-power mode request if we are enabled or even
connected. In this case, an explicit modem disable operation is run,
so that we don't end up with an enabled modem in low-power mode.
This new "low-power+disable" single operation makes the two
"disable+low-power" operation combo that was run until now much much
quicker, because the modem unregisters from the network and
disconnects PDNs in the same network interaction.
A new ID_MM_QMI_PREALLOCATED_LINKS udev tag, set in the NET port of
the device, allows configuring the amount of preallocated multiplexed
links that need to be created upon the first connection attempt,
regardless of the multiplexing setup method used.
If not specified by the user, 4 preallocated links are created when
using the qmi_wwan multiplexing procedure, and none for rmnet.
Previously, using preallocated links was exclusive used with the
qmi_wwan multiplexing procedure. Using preallocated links may be
useful if you want to maintain the same links across multiple
connection and disconnection loops, e.g. if running a tcpdump on a
given link interface capturing all traffic (not using preallocated
links in this case would be problematic as tcpdump cannot be requested
to run on net interfaces that don't exist yet).
Use configure_file() instead of custom_target(). This resolves the
following warning:
WARNING: Source item '/home/user/ModemManager/header-generator.xsl'
cannot be converted to File object, because it is a generated file. This
will become a hard error in the future.
Resolves the following warning:
NOTICE: Future-deprecated features used:
* 0.64.0: {'copy arg in configure_file'}
copy arg was deprecated in meson version 0.64. Hence, use
fs.copyfile() that is also introduced in 0.64, in versions
since 0.64 and use the old approach for older versions.
This change is an attempt to behave a bit better with modems when
multiple consecutive enable/full-power/disable/low-power operations
are scheduled in a modem.
MM will automatically throttle these requests so that the power state
updates are spaced in time, with at least 2 full seconds between
them.
When the modem is unlocked, the value of PIN type changes but the
PIN state is still LOCKED because PIN2 lock is always active.
(fixes commit 6359cc93fe)
Detection of carrier lock change is required to notify upper layers when
the modem gets locked to specific network or unlocked. Previous
implementation was removed because it caused modem reprobe every time
the SIM card was unlocked (19fd9c634b).
This reverts commit cc78a6439f.
Ignoring profile updates for 100ms after our own updates is now
implemented in a generic way for all protocols, not just for QMI.
This reverts commit f96664a159.
Ignoring profile updates for 100ms after our own updates is now
implemented in a generic way for all protocols, not just for QMI.
Kind of defeats the purpose of the quick suspend/resume, but I can see
how this could be useful.
E.g. in ChromeOS the modems are put in low power mode during suspend
(triggered by the connection manager) and the quick suspend/resume is
also enabled by default for a quicker resume process that doesn't
involve full modem reprobe.
When the modem is in a failed state because of a SIM-related error,
like a missing SIM, or if the modem is SIM-locked, allow the
Location interface to initialize and be enabled anyway.
This allows someone without a SIM to use the GPS, which does not
particularly require a phone subscription. It also allows
someone with a SIM to use the GPS even if the SIM is still
locked.
This patch was reworked, while keeping the original idea, by:
Aleksander Morgado <aleksander@aleksander.es>
Fixes#183
A7600E-H sends +CPIN: URC on startup.
The URC can be treated by ModemManager as a response to other command, what leads to errors during ModemManager initialization
SIM A7600E-H sends only 3 parameters in CGDCONT read response (+CGDCONT: 1,"IP","nate.sktelecom.com").
The parsing regex requeres 4 parameters, so the response is not matched.
In addition fourth parameter is not used by parsing code.
The process doing the unlock required checks may need a lot of retries
e.g. to decide whether a SIM card is available or not. If we do a
quick SIM eject, so the unlock required check starts looping, and then
insert the SIM again, we expect the loop to be cancelled right away,
so that the new modem object can be reprobed without any interference
from the old modem object.
We now take the modem-wide cancellable and bind it to the GTask in
mm_iface_modem_update_lock_info(), and we pass it down to every
sub-step of the async logic in the operation. We also plug the
cancellable to the delayed retries in the interface logic, to allow
aborting the checks right away
Previous patch for hotswap detection caused the modem to be reprobed
after unlocking or changing PIN for SIM card lock (commit 7b878765c6).
This change allows to differentiate between hotswap and PIN lock events.