Commit Graph
8805 Commits
Author SHA1 Message Date
Aleksander Morgado 2f5ebfadee iface-modem: create bearer list after loading revision
Modems may have certain features only available in new firmware
versions. We should try to load the firmware revision as soon as
possible, even before creating the bearer list, as that informs
already about multiplexing support in the device.
2024-02-15 21:01:52 +00:00
Aleksander Morgado 1373ca7e51 mtk: expect async SLAAC only in FM350 >= 29.23.06
Async SLAAC implementation in the FM350 is only available since
29.23.06, so only wait for the IP configuration indications reporting
the SLAAC result in newer versions.
2024-02-15 21:01:52 +00:00
Aleksander Morgado f31f42dda1 bearer-mbim: support async IP configuration indications reporting SLAAC result
When IPv6 is requested during a connection attempt, two things may
happen: either the modem itself runs SLAAC, or otherwise the host is
the one that should run SLAAC.

Until now we have assumed that the first IP configuration query that
is run upon finishing a connection attempt always gives us a "final
result", so if the modem did run SLAAC by itself, we would have
expected to see a global IPv6 reported in that first query. And if
there was no global IPv6 reported, then we would have assumed that the
host was the one tasked with running SLAAC.

There is a third option that we now consider, which is the case where
the first IP configuration query does not report a global IPv6, but
the modem is really running SLAAC, and the global IPv6 address will be
reported via a IP configuration indication as soon as SLAAC finishes.

This third option cannot be assumed by default, because it introduces
the possibility of MM waiting for the indication with the SLAAC
results and that indication never arriving in the 10s timeout used as
default. If a modem is supposed to use this third option, the feature
must be explicitly flagged by the modem plugin.
2024-02-15 21:01:52 +00:00
Aleksander Morgado b0add8c03b broadband-modem-mbim: request IP configuration indications
The modem object doesn't process the IP configuration updates reported
by the modem, but the MBIM bearer object may do so if waiting for
async SLAAC updates.
2024-02-15 21:01:52 +00:00
Aleksander Morgado 1befca4573 cinterion: disable periodic signal checks in MBIM modems 2024-02-15 13:01:00 +00:00
Aleksander Morgado 91828ecc65 quectel: disable periodic signal checks in MBIM modems 2024-02-15 13:01:00 +00:00
Aleksander Morgado 3c35212f7c telit: disable periodic signal checks in MBIM modems 2024-02-15 13:01:00 +00:00
Yegor Yefremov 29d237bcb7 .gitignore: ignore Visual Studio Code directory and file 2024-02-14 08:36:23 +01:00
RICCIARDI-Adrien ef126455b8 plugins: mtk: Added MT6229 USB modem support.
This modem is used for instance on the CAT B100 phone.

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
2024-02-12 22:34:01 +00:00
Aleksander Morgado b61adb1626 iface-modem: also run disable on failed low power mode update
If the user requested to set the modem in low power mode while
enabled, the user is also expecting the device to be implicitly
disabled.

If for any reason setting the modem to low power mode fails (e.g. it
could be not supported by the device), we should still try to run the
modem disabling sequence, as that is the expectation.
2024-02-08 14:31:19 +00:00
Florian Eckert f6795754bc broadband-modem-qmi: change operator description priority
If an IoT SIM card is used, the service name is always used as the operator
description. This is not what is expected. Therefore the priority is
changed with this commit, so that the long name is tried to be set first,
then the short name and finally the service name.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-02-07 16:31:33 +01:00
Florian Eckert 521349d5fc broadband-modem-qmi: add debug messages on operator description set
With the current implementation it was not possible to find out which
operator description is now exactly used. By adding a log message, it is
now clear which operator description is now set.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-02-07 16:31:06 +01:00
Aleksander Morgado 778d953f52 broadband-modem-mbim: use MBIMEx to list profiles unconditionally if available
We currently don't use the MBIMEx profile management operations by
default because the way profiles are managed is different (i.e.
profile id as index vs context type as index).

Still, when listing profile contents, we can use the MBIMEx operation
if supported, because it gives us much more information than the
original MBIM command, including IP type and profile source.
2024-02-01 14:59:55 +00:00
Aleksander Morgado c80e92e4ab broadband-modem-mbim: don't ignore profiles with "none" context type 2024-02-01 14:59:55 +00:00
Aleksander Morgado 2ac4bda846 libmm-glib,3gpp-profile: fix loading roaming allowance in DBus dictionary 2024-02-01 14:59:55 +00:00
Aleksander Morgado 06eafc8c19 libmm-glib,3gpp-profile: fix loading profile source in DBus dictionary 2024-02-01 14:59:55 +00:00
Aleksander Morgado 97ce69fe97 broadband-modem-mbim: fix processing IP type from MbimProvisionedContextElementV2 2024-02-01 14:59:55 +00:00
Yegor Yefremov a729a92e10 build: fix fs.copyfile usage for meson versions 0.64/0.64.1
Though this function was introduced in 0.64, its usage with install_dir
was broken till meson version 1.0.0. Hence, bump the minimal required
meson version for the fs.copyfile() routine.

See the following meson commit for details:
https://github.com/mesonbuild/meson/commit/100456de0761ee949e2277c97746cb8571b6ba39
2024-01-30 12:23:39 +01:00
Aleksander Morgado 9f4ee19601 build: unstable release version bump to 1.23.3 2024-01-29 10:41:02 +00:00
Aleksander Morgado e6ae636540 broadband-modem-qmi: refactor power update into a state machine
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.
2024-01-26 12:32:08 +00:00
Aleksander Morgado cddf31bf7a broadband-modem-qmi: don't complete the power update before receiving the response
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.
2024-01-26 12:27:44 +00:00
Aleksander Morgado d30975782c broadband-modem-qmi: use autoptr to manage self pointer in power update operation 2024-01-26 12:27:44 +00:00
Aleksander Morgado 80db88da4d broadband-modem-qmi: keep power operation ongoing until fully finished
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
2024-01-26 12:27:44 +00:00
Madhav 1655d0e014 bearer-mbim: When an IP type is unspecified in the profile, default to IPv4v6 (dual-stack)
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.
2024-01-25 21:52:31 +00:00
Aleksander Morgado e8f1edc5c4 iface-modem: allow low-power request while enabled
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.
2024-01-25 15:40:30 +00:00
Lukas Voegl 6f21b1d8fb cinterion: swap local and dynamic PDP context command
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-01-25 15:17:48 +00:00
Lukas Voegl c4eac36484 cinterion: default to none authentication with no user and password
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-01-25 15:17:48 +00:00
Aleksander Morgado e43d9ea829 build: add maintainers to README copyright 2024-01-25 15:10:31 +00:00
Yegor Yefremov 18144e73bc build: convert README to markdown
Also add SPDX license identifier and a copyright notice.
2024-01-25 15:10:31 +00:00
Lukas Voegl 030ec7c5bb cinterion: change secondary port to ppp on PLS8
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-01-25 15:02:59 +00:00
Aleksander Morgado 7ad85d2bff port-qmi: allow preallocated links when using rmnet multiplexing
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).
2024-01-25 13:45:14 +00:00
Aleksander Morgado 910e450ea7 port-qmi: use a single method to set all initial net port details 2024-01-25 13:45:14 +00:00
Aleksander Morgado 99f520269b port-qmi: fix double free when WDA Set Data Format fails
Thread 0(id: 4915) CRASHED [ SIGABRT@0x0000000000000000 ]
  0x00007b0f6732fa3f (libc.so.6 - pthread_kill.c: 44) __pthread_kill_implementation
  0x00007b0f672e4c6c (libc.so.6 - raise.c: 26) raise
  0x00007b0f672d0462 (libc.so.6 - abort.c: 79) abort
  0x00007b0f67323347 (libc.so.6 - libc_fatal.c: 155) __libc_message
  0x00007b0f67339929 (libc.so.6 - malloc.c: 5664) malloc_printerr
  0x00007b0f6733b5cb (libc.so.6 - malloc.c: 4439) _int_free
  0x00007b0f6733e279 (libc.so.6 - malloc.c: 3391) __libc_free
  0x00007b0f67abcabe (libglib-2.0.so.0 - gerror.c: 856) g_error_free
  0x000059fc4262623e (ModemManager - glib-autocleanups.h: 54) glib_autoptr_clear_GError
  0x000059fc4262623e (ModemManager - glib-autocleanups.h: 54) glib_autoptr_cleanup_GError
  0x000059fc4262623e (ModemManager - mm-port-qmi.c: 1501) set_data_format_ready
  0x00007b0f67985e57 (libgio-2.0.so.0 - gtask.c: 1309) g_task_return_now
  0x00007b0f67984e21 (libgio-2.0.so.0 - gtask.c: 1378) g_task_return
  0x00007b0f677f7107 (libqmi-glib.so.5 - qmi-wda.c: 4761) set_data_format_ready
  0x00007b0f67972329 (libgio-2.0.so.0 - gsimpleasyncresult.c: 804) g_simple_async_result_complete
  0x00007b0f6797240a (libgio-2.0.so.0 - gsimpleasyncresult.c: 816) complete_in_idle_cb
  0x00007b0f67ad17a4 (libglib-2.0.so.0 - gmain.c: 3460) g_main_dispatch
  0x00007b0f67ad17a4 (libglib-2.0.so.0 - gmain.c: 4200) g_main_context_dispatch
  0x00007b0f67ad1ac3 (libglib-2.0.so.0 - gmain.c: 4276) g_main_context_iterate
  0x00007b0f67ad1d41 (libglib-2.0.so.0 - gmain.c: 4479) g_main_loop_run
  0x000059fc425657df (ModemManager - main.c: 236) main
  0x00007b0f672d06c5 (libc.so.6 - libc_start_call_main.h: 58) __libc_start_call_main
  0x00007b0f672d0781 (libc.so.6 - libc-start.c: 389) __libc_start_main_impl
  0x000059fc42565130 (ModemManager) _start
  0x00007fffdea098c7
2024-01-25 11:25:11 +00:00
Lukas Voegl 4078d54ad5 cinterion: switch primary and secondary port for PLS8
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-01-19 13:41:57 +00:00
Yegor Yefremov a55ef5e939 build: fix ModemManager-names.h generation warning
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.
2024-01-15 12:42:11 +01:00
Yegor Yefremov 7c23c3db2f build: resolve deprecated 'copy' key argument in configure_file warning
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.
2024-01-15 09:40:40 +00:00
Aleksander Morgado 19b3e59151 iface-modem: ensure power state updates are spaced in time
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.
2024-01-11 11:13:12 +00:00
Aleksander Morgado 7f8b7adfde iface-modem: do not setup carrier config if eSIM without profiles
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/802
2024-01-11 10:47:02 +00:00
Michal Mazur 091fbe1212 broadband-modem-mbim: Fix detection of modem unlocking
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)
2024-01-10 10:08:12 +00:00
Yegor Yefremov fdf1aead04 99-log-event: add double quote to silence SC2086 warning
SC2086 suggests using double quote to to prevent globbing and word
splitting.
2024-01-10 08:30:30 +01:00
Yegor Yefremov 3aef62c5f6 build: add EditorConfig configuration file
EditorConfig projects helps maintaining consistent coding styles
across various editors and IDEs.
2023-12-18 12:01:07 +00:00
Yegor Yefremov dc3171fae4 .gitignore: ignore ctags tags file 2023-12-18 11:40:21 +00:00
Michal Mazur 6359cc93fe broadband-modem-mbim: Detect change in carrier lock state
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).
2023-12-18 11:18:57 +00:00
Aleksander Morgado 88f9950182 build: unstable release version bump to 1.23.2 2023-12-13 10:55:29 +00:00
Nagi Marupaka 97ac3e8448 fibocom: re-enable the modem after an attempt to set initial EPS bearer irrespective of success or failure of the operation 2023-12-13 10:10:20 +00:00
Chris Talbot d84cc1a80a mm-sms-properties: document mm_sms_properties_set_validity_relative () 2023-12-12 11:39:45 +00:00
Aleksander Morgado 3cb94cb0ae api,introspection: added notes about ProfileManager.Updated() reliability 2023-12-12 11:31:06 +00:00
Aleksander Morgado f38159e5a3 Revert "broadband-modem-qmi: ignore our own profile changed indications"
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.
2023-12-12 11:31:06 +00:00
Aleksander Morgado d00bf8e15b Revert "broadband-modem-qmi: ignore profile updates during 100ms after our own updates"
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.
2023-12-12 11:31:06 +00:00
Aleksander Morgado 3125b43617 iface-modem-3gpp-profile-manager: support ignoring update requests during our own operations 2023-12-12 11:31:06 +00:00