Age | Commit message (Collapse) | Author |
|
This improves SIM hot swap check process, and it can help avoid unnecessary
modem reprobe during suspend-resume without SIM inserted.
The changes in this CL implemented the new logic ONLY for MBIM, and the
new logic has not been implemented for QMI and AT yet. Thus, we keep the
legacy `mm_iface_modem_check_for_sim_swap()' till the new logic for QMI
and AT has been implemented.
|
|
ctx->supl is allocated in mm_shared_qmi_location_set_supl_server
using g_strdup. g_strdup requires to free string when unneeded.
The problem could be reproduced using following commands
```
while true; do
mmcli -m any --location-set-supl-server="supl.google.com:7276";
mem=$(cat /proc/$(pgrep ModemManager)/statm | awk '{print $6}')
echo $(date +"%s"), $mem | tee -a mm-leak.log;
done;
```
|
|
Since 503e886c02 the events on inactive SIMs don't trigger a full
modem reprobe, and the slot index check is fully unused.
|
|
registration wait
The cancellation_id will not be set if the cancellable is already
cancelled by the time g_cancellable_connect() is called.
|
|
register_in_network_cancelled() may be called early if the given
cancellable is already cancelled, and if so, we want it to remove the
timeout and signal handler, which should have been configured before
setting up the cancellation signal handler.
|
|
supported
When using qmi uim service from mbim broadband modem, a fallback from using
qmi uim service to normal mbim operations is done every time a call to
qmi_set_primary_sim_slot fails. But this may fall for various reasons,
and a fallback only makes sense when the device does not support that call
Patch reworked by Aleksander Morgado <aleksandermj@chromium.org>
|
|
We're bumping the current "INFO" level messages to the new "MSG"
level, also making the new level the default.
The old "INFO" level will be used to setup an intermediate level of
logging which is not as verbose as "DEBUG" but still provides some
capabilities to analyze the behavior of a modem.
|
|
Modem reports 2G+3G+4G+5G current modes, while 2G is not supported.
Consider device capabilities in deciding current modes.
|
|
Port to using g_autoptr() so that we avoid the gotos.
|
|
'SetPacketServiceState()'
|
|
|
|
Don't transfer state to the private info until we know the operation
has fully succeeded.
|
|
|
|
|
|
Always transition to the next step, and decide what to do based on the
state tracked by the previously run steps.
|
|
If for any reason "Refresh all" fails, don't return an error, as we
may have already configured SIM slot status correctly.
|
|
|
|
Also, don't make the "Get Slot Status" operation fatal; just go on
assuming that the slot status indications are unsupported.
|
|
Instead of connecting to the signal in multiple places, do it in one
single place in the logic.
|
|
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.
|
|
We no longer have separate mm_base_modem_process_sim_event() and
mm_broadband_modem_sim_hot_swap_detected() methods. The only
difference between both of them was that one of them would attempt to
cleanup the ports context associated to the SIM hot swap event logic
as soon as a swap was detected, in order to avoid queueing up multiple
such events.
The previous logic wasn't working well, though, as there could be
mixed AT+QMI or AT+MBIM devices that would also require that same
cleanup and so we didn't always know which one should have been
called.
Now we have a single mm_iface_modem_process_sim_event() method, which
will trigger the reprobe and disabling, but which will also perform
the cleanup of the SIM ports swap setup as specified by the
implementation.
So, if a plugin explicitly initializes the serial ports context for
SIM hot swap handling, it should also explicitly clean it up.
Also, the initialization of the serial ports context for SIM hot swap
handling is no longer done automatically for all modems, it will be
done only for those modems using it; i.e. the modems that explicitly
report support SIM hot swap handling using AT URCs.
|
|
The rights each contributor has are the ones stated by the GPL/LGPL,
not more and not less.
|
|
Recent ModemManager versions no longer work on the Samsung A5 (Qualcomm
MSM8916) smartphone: MM ends up in an infinite loop trying to probe the
modem over and over again.
Looking at the debug log it seems to be related to a "Slot Status"
indication that comes in during probe time and causes MM to restart
the probing process:
[/dev/wwan0qmi0] Sent generic request (translated)...
<< QMUX: service = "uim"
<< QMI: message = "Register Events" (0x002E)
<< TLV: translated = physical-slot-status
[/dev/wwan0qmi0] Received generic indication (translated)...
<< QMUX: service = "uim"
<< QMI: message = "Slot Status" (0x0048)
<< TLV: translated = { [0] = '[ physical_card_status = 'present', ...
[/dev/wwan0qmi0] Received generic response (translated)...
<< QMUX: service = "uim"
<< QMI: message = "Register Events" (0x002E)
<< TLV: translated = SUCCESS
[modem42] registered for slot status indications
[/dev/wwan0qmi0] Sent generic request (translated)...
<< QMUX: service = "uim"
<< QMI: message = "Get Slot Status" (0x0047)
[modem42] received slot status indication
[modem42] An active slot had a status change, will reprobe the modem
<infinite loop>
The "Slot Status" indication (uim_slot_status_indication_cb) arrives
immediately after starting to listen for the event, which is before
ModemManager has actually loaded the initial slot status in
uim_get_slot_status_ready. In this situation !slot_array_status_equal()
will always cause the modem to reprobe, even though it is not necessary
during the probe phase.
To fix this add a simple check to uim_slot_status_indication_cb() that
ignores the indication if the initial slot status was not loaded yet.
|
|
|
|
This type was introduced to avoid having GArrays of GArrays in libqmi.
|
|
This type was a JSON description bug in libqmi, it should have never
been a struct by itself. This was changed in libqmi by the 1.31.3
snapshot, so let's use the new methods instead of the deprecated ones.
|
|
Do not build the mask of "all" modes based only on the supported radio
interfaces, also filter out those modes that would not be available
based on the current capabilities enabled.
|
|
In GSM/UMTS+CDMA/EVDO multimode devices, the 4G and 5G mode switching
operations are exclusively limited to the capability selection that
has LTE+5GNR exclusively.
We cannot allow switching to 4G-only, 5G-only or 4G+5G if the current
capabilities have GSM/UMTS or CDMA/EVDO.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/503
|
|
|
|
|
|
The helper method for which we have unit tests available refers
exclusively to the current capabilities loading, so rename it to
clarify that.
|
|
multimode device
We use capability switching logic exclusively for configuring GSM/UMTS+CDMA/EVDO devices
(regardless of whether it has LTE/5GNR or not) to add or remove the GSM/UMTS and CDMA/EVDO
capabilities.
Based on the same logic, we will allow 4 combinations for GSM/UMTS+CDMA/EVDO+LTE+5GNR device:
"GSM/UMTS+CDMA/EVDO+LTE+5GNR", "GSM/UMTS+LTE+5GNR", "CDMA/EVDO+LTE+5GNR" and "LTE+5GNR"
Similarly, we will allow 4 combinations for GSM/UMTS+CDMA/EVDO+LTE device:
"GSM/UMTS+CDMA/EVDO+LTE", "GSM/UMTS+LTE", "CDMA/EVDO+LTE" and "LTE"
And, we will allow 3 combinations for GSM/UMTS+CDMA/EVDO device:
"GSM/UMTS+CDMA/EVDO", "GSM/UMTS" and "CDMA/EVDO"
Also, supported combination modes should be based on current capabilities and not entirely
upon supported radio interfaces.
1) If current capability has "gsm-umts" or "cdma-evdo" or both, do not
support 4G only, 5G only, or 4G+5G combination modes
2) If current capability neither has "gsm-umts" nor "cdma-evdo", only support
combination modes involving 4G and 5G.
|
|
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.
|
|
Implement support for the NR5G band list to get current NR5G bands.
This will also allow us to configure supported NR5G bands via mmcli.
|
|
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'
|
|
|
|
|
|
Support is added to set eid dbus interface property using
MBIM protocol when the inserted sim is esim.
|
|
==636642== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==636642== at 0x5282BAC: send (in /usr/lib/libpthread-2.33.so)
==636642== by 0x4EF20AF: UnknownInlinedFun (gsocket.c:3426)
==636642== by 0x4EF20AF: g_socket_send_with_blocking (gsocket.c:3529)
==636642== by 0x4EDF176: g_output_stream_write (goutputstream.c:242)
==636642== by 0x4EDF2D4: g_output_stream_write_all (goutputstream.c:301)
==636642== by 0x4A5CDAC: endpoint_send (qmi-endpoint-qmux.c:409)
==636642== by 0x4A5B963: qmi_endpoint_send (qmi-endpoint.c:225)
==636642== by 0x4A55408: qmi_device_command_abortable (qmi-device.c:2897)
==636642== by 0x4A554C3: qmi_device_command_full (qmi-device.c:2923)
==636642== by 0x4B52664: qmi_client_nas_set_system_selection_preference (qmi-nas.c:61099)
==636642== by 0x1F6FDC: register_in_network_sssp (mm-shared-qmi.c:455)
==636642== by 0x1F71E6: mm_shared_qmi_3gpp_register_in_network (mm-shared-qmi.c:505)
==636642== by 0x19FCF0: mm_iface_modem_3gpp_register_in_network (mm-iface-modem-3gpp.c:484)
==636642== Address 0x880a3b3 is 19 bytes inside a block of size 32 alloc'd
==636642== at 0x484383F: realloc (vg_replace_malloc.c:1192)
==636642== by 0x50DC130: g_realloc (gmem.c:171)
==636642== by 0x50A067C: g_array_maybe_expand (garray.c:1009)
==636642== by 0x50A0A0C: UnknownInlinedFun (garray.c:520)
==636642== by 0x50A0A0C: g_array_append_vals (garray.c:509)
==636642== by 0x50A0A9E: g_byte_array_append (garray.c:2430)
==636642== by 0x4A4B70D: qmi_message_tlv_write_guint8 (qmi-message.c:686)
==636642== by 0x4B14CA8: __qmi_message_nas_set_system_selection_preference_request_create (qmi-nas.c:33477)
==636642== by 0x4B525B6: qmi_client_nas_set_system_selection_preference (qmi-nas.c:61087)
==636642== by 0x1F6FDC: register_in_network_sssp (mm-shared-qmi.c:455)
==636642== by 0x1F71E6: mm_shared_qmi_3gpp_register_in_network (mm-shared-qmi.c:505)
==636642== by 0x19FCF0: mm_iface_modem_3gpp_register_in_network (mm-iface-modem-3gpp.c:484)
==636642== by 0x1B0BD4: check_next_registration (mm-iface-modem-simple.c:154)
|
|
Prior to this change, a hotswap on the inactive slot would result
in reprobe of the modem. With this change, the sim object would be
updated, but no reprobe will be performed. The advantage is
1) we do not drop connections on the active slot
2) Slot status on the inactive slot is susceptible to firmware bugs.
We have seen scenarios where the inactive slot is reported as
absent/ iccid={0}, followed by a correction. We should not
reprobe the modem if our active slot hasn't changed.
|
|
|
|
Use the new generic FCC unlock step instead of implementing it within
the operating mode setup logic.
The operation is implemented in the MMSharedQmi interface as it will
also be used by the MBIM modem object.
|
|
Set the MNC PCS digit status when attempting to register to a network
with 3 digit MNC and MNC < 100.
|
|
MNC digit count information is lost on conversion to integers. Make it
possible for the caller to get this information through a separate
boolean.
|
|
move the modem_load_model() async method from mm-broadband-modem-qmi.c
to mm-shared-qmi.c, and then make use of the method from both the QMI
and MBIM implementations.
|
|
Fixes issue 364.
|
|
This is now a requirement when using glib 2.56.
|
|
MM used to iterate over each SIM slot to load IMSI, operator name etc.
However, switching slots at start up caused a few issues in the real
world.
a) Sierra Wireless' AUTO-SIM feature, the hidden SIM slot switching
is actually triggering a full modem reset (because the firmware
detects a new SIM for a different operator, and automatically resets
itself to load the firmware+carrier config associated to that other
operator).
b) The IMSI on slot 2 is reported to be the same as slot 1.
This is solved by adding a 1000ms delay before reading IMSI
on slot 2, after GET_CARD_STATUS indicates the sim is ready. The
delay means a 2s startup penalty when both slots are loaded.
c) 2/5 developers have encountered a fw bug where the modem
incorrectly reports that the SIM on slot 1 has vanished
after the sequence of slot switches. This makes the modem
unusable.
d) If the eSIM daemon changes slots and opens a channel to the eUICC,
MM will detect a hotswap, and break the channel during reprobe.
e) SIMs from a certain large operator in the US take over 20s to be
ready. Thus, switching to such a SIM for just loading IMSI may not be
worth it.
This change does not affect detection of sims in all slots. We still
expose the iccid and presence of all sims. However, properties like
IMSI and operator_name will not be exposed for the inactive slot.
|
|
|
|
The acquisition order preference TLV must always have the same number
of elements, just the order of the elements should be different.
Also, always prefer the acquisition order preference TLV to the
GSM+WCDMA specific one, which is the same logic the modem applies.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/340
|