Aleksander Morgado
7d4784ed28
iface-modem: ignore SIM events during a controlled SIM slot switch
...
If there is an ongoing SIM slot switch, we must ignore all SIM hotswap
related events happening during the process. The flag that is set in
the Modem interface private info to track this is never reset back to
FALSE on a successful SIM slot switch, it will be set for as long as
the modem object exists.
After the successful SIM slot switch, a new modem reprobe will be
requested, which leads to the old modem object to be disposed (the one
that had the flag set) and a new modem object created.
The logic that already existed in the MBIM modem object is now
generalized in the Modem interface itself so that SIM events reported
via other protocols are also properly ignored.
Signed-off-by: Aleksander Morgado <aleksandermj@google.com >
2025-06-18 22:10:54 +00:00
Aleksander Morgado
48a686a6d9
api: fix license headers in MM API
...
The libmm-glib library, as well as the ModemManager headers installed
as part of the D-Bus service API, have always been LGPLv2+ licensed,
because we want users of the service to rely on them in their own
programs, even if they are proprietary.
Some files had an incorrect GPLv2+ header instead of the LGPLv2+ and
that was confusing. All public headers in the MM API have the correct
license text now.
Signed-off-by: Aleksander Morgado <aleksandermj@chromium.org >
2025-03-13 00:35:24 +00:00
Aleksander Morgado
ef5fe9b8d5
broadband-modem: prefer explicit return to break
...
Just to make it explicit that there is no more logic running
afterwards.
2025-02-03 10:21:32 +00:00
Aleksander Morgado
4ce23a9ebd
broadband-modem: exit with error if enable() while in unknown state
...
We should not assert if the modem is flagged as invalid but an
outstanding enabling request is processed. Let's exit gracefully and
let the object get properly disposed afterwards.
(libc.so.6 - pthread_kill.c: 44) __pthread_kill_implementation
(libc.so.6 - raise.c: 26) raise
(libc.so.6 - abort.c: 79) abort
(libglib-2.0.so.0 - gtestutils.c: 3450) g_assertion_message
(libglib-2.0.so.0 - gtestutils.c: 3476) g_assertion_message_expr
(ModemManager - mm-broadband-modem.c) enable
(ModemManager - mm-iface-modem.c: 2340) handle_enable_auth_ready
(libgio-2.0.so.0 - gtask.c: 1309) g_task_return_now
(libgio-2.0.so.0 - gtask.c: 1378) g_task_return
(ModemManager - mm-base-modem.c: 2011) lock_after_authorize_ready
(libgio-2.0.so.0 - gtask.c: 1309) g_task_return_now
(libgio-2.0.so.0 - gtask.c: 1378) g_task_return
(ModemManager - mm-base-modem.c: 1841) base_modem_operation_run
(ModemManager - mm-base-modem.c: 764) state_operation_ready
(libgio-2.0.so.0 - gtask.c: 1309) g_task_return_now
(libgio-2.0.so.0 - gtask.c: 1323) complete_in_idle_cb
(libglib-2.0.so.0 - gmain.c: 3460) g_main_dispatch
(libglib-2.0.so.0 - gmain.c: 4200) g_main_context_dispatch
(libglib-2.0.so.0 - gmain.c: 4276) g_main_context_iterate
(libglib-2.0.so.0 - gmain.c: 4479) g_main_loop_run
(ModemManager - main.c: 236) main
(libc.so.6 - libc_start_call_main.h: 58) __libc_start_call_main
(libc.so.6 - libc-start.c: 360) __libc_start_main_impl
(ModemManager + 0x000b8850) _start
2025-02-03 10:18:19 +00:00
Aleksander Morgado
87e1e8b2d4
shared-qmi: don't assume LOC assistance data servers is initialized once
...
0x00007bcb78abf8b4 (libglib-2.0.so.0 -gtestutils.c:3450) ??g_assertion_message
0x00007bcb78abf928 (libglib-2.0.so.0 -gtestutils.c:3476) ??g_assertion_message_expr
0x00005594f143b221 (ModemManager -mm-shared-qmi.c:6651) loc_location_get_predicted_orbits_data_source_indication_cb
0x00007bcb78866043 (libgobject-2.0.so.0 -gmarshal.c:1686) ??g_cclosure_marshal_VOID__BOXEDv
0x00007bcb7886338b (libgobject-2.0.so.0 -gclosure.c:895) _g_closure_invoke_va
0x00007bcb78878a10 (libgobject-2.0.so.0 -gsignal.c:3472) ??g_signal_emit_valist
0x00007bcb78879486 (libgobject-2.0.so.0 -gsignal.c:3622) ??g_signal_emit
0x00007bcb785acc70 (libqmi-glib.so.5 -qmi-loc.c:16976) process_indication
0x00007bcb78520ede (libqmi-glib.so.5 -qmi-device.c:1697) process_indication_idle
0x00007bcb78a9b75c (libglib-2.0.so.0 -gmain.c:3460) ??g_main_dispatch
0x00007bcb78a9b75c (libglib-2.0.so.0 -gmain.c:4200) ??g_main_context_dispatch
0x00007bcb78a9ba81 (libglib-2.0.so.0 -gmain.c:4276) g_main_context_iterate
0x00007bcb78a9bcff (libglib-2.0.so.0 -gmain.c:4479) ??g_main_loop_run
0x00005594f13a7463 (ModemManager -main.c:236) ??main
0x00007bcb7825c705 (libc.so.6 -libc_start_call_main.h:58) ??__libc_start_call_main
0x00007bcb7825c7c1 (libc.so.6 -libc-start.c:360) ??__libc_start_main_impl
0x00005594f13a6da0 (ModemManager + 0x000b5da0) ??_start
2024-11-12 18:21:25 +00:00
Aleksander Morgado
3238ccdbb2
sim-qmi: implement loading GID1 and GID2
2022-08-19 15:53:43 +00:00
Aleksander Morgado
442c722d48
sim-qmi: define common SIM file paths for MF and ADF
2022-08-19 15:53:43 +00:00
Aleksander Morgado
f61061044b
base-sim: add steps to load GID1 and GID2 during init
2022-08-19 15:53:43 +00:00
Aleksander Morgado
210020c7d2
cli,sim: print GID1 and GID2 fields if available
2022-08-19 15:53:43 +00:00
Aleksander Morgado
59e36c6838
cli,sms: minor alignment fix
2022-08-19 15:53:43 +00:00
Aleksander Morgado
cd933c740e
libmm-glib,sim: add support to get GID1 and GID2 fields
2022-08-19 15:53:43 +00:00
Aleksander Morgado
219efb0253
libmm-glib,sim: add missing separators in source code
2022-08-19 15:53:43 +00:00
Aleksander Morgado
b6b21f8fa6
api,introspection: add Gid1 and Gid2 properties in SIM interface
2022-08-19 15:53:43 +00:00
Aleksander Morgado
a783d9f68a
shared-qmi: minor rework SetPacketServiceState()
...
Port to using g_autoptr() so that we avoid the gotos.
2022-08-04 14:26:33 +00:00
Aleksander Morgado
f58dcc832b
iface-modem-3gpp: update packet service state in the interface
...
The skeleton property will be update automatically as they're bound.
2022-08-04 14:26:33 +00:00
Aleksander Morgado
d82f0d5371
iface-modem-simple: wait for packet service state is 3GPP specific
2022-08-04 14:26:33 +00:00
Aleksander Morgado
9746600a12
broadband-modem-qmi: force IDLE state if PS registered but DSD RAT unavailable
...
We provide a consolidated method to update the PS/EPS/5GS registration
states, based on the actual state reported via NAS and the availabiity
or not of the DSD data RAT.
On this consolidated method, we now force the IDLE state for every
case where it would have been HOME/ROAMING if the data RAT reported
via the DSD service is unknown. This includes not only transitions
into the HOME/ROAMING state, but also transitions to unknown data RAT.
2022-08-04 14:26:33 +00:00
Aleksander Morgado
86f6d33513
sim-mbim: clear cached subscriber info on modem sync request
2022-08-01 20:17:43 +00:00
Aleksander Morgado
f5b3dc7689
broadband-modem: notify when a sync is needed after a suspend/resume
...
Modem/SIM implementations that keep cached info that is not supposed
to change during runtime of a modem may need to be notified about when
a suspend/resume has happened, so that they can clear and reload the
internally cached data.
2022-08-01 19:51:26 +00:00
Aleksander Morgado
bda3ade5a8
iface-modem: reordering of ready methods in sync()
2022-07-29 15:07:45 +02:00
Aleksander Morgado
dd51defd2b
broadband-modem: quick sync the Modem interface also if disabled
...
If the modem was in disabled state, we still want to sync the Modem
interface, among other things to make sure no SIM event happened
during the system suspension.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/605
2022-07-29 15:06:49 +02: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