Commit Graph

8343 Commits

Author SHA1 Message Date
Akash Aggarwal
cce9ba475d mm-broadband-modem-qmi: do not set "enable refresh" in PDC "register" QMI message
If "enable refresh" is set, QMI modem expects an acknowledgement upon receiving a PDC refresh indication,
otherwise the modem resets assuming clients are facing an issue in refreshing their cache.

Register for PDC refresh indication without setting "enable refresh" TLV.
We would still receive the refresh indication to notify that the list of profiles stored has changed and
would not have to acknowledge the modem.
2022-10-27 11:07:07 +05:30
Aleksander Morgado
6711cdbbf5 build: require libqmi 1.32.0 and libmbim 1.28.0 2022-10-26 13:27:00 +00:00
Aleksander Morgado
ec28c85a6a build: bump version to 1.19.900 (1.20-rc1) 2022-10-19 11:25:33 +00:00
Aleksander Morgado
72f72d0bfd NEWS: update for 1.20.0 2022-10-19 11:18:38 +00:00
Aleksander Morgado
decf2370db AUTHORS: update for 1.20 2022-10-19 11:18:38 +00:00
Aleksander Morgado
4eb6a39654 RELEASING: update to use meson based steps 2022-10-19 11:18:38 +00:00
Aleksander Morgado
c73cbcc309 core: update copyright years 2022-10-19 11:18:38 +00:00
Aleksander Morgado
68123ac875 mmcli: update copyright years 2022-10-19 11:18:38 +00:00
Aleksander Morgado
fff4b95364 docs,reference: update copyright years 2022-10-19 11:18:38 +00:00
Akash Aggarwal
034383a650 broadband-modem-qmi: support for setting up signal thresholds 2022-10-18 15:54:37 +05:30
Alexey Orishko
1c4ba76295 plugin, telit: set last band to EUTRAN_85
Modems based on MDM9205 chipset support LTE Band 85, thus last define
was changed to reflect that band
2022-10-17 10:39:20 +00:00
Alexey Orishko
8ecc0f64e4 plugin, telit: add support for LPWA modem
- properly identity access technology for Cat-M and NB-IoT RATs
2022-10-17 10:39:20 +00:00
Fanice.luo
908ab33328 foxconn: updating the T77W968 requires MCFG+APPS version
updating T77W968(0x413c:0x81d7 ; 0x413c:0x81e0 ; 0x413c:0x81e4 ;
0x413c:0x81e6): supports FASTBOOT and QMI PDC, and requires MCFG+APPS
version.
2022-10-17 10:03:31 +00:00
Sven Schwermer
1ef46a6886 fibocom: Don't disconnect initial EPS bearer
During profile setup, the profile manager normally disconnects a profile
before re-using it. We do not want to do this for the initial EPS bearer
because that would trigger de-registration.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer
71a9739f1d fibocom: Set initial EPS bearer CID for MA510
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer
c509159dfe fibocom: Add initial EPS bearer support
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer
855977c4c7 fibocom: Implement power down/off
Also bump the timeout for the +CFUN operations as they may take up to
10s according to the AT command manual (e.g. MA510).

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:30 +00:00
Sven Schwermer
e5bb33a463 fibocom: Monitor connection status using +GTRNDIS?
In situations where the configured APN for the initial EPS bearer
(cid=1) does not match the APN for the actual connection, ModemManager
sets up a context (cid!=1) with the proper APN when connecting. If the
APN for the initial EPS bearer was not valid, the SIM may fall back to a
default one. If that default matches the APN for the proper connection,
the initial EPS bearer is re-used for the actual connection. In that
scenario, +CGACT? will report deactivated for the actual connection
context (cid!=1). ModemManager subsequently reports the connection as
disconnected.

+GTRNDIS? will always reflect the correct state for the context ID we
used to set up the ECM connection. Hence, it makes sense to use this
command to assess the connection status.

This has been tested with the MA510-GL modem module.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:30 +00:00
Akash Aggarwal
04ed52a74c mm-iface-modem: always require a SIM card in 3GPP modules
Avoid removing 3GPP capabilities if sim is absent.
Transition to 'Failed' state for 3GPP capable devices if sim is absent.
2022-10-11 11:55:28 +05:30
Aleksander Morgado
ead9f1809f fcc-unlock: add FCC unlock support for Quectel EM05-G
Using the FCC unlock prepared and tested by:
 Leah Oswald <mail@leahoswald.de>,

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/640
2022-10-10 12:09:28 +00:00
Fanice.luo
fab0481027 foxconn: remove QMI_SERVICE_FOX from Generic MBIM modem object
Allocate the fox_client to attempt loading the firmware info using
QMI_SERVICE_FOX,and release it when no longer needed.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/599
2022-10-10 11:46:57 +00:00
Jürgen Benvenuti
a93c1f6f19 i18n: Update German translation
Translated and proofread by the GNOME German translation team.
2022-10-10 08:21:02 +00:00
Aleksander Morgado
1db9cf4689 sms-part-3gpp: coding style fixes 2022-10-06 09:18:38 +00:00
Aleksander Morgado
795103cf3a broadband-modem-mbim: ensure message array contains valid PDUs
When reading SMS PDUs during initialization or upon a notification of
a new PDU arriving, we should ensure that the array of messages
returned is of type PDU, and also validate whether the array contains
valid PDUs before processing them, otherwise we could be dereferencing
invalid memory.

This is trying to fix crashes like the following:

    0x000059502b7ebaa2(ModemManager -mm-broadband-modem-mbim.c:7816)add_sms_part
    0x000059502b7f5cf5(ModemManager -mm-broadband-modem-mbim.c:7849)sms_read_query_ready
    0x000079e48edb36d3(libgio-2.0.so.0 -gtask.c:1230)g_task_return_now
    0x000079e48edb2732(libgio-2.0.so.0 -gtask.c:1300)g_task_return
    0x000079e48ee64ce5(libmbim-glib.so.4 -mbim-device.c:240)transaction_task_complete_and_free
    0x000079e48ee6665f(libmbim-glib.so.4 -mbim-device.c:1017)data_available
    0x000079e48ec65463(libglib-2.0.so.0 -gmain.c:3417)g_main_context_dispatch
    0x000079e48ec6576e(libglib-2.0.so.0 -gmain.c:4211)g_main_context_iterate
    0x000079e48ec659e2(libglib-2.0.so.0 -gmain.c:4411)g_main_loop_run
    0x000059502b7796b1(ModemManager -main.c:217)main
    0x000079e48e9f77a7(libc.so.6 + 0x000227a7)__libc_start_main
    0x000059502b7794b9(ModemManager + 0x0005f4b9)_start
    0x00007ffef825c6a7
2022-10-06 11:12:48 +02:00
Aleksander Morgado
125ef27274 sim-mbim: fix race condition when sync requested during preload
This is an extremely tricky race condition.

 * During SIM object initialization, we try to load SIM type (first
   item loaded).
 * MMSimMbim SIM type loading step runs preload_subscriber_info(),
   which:
   ** Sets self->priv->preload = TRUE; so that it is not run anymore.
   ** Sets the sync monitor to clear preloaded info if sync needed.
   ** Runs the subscriber ready status operation asynchronously.
   ** Just before the subscriber ready status operation returns, the
      system goes to sleep.
   ** The resume logic kicks in, and we flag the modem with sync
      needed, which clears the self->priv->preload flag.
 * Then the subscriber ready status operation response arrives, and we
   store the IMSI and the other things.
 * When the next initialization step happens, given that
   self->priv->preload is cleared, we run attempt to run
   preload_subscriber_info() again, and this time it finds the info like
   IMSI is already set, so asserts:

    0x00007cbcd287523f (libglib-2.0.so.0 - gtestutils.c: 3253)      g_assertion_message
    0x00007cbcd28752a2 (libglib-2.0.so.0 - gtestutils.c: 3279)      g_assertion_message_expr
    0x00005cbdab0a2dc0 (ModemManager - mm-sim-mbim.c: 253)  subscriber_ready_status_ready
    0x00007cbcd29a173b (libgio-2.0.so.0 - gtask.c: 1230)    g_task_return_now
    0x00007cbcd29a0799 (libgio-2.0.so.0 - gtask.c: 1300)    g_task_return
    0x00007cbcd2a548e0 (libmbim-glib.so.4 - mbim-device.c: 264)     transaction_task_complete_and_free
    0x00007cbcd2a562fc (libmbim-glib.so.4 - mbim-device.c: 1047)    data_available
    0x00007cbcd28534a6 (libglib-2.0.so.0 - gmain.c: 3417)   g_main_context_dispatch
    0x00007cbcd28537b1 (libglib-2.0.so.0 - gmain.c: 4211)   g_main_context_iterate
    0x00007cbcd2853a25 (libglib-2.0.so.0 - gmain.c: 4411)   g_main_loop_run
    0x00005cbdab034d26 (ModemManager - main.c: 217) main
    0x00007cbcd25e16c5 (libc.so.6 + 0x000286c5)     __libc_init_first
    0x00007cbcd25e1781 (libc.so.6 + 0x00028781)     __libc_start_main
    0x00005cbdab034a40 (ModemManager + 0x00061a40)  _start

In order to solve this, upon a sync request the ongoing preload
operation will be cancelled.
2022-10-05 13:12:09 +00:00
Aleksander Morgado
eee9a6f6b4 iface-modem-3gpp: disallow Scan() or Register() if Locked
We are exporting the 3GPP interface even when locked, so we should
cleanly disallow the Scan() and Register() operations on that state,
instead of wrongly assuming they may never happen.

  0x00007c192134944a (libc.so.6 + 0x0003744a)     gsignal
  0x00007c19213344e8 (libc.so.6 + 0x000224e8)     abort
  0x00007c19215c4221 (libglib-2.0.so.0 - gtestutils.c: 3253)      g_assertion_message
  0x00007c19215c4284 (libglib-2.0.so.0 - gtestutils.c: 3279)      g_assertion_message_expr
  0x00005b3eec9c9fbc (ModemManager - mm-iface-modem-3gpp.c)       handle_scan_auth_ready
  0x00007c19216ef75b (libgio-2.0.so.0 - gtask.c: 1230)    g_task_return_now
  0x00007c19216ee7b9 (libgio-2.0.so.0 - gtask.c: 1300)    g_task_return
  0x00005b3eec99a5ef (ModemManager - mm-dispatcher-fcc-unlock.c: 69)      dispatcher_run_ready
  0x00007c19216ef75b (libgio-2.0.so.0 - gtask.c: 1230)    g_task_return_now
  0x00007c19216ef78e (libgio-2.0.so.0 - gtask.c: 1244)    complete_in_idle_cb
  0x00007c19215a2486 (libglib-2.0.so.0 - gmain.c: 3417)   g_main_context_dispatch
  0x00007c19215a2791 (libglib-2.0.so.0 - gmain.c: 4211)   g_main_context_iterate
  0x00007c19215a2a05 (libglib-2.0.so.0 - gmain.c: 4411)   g_main_loop_run
  0x00005b3eec998451 (ModemManager - main.c: 217) main
  0x00007c19213347a7 (libc.so.6 + 0x000227a7)     __libc_start_main
  0x00005b3eec998259 (ModemManager + 0x00060259)  _start

Fixes 83e7600a67
2022-10-05 11:04:20 +00:00
Aleksander Morgado
976a3d4d82 libmm-glib,common-helpers: minor coding style fix in mm_new_iso8601_time() 2022-10-05 09:07:06 +00:00
Aleksander Morgado
bfba265009 libmm-glib,common-helpers: don't assume new_from_unix_utc() always succeeds
The g_date_time_new_from_unix_utc() method in glib2 may fail if the
given timestamp is too far into the future. The value is supposed to
be seconds since unix time origin, but internally it will be converted
into usecs, so any value longer than G_MAXINT64 / USEC_PER_SECOND
isn't allowed.

This is currently used in the CLI, and we're anyway ignoring the error
returned in that case, but at least it won't crash if it ever happens.
2022-10-05 09:06:22 +00:00
Angus Ainslie
4628056a3e mm-modem-helpers.c: adjust the RING regex
The Broadmobi BM818 has some additional carriage returns in the RING message

Fixes: #626

Signed-off-by: Angus Ainslie <angus@akkea.ca>
2022-09-30 14:29:39 -06:00
Aleksander Morgado
a74f11ae43 sim-mbim: fallback to AT commands if reading GID via MBIM fails
Older MBIM modems don't support the low level UICC reading extension
defined by Microsoft. In those case, fallback to reading the GID
values using AT commands wherever possible.
2022-09-30 13:51:56 +00:00
Aleksander Morgado
fa6d64550b base-sim: implement GID1 and GID2 loading using AT commands 2022-09-30 13:51:56 +00:00
Carlo Lobrano
651ddb95d1 plugins,telit: LM940 has LTE band ext after given version
Currently, LM940 is expected to have not LTE band extended, however they
have been introduced since version 24.01.516.

This change adds a software revision compare function for Telit modem
limited to LM9x0 modems (LM940 and LM960 share the same revision format
string) to verify if the current LM940 software revision is equal or
newer than 24.01.516 and enable/disable LTE band extended accordingly.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
072c8eba9e plugins,telit: LM960 has LTE extended bands 2022-09-29 07:03:37 +00:00
Carlo Lobrano
7f82c38dcb plugins,telit: Detect alternate_3g_bands flag from modem model
Currently, mm-shared-telit:Private:alternate_3g_bands value provided via
ID_MM_TELIT_BND_ALTERNATE tag.

This commit maps the value of alternate_3g_bands to the modem model,
detected via software version string.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
72ca66765f plugins,telit: Detect ext_4g_bands flag from modem model
Currently, mm-shared-telit:Private:ext_4g_bands value is inferred from
the #BND? response, based on the convention that the #BND? response has
4 tokens only if the modem has LTE extended bands.

This commit maps the value of ext_4g_bands to the modem model, detected
via software version string, which is a more reliable source.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
b0c5756b0f plugins,telit: Add MM_TELIT_MODEL_FN990 2022-09-29 07:03:37 +00:00
Carlo Lobrano
049c5ab277 plugins,telit: remove unnecessary argument
is_bnd_4g_format_hex() function does not need MMBaseModem.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
3ab3d5e899 plugins,telit: refactor to reduce scope of variable
In mm_telit_build_bnd_request the scope of some 3g related variables can
be reduced.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
a55384d7b0 plugins,telit: refactor functions dealing with #BND
Currently functions dealing with #BND request

- mm_telit_parse_bnd_query_response
- mm_telit_parse_bnd_test_response
- mm_telit_build_bnd_request

have all a long list of arguments configuring how to deal with the BND
string.

This commit reworks this list of arguments into a single new structure
"MMTelitBNDParseConfig" with the following advantages

- shorter list of arguments for the above functions
- future changes to this arguments will be transparent for the functions
  above that only pass the values
- one single point where the structure is created: a new function
  mm_shared_telit_get_bnd_parse_config.
2022-09-29 07:03:37 +00:00
Christian Taedcke
99cde83942 cinterion: Fix CDC-ECM support for ELS61-E2
When the data connection is started with AT^SWWAN, the modem expects
the DHCP discover packet from the TE while the command is running,
i.e. while the modem has not replied yet. In order to achieve that,
the bearer is marked as connected as soon as the command is
issued. This makes the NetworkManager start the DHCP process.

If the modem replies with an error, the bearer will be marked
disconnected later on.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/50
for a similar functionality in the ublox driver.

Includes minor coding style fixes from Aleksander Morgado
<aleksandermj@chromium.org>.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2022-09-28 10:47:45 +00:00
Christian Taedcke
a25b45f795 cinterion: add support for mode setting using SXRAT
The previously used COPS command to set to LTE-only mode did not work
for an ELS81 modem.
Now ^SXRAT is used to switch modes instead of COPS, if SXRAT is
supported by the modem.
2022-09-28 10:26:08 +00:00
Sven Schwermer
fcd393a6c2 quectel: Trigger reprobe upon RDY URC
Apparent self-resets without re-enumeration have been observed on
Quectel modems EC21 and EG91. See #285 and
https://lists.freedesktop.org/archives/modemmanager-devel/2022-September/009407.html

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/285

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-09-28 09:22:55 +00:00
Aleksander Morgado
2c66d43bb9 broadband-modem-qmi: select last used level when enabling SAR
Same as we do in the MBIM protocol implementation.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
1ea5a577e3 iface-modem-sar: report updated level on SAR enable
The SAR enable operation may be selecting an explicit SAR level by
itself, so make sure the protocol implementation reports back to the
interface the default level that was used while enabling SAR.

No level change is reported in the interface if the SAR is being
disabled.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
950d36d4ee iface-modem-sar: avoid changing level if already in the target level 2022-09-27 08:28:07 +00:00
Aleksander Morgado
72457c25f4 iface-modem-sar: avoid changing state if already in the target state 2022-09-27 08:28:07 +00:00
Aleksander Morgado
b50c24acd1 iface-modem-sar: disallow changing SAR level if SAR disabled
This was already forbidden in the MBIM implementation, and we should
also have it in the QMI implementation, so just make it a generic
check in the interface.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
0994087f18 iface-modem-sar: fix set power level async method completion
Not a big deal because both enable_finish() and set_power_level()
finish were doing the same thing until a recent change.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
258b8f8ee5 broadband-modem-qmi: attempt to preallocate SAR client
Otherwise the SAR support check will fail.
2022-09-27 08:28:07 +00:00
Madhav
04e7f777be broadband-modem-qmi: Implement the SAR interface
Implement the sar interface for QMI modems.
2022-09-27 08:28:07 +00:00