Commit Graph
9058 Commits
Author SHA1 Message Date
Stig M. Baugstø 5056ee0d7b bearer-qmi: use QMI port to check for connection status polling
Signed-off-by: Stig M. Baugstø <1129097-stigma@users.noreply.gitlab.freedesktop.org>
2024-10-24 15:26:02 +02:00
Stig M. Baugstø 1050e7a49e simtech: disable QMI PCO for SIM7100E preventing delayed modem crash
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/884

Signed-off-by: Stig M. Baugstø <1129097-stigma@users.noreply.gitlab.freedesktop.org>
2024-10-24 15:23:32 +02:00
Stig M. Baugstø 0c167a5124 cellient: new generic plugin for Cellient modems with optional QMI
Simple plugin handling Cellient (vid 0x2692) modems. Optional QMI
through the WITH_QMI compile flag. Disables QMI WDS PCO for the
Qualcomm-branded MPL200 by setting the ID_MM_QMI_PCO_DISABLED udev
tag, effectively preventing a modem crash.

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

Signed-off-by: Stig M. Baugstø <1129097-stigma@users.noreply.gitlab.freedesktop.org>
2024-10-24 15:21:57 +02:00
Stig M. Baugstø 78508b7dce bearer-qmi: add udev device tag ID_MM_QMI_PCO_DISABLED to disable PCO
Some modems like the Qualcomm-based Cellient MPL200 and SimTech
SIM7100E will crash some time after requesting operator reserved PCO.
The new udev tag ID_MM_QMI_PCO_DISABLED disables the PCO settings
request when set, indirectly disabling PCO.

Signed-off-by: Stig M. Baugstø <1129097-stigma@users.noreply.gitlab.freedesktop.org>
2024-10-24 15:21:02 +02:00
Aleksander Morgado ea9438ab98 device: log vid:pid information at msg level
The vid:pid information of a given device is useful information,
especially when analyzing user provided logs.

This change makes the vid:pid information be included at msg level in
the same message that reports the plugin in use. It also removes some
redundant messages.
2024-10-21 09:41:14 +00:00
Aleksander Morgado 6c1888f76c iface-modem-3gpp: fix crash when trying to set unknown power state
Certain QMI-based USB modems will report an "unknown" power state upon
boot, before our first attempt to set one:

  $ sudo qmicli --dms-get-operating-mode -d /dev/cdc-wdm0 -p
  [/dev/cdc-wdm0] Operating mode retrieved:
       Mode: 'unknown'
       HW restricted: 'no'

Due to this, the logic trying to recover the previous power state
during an attach settings update would end up asserting:

  [modem3] set initial EPS bearer settings state (3/5): recover previous power state
  **
  ERROR:../src/mm-iface-modem.c:4554:mm_iface_modem_set_power_state:
  code should not be reached
  Bail out! ERROR:../src/mm-iface-modem.c:4554:mm_iface_modem_set_power_state:
  code should not be reached
  Aborted

This is a rare case, and instead of handling it in the QMI specific
implementation, we can try to fix it in a safer way directly in the
logic that handles the attach settings update. If we ever detect that
the reported power state is "unknown", we will default it to "on"
while emitting a warning.
2024-10-21 09:14:00 +00:00
Aleksander Morgado 891b1a41f9 plugin-manager: disallow port additions to an already cancelled device context
If the DeviceContext is cancelled, we remove it from the list of
tracked DeviceContexts in the MMPluginManager, so that new port
additions happening at the same time don't end up being added to
it.

This should allow an early cancellation of the DeviceContext without
asserting on g_assert (!device_context->extra_probing_time_id) as
there is no chance that a new port addition has reseted the extra
probing time timeout.

    0x00007c1154f16abf (libc.so.6 - pthread_kill.c: 44)	__pthread_kill_implementation
    0x00007c1154ecbf0c (libc.so.6 - raise.c: 26)	raise
    0x00007c1154eb74aa (libc.so.6 - abort.c: 79)	abort
    0x00007c11556c08a9 (libglib-2.0.so.0 - gtestutils.c: 3450)	g_assertion_message
    0x00007c11556c091d (libglib-2.0.so.0 - gtestutils.c: 3476)	g_assertion_message_expr
    0x00005897d1ed6e7b (ModemManager - mm-plugin-manager.c: 805)	device_context_unref
    0x00005897d1ed6ab9 (ModemManager - mm-plugin-manager.c: 163)	common_async_context_free
    0x00005897d1ed5dd6 (ModemManager - mm-plugin-manager.c: 1136)	port_context_run_ready
    0x00007c1155550e86 (libgio-2.0.so.0 - gtask.c: 1309)	g_task_return_now
    0x00007c115554fe50 (libgio-2.0.so.0 - gtask.c: 1378)	g_task_return
    0x00007c115555047b (libgio-2.0.so.0 - gtask.c: 2022)	g_task_return_new_error
    0x00005897d1ed581a (ModemManager - mm-plugin-manager.c: 296)	port_context_complete
    0x00005897d1ed6259 (ModemManager - mm-plugin-manager.c)	plugin_supports_port_ready
    0x00007c1155550e86 (libgio-2.0.so.0 - gtask.c: 1309)	g_task_return_now
    0x00007c1155550eb9 (libgio-2.0.so.0 - gtask.c: 1323)	complete_in_idle_cb
    0x00007c115569c91b (libglib-2.0.so.0 - gmain.c: 3460)	g_main_dispatch
    0x00007c115569c91b (libglib-2.0.so.0 - gmain.c: 4200)	g_main_context_dispatch
    0x00007c115569cc37 (libglib-2.0.so.0 - gmain.c: 4276)	g_main_context_iterate
    0x00007c115569ceb5 (libglib-2.0.so.0 - gmain.c: 4479)	g_main_loop_run
    0x00005897d1e715bf (ModemManager - main.c: 236)	main
    0x00007c1154eb7705 (libc.so.6 - libc_start_call_main.h: 58)	__libc_start_call_main
    0x00007c1154eb77c1 (libc.so.6 - libc-start.c: 360)	__libc_start_main_impl
    0x00005897d1e70f10 (ModemManager + 0x000b3f10)	_start
    0x00007ffd5acc5057

Manually reproducing this issue was challenging, so adding here the
steps taken, for reference. This is with ModemManager running with
--no-udev (i.e. port additions reported via mmcli). The key to
reproduce the problem is the different timing between the port
additions and removals of the three ttyACM ports.

  COUNT=1
  while ((COUNT < 10000)); do
      echo "$COUNT..."
      COUNT=$((COUNT + 1))
      (
          sudo mmcli --report-kernel-event="name=ttyACM0,subsystem=tty,action=add"
          TIMEOUT="0.0$(((RANDOM % 10) + 1))"
          sleep $TIMEOUT
          sudo mmcli --report-kernel-event="name=ttyACM0,subsystem=tty,action=remove"
      ) &
      (
          sudo mmcli --report-kernel-event="name=ttyACM1,subsystem=tty,action=add"
          TIMEOUT="0.0$(((RANDOM % 10) + 1))"
          sleep $TIMEOUT
          sudo mmcli --report-kernel-event="name=ttyACM1,subsystem=tty,action=remove"
      ) &
      (
          sudo mmcli --report-kernel-event="name=ttyACM2,subsystem=tty,action=add"
          TIMEOUT="0.0$(((RANDOM % 10) + 1))"
          sleep $TIMEOUT
          sudo mmcli --report-kernel-event="name=ttyACM2,subsystem=tty,action=remove"
      ) &
      TIMEOUT="0.0$(((RANDOM % 10) + 1))"
      sleep $TIMEOUT
      COUNT=$((COUNT + 1))
  done
2024-10-17 10:50:19 +00:00
Aleksander Morgado 7ec338dafe cinterion: fix propagating NULL GError
(ModemManager:2925): GLib-CRITICAL **: 09:21:32.082: g_propagate_error: assertion 'src != NULL' failed
  (ModemManager:2925): GLib-GIO-CRITICAL **: 09:21:32.083: g_task_return_error: assertion 'error != NULL' failed`

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/916
2024-10-17 09:11:11 +00:00
Aleksander Morgado edd9cc2e95 device: fix double free of the GDBusConnection
Fixes a16ad2757d
2024-10-16 23:45:22 +02:00
Aleksander Morgado 70e761d91c build: unstable release version bump to 1.23.12 2024-10-14 08:03:15 +00:00
Aleksander Morgado d1ed88638e api,enums: remove doc for undeclared enum value 2024-10-07 13:44:34 +00:00
Aleksander Morgado 1f828e3802 api: fix MM_BEARER_IP_FAMILY_ANY ABI break introduced in 1.20
The value was changed in commit 4ab2c80858 from
0xFFFFFFFF to 0xFFFFFFF7. Revert that ABI break.
2024-10-07 13:39:02 +00:00
Aleksander Morgado 0f2e86b2a6 docs: add missing references to sections file 2024-10-07 13:39:02 +00:00
Aleksander Morgado 80da775433 docs: add symbol indices for 1.22 and 1.24 2024-10-07 12:03:27 +00:00
Aleksander Morgado 93a57f0d3a docs: add 2024 as copyright year 2024-10-07 12:02:10 +00:00
Akula Susmitha f22d099f38 api,core,mmcli: Add new 'API' support to set-default-storage for SMS
API support has been added to set default storage for SMS.
Changes were made to get, set the deafult storage value.
2024-10-07 16:35:09 +05:30
Aleksander Morgado a63c300437 ublox: remove custom power operation synchronization logic
These are already synchronized at interface level, so there is already
a guarantee that they won't happen at the same time.
2024-09-30 11:07:20 +00:00
Aleksander Morgado 87dc3d36b4 quectel: remove custom power operation synchronization logic
The power up and down operations are already synchronized at
interface level, so there is already a guarantee that they won't
happen at the same time.

For the reset and power off operations, it is assumed that the modem
will either reset or power off, so there should be no need to sync
those operations with others, as the modem object will eventually go
away altogether in both cases.
2024-09-30 11:07:19 +00:00
Aleksander Morgado a16ad2757d device: don't attempt to export if bus connection has been lost
E.g. if aborting the initialization sequence.
2024-09-30 11:07:18 +00:00
Aleksander Morgado dfc0f8ebfd base-modem: override disable operations done before modem object removal
If we are going to inhibit the modem or fully reprobe it after a SIM
switch event, we should forbid further operations done with the modem
object.

This logic can be tested by queing different operations one after the
other, and then adding a last device inhibition ("override" operation)
that should trigger the early abort of all non-running operations,
e.g.:
  mmcli -m a -e &
  sleep 0.2
  mmcli -m a --3gpp-set-initial-eps-bearer-settings="apn=internet,ip-type=ipv4v6,force=true" &
  sleep 0.2
  mmcli -m a -d &
  sleep 0.2
  mmcli -m a -e &
  sleep 0.2
  mmcli -m a --set-power-state-low &
  sleep 0.2
  mmcli -m a -e &
  sleep 0.2
  mmcli -m a --inhibit

This previous sequence produces MM logs as follows:
  <dbg> [1726567756.430308] [modem0] [operation 22] default - enable: scheduled
  <dbg> [1726567756.430806] [modem0] [operation 22] default - enable: lock acquired
  <dbg> [1726567756.623746] [modem0] [operation 23] default - set-initial-eps-bearer-settings: scheduled
  <dbg> [1726567756.751743] [modem0] [operation 22] default - enable: lock released
  <dbg> [1726567756.752027] [modem0] [operation 23] default - set-initial-eps-bearer-settings: lock acquired
  <dbg> [1726567756.823739] [modem0] [operation 24] default - disable: scheduled
  <dbg> [1726567757.049581] [modem0] [operation 25] default - enable: scheduled
  <dbg> [1726567757.250165] [modem0] [operation 26] default - set-power-state: scheduled
  <dbg> [1726567757.450518] [modem0] [operation 27] default - enable: scheduled
  <dbg> [1726567757.676362] [modem0] [operation 28] override - disabling: override requested - no new operations will be allowed
  <dbg> [1726567757.678792] [modem0] [operation 24] default - disable: aborted early
  <dbg> [1726567757.679866] [modem0] [operation 25] default - enable: aborted early
  <dbg> [1726567757.680157] [modem0] [operation 26] default - set-power-state: aborted early
  <dbg> [1726567757.680496] [modem0] [operation 27] default - enable: aborted early
  <dbg> [1726567759.695780] [modem0] [operation 23] default - set-initial-eps-bearer-settings: lock released
  <dbg> [1726567759.695935] [modem0] [operation 28] override - disabling: lock acquired
  <dbg> [1726567759.872196] [modem0] [operation 28] override - disabling: lock released
2024-09-30 11:07:11 +00:00
Aleksander Morgado 0aef4c422f base-modem: new 'override' operation lock type
If a request to lock the operation with the override type arrives, all
pending operations will be immediately cancelled, and no new lock
requests will be allowed.
2024-09-30 11:07:05 +00:00
Aleksander Morgado 3510ffc418 iface-[modem|modem3gpp]: operation lock in all operations that change state
This logic can be tested by queing different operations one after the
other, e.g.:
  mmcli -m a -e &
  sleep 0.2
  mmcli -m a --3gpp-set-initial-eps-bearer-settings="apn=internet,ip-type=ipv4v6,force=true" &
  sleep 0.2
  mmcli -m a -d &
  sleep 0.2
  mmcli -m a -e &
  sleep 0.2
  mmcli -m a --set-power-state-low &
  sleep 0.2
  mmcli -m a -e &

This previous sequence produces MM logs as follows:
  <dbg> [1726567176.214906] [modem0] [operation 15] default - enable: scheduled
  <dbg> [1726567176.215108] [modem0] [operation 15] default - enable: lock acquired
  <dbg> [1726567176.436234] [modem0] [operation 16] default - set-initial-eps-bearer-settings: scheduled
  <dbg> [1726567176.554153] [modem0] [operation 15] default - enable: lock released
  <dbg> [1726567176.554492] [modem0] [operation 16] default - set-initial-eps-bearer-settings: lock acquired
  <dbg> [1726567176.619021] [modem0] [operation 17] default - disable: scheduled
  <dbg> [1726567176.840024] [modem0] [operation 18] default - enable: scheduled
  <dbg> [1726567177.037155] [modem0] [operation 19] default - set-power-state: scheduled
  <dbg> [1726567177.240225] [modem0] [operation 20] default - enable: scheduled
  <dbg> [1726567179.496397] [modem0] [operation 16] default - set-initial-eps-bearer-settings: lock released
  <dbg> [1726567179.496576] [modem0] [operation 17] default - disable: lock acquired
  <dbg> [1726567179.672141] [modem0] [operation 17] default - disable: lock released
  <dbg> [1726567179.672658] [modem0] [operation 18] default - enable: lock acquired
  <dbg> [1726567179.938481] [modem0] [operation 18] default - enable: lock released
  <dbg> [1726567179.940470] [modem0] [operation 19] default - set-power-state: lock acquired
  <dbg> [1726567182.147894] [modem0] [operation 19] default - set-power-state: lock released
  <dbg> [1726567182.148041] [modem0] [operation 20] default - enable: lock acquired
  <dbg> [1726567184.494469] [modem0] [operation 20] default - enable: lock released

iface-modem-3gpp: operation lock in all operations that change state
2024-09-30 11:07:02 +00:00
Aleksander Morgado be668462c0 base-modem: synchronize initialize/enable/disable/sync operations
Each of these now holds an exclusive lock, so all these operations are
synchronized.

This logic can be tested by queing different enable/disable operations
one after the other, e.g.:
  mmcli -m a -d &    --> Disable 1
  sleep 0.2
  mmcli -m a -e &    --> Enable 1
  sleep 0.2
  mmcli -m a -e &    --> Enable 2
  sleep 0.2
  mmcli -m a -d &    --> Disable 2
  sleep 0.2
  mmcli -m a -e &    --> Enable 3
  sleep 0.2
  mmcli -m a -d &    --> Disable 3

This previous sequence produces MM logs as follows:
  <dbg> [1726566352.936025] [modem0] [operation 9] default - disable:  scheduled     --> Disable 1 requested
  <dbg> [1726566352.936399] [modem0] [operation 9] default - disable:  lock acquired --> Disable 1 started
  <dbg> [1726566353.136445] [modem0] [operation 10] default - enable:  scheduled     --> Enable 1 requested
  <dbg> [1726566353.202980] [modem0] [operation 9] default - disable:  lock released --> Disable 1 finished
  <dbg> [1726566353.203526] [modem0] [operation 10] default - enable:  lock acquired --> Enable 1 started
  <dbg> [1726566353.320057] [modem0] [operation 11] default - enable:  scheduled     --> Enable 2 requested
  <dbg> [1726566353.440931] [modem0] [operation 10] default - enable:  lock released --> Enable 1 finished
  <dbg> [1726566353.443238] [modem0] [operation 11] default - enable:  lock acquired --> Enable 2 started
  <dbg> [1726566353.452984] [modem0] [operation 11] default - enable:  lock released --> Enable 2 finished
  <dbg> [1726566353.517512] [modem0] [operation 12] default - disable: scheduled     --> Disable 2 requested
  <dbg> [1726566353.517699] [modem0] [operation 12] default - disable: lock acquired --> Disable 2 started
  <dbg> [1726566353.688695] [modem0] [operation 12] default - disable: lock released --> Disable 2 finished
  <dbg> [1726566353.718237] [modem0] [operation 13] default - enable:  scheduled     --> Enable 3 requested
  <dbg> [1726566353.718417] [modem0] [operation 13] default - enable:  lock acquired --> Enable 3 started
  <dbg> [1726566353.937122] [modem0] [operation 14] default - disable: scheduled     --> Disable 3 requested
  <dbg> [1726566353.970791] [modem0] [operation 13] default - enable:  lock released --> Enable 3 finished
  <dbg> [1726566353.970964] [modem0] [operation 14] default - disable: lock acquired --> Disable 3 started
  <dbg> [1726566354.170938] [modem0] [operation 14] default - disable: lock released --> Disable 3 finished
2024-09-30 07:55:05 +00:00
Aleksander Morgado 8e0cbd9c94 base-modem: remove support for parallel enable/disable operations
Follow up changes will introduce support to run exclusive enable and
disable operations, effectively ensuring that only one enabling or
disabling task is processed at any given time, so the support for
completing parallel operations with the same result is no longer
needed.

That logic was anyway flawed, as it did not consider complex cases
like a disable request received between two enable requests, the order
of incoming requests was not maintained.

The main reason for adding the parallel enable/disable operation logic
was for the case where 2 separate users tried to enable the modem at
the same time. In that case, we did not want to run 2 separate
enabling operations from scratch, and completing one would complete
the second one as well. With the new operation lock logic, the same
result is achieved, as the 2nd enabling operation would find the modem
already enabled, if the 1st one succeeded.

This removal is done before introducing the new exclusive operation
support in the enable/disable path in order to make it easier and more
consistent with other operations that will also be included in the
synchronization.
2024-09-30 07:55:05 +00:00
Aleksander Morgado a24a6ee4c5 base-modem: add setup to allow exclusive operations
There are certain operations that cannot be run in parallel, e.g. one
should not disable and bring the modem to low power mode while there
are also incoming requests to enable the modem. This type of errors
will typically happen when multiple DBus clients are trying to use the
same modem at the same time for different purposes.

We do not have any way to have DBus clients take exclusive ownership
of a given modem object, so the best we can do for now is trying to
synchronize operations that cannot be run together, preserving the
order in which they arrived, and running them one by one.
2024-09-30 07:54:56 +00:00
Aleksander Morgado 8e8e88b75d broadband-modem: update modem state before disabling task is completed
The modem state property update was happening at disabling task context
free time, after the actual task completion has happened.

Avoid wrong assumptions on the modem state value in operations
scheduled after the task completion, in the same way as done in the
enabling sequence.
2024-09-30 07:51:53 +00:00
Aleksander Morgado 17929188d8 broadband-modem: update modem state before enabling task is completed
The modem state property update was happening at enabling task context
free time, after the actual task completion has happened. Due to this,
scheduling a new enable request right after finishing one would end up
with the logic asserting, as the new enable operation would be
scheduled while the modem was still reporting "enabling" state.

  ModemManager[7673]: <inf> [1722359278.131123] [modem0] processing user request to enable modem...
  **
  ERROR:../src/mm-broadband-modem.c:12487:enable: code should not be reached
  Bail out! ERROR:../src/mm-broadband-modem.c:12487:enable: code should not be reached
  Aborted
2024-09-30 07:51:53 +00:00
Michal Mazur a030eaef76 sim: add common helpers to parse operator name and mnc length 2024-09-25 12:08:40 +00:00
Michal Mazur 257839c66e sim-mbim: read operator name and id from SIM EF files
Currently the SIM operator name and code are read using the "Home
Provider" query operation which may perform network communication
to get name provided by operator. This may take long to complete
or even timeout. Solution is to read name and id from SIM card.
2024-09-25 12:08:40 +00:00
Dan Williams 64646b98cd plugins/quectel: support modem power operations for AT-based devices
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-24 23:52:13 -05:00
Aleksander Morgado a1f8045c53 build: require libmbim 1.31.5
We need a newer libmbim to handle the MBIM_CID_QDU_COMMAND operation
introduced for AT over MBIM in Quectel modems.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/892
2024-09-20 09:31:05 +00:00
Kamesh Relangi 7de52c0b79 qrtr-bus-watcher: Increase delay for probing
Sometimes Qualcomm modem is not detected because modem is up
after initial probing is completed.
Increase in wait time for probing to ensure that modem is up.
2024-09-18 20:53:37 +05:30
Dan Williams f19f20c008 helpers: consolidate some uses of mm_kernel_device_get_subsystem()
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-17 12:20:46 -05:00
Dan Williams 0b5f2adb4b port-probe: restart AT probing if "NO CARRIER" is received during QCDM probing
If the system and modem are independently powered, a system restart may
leave one of the modem's AT ports in PPP mode. On restart this may cause
AT probing to fail. The modem may terminate PPP after receiving bogus
HDLC frames from QCDM probing (since PPP also uses HDLC framing), and
return "NO CARRIER". We can use this to restart AT probing now that
PPP is down and auto-detect the expected additional AT ports.

Feb 08 20:22:53 ModemManager[385]: <debug> [1675887773.887574] [ttyUSB2/at] <-- '\8\158\239~'
Feb 08 20:22:54 ModemManager[385]: <debug> [1675887774.215054] [ttyUSB2/at] <-- '\8\214\137~'
Feb 08 20:22:54 ModemManager[385]: <debug> [1675887774.851349] [ttyUSB2/at] <-- '\8\250\177~'
Feb 08 20:22:55 ModemManager[385]: <debug> [1675887775.576776] [ttyUSB2/at] <-- '\8\168u~'
Feb 08 20:22:55 ModemManager[385]: <debug> [1675887775.612694] [ttyUSB2/at] <-- '\8w\25~'
Feb 08 20:22:55 ModemManager[385]: <debug> [1675887775.862886] [ttyUSB2/at] <-- '\8!&~'
Feb 08 20:22:56 ModemManager[385]: <debug> [1675887776.614747] [ttyUSB2/at] <-- '\8%\254~'
Feb 08 20:22:56 ModemManager[385]: <debug> [1675887776.686207] [ttyUSB2/probe] port is not AT-capable
Feb 08 20:22:56 ModemManager[385]: <debug> [1675887776.686447] [ttyUSB2/probe] probing QCDM...
Feb 08 20:22:56 ModemManager[385]: <debug> [1675887776.725483] [ttyUSB2/qcdm] --> 7e 00 78 f0 7e
Feb 08 20:22:56 ModemManager[385]: <debug> [1675887776.880941] [ttyUSB2/qcdm] <-- 0d 0a 4e 4f 20 43 41 52 52 49 45 52 0d 0a

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-17 11:26:06 -05:00
Dan Williams 7937a89a37 port-probe: rework and consolidate port probe flow for AT/QCDM/QMI/MBIM
Open the AT port from the regular port probe flow rather than doing
that one-off at the beginning of probing. That lets us re-open the AT
port later if needed, based on QCDM/QMI/MBIM probing results.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-17 11:23:01 -05:00
Dan Williams 6664d3740d port-probe: consolidate serial port closure and cleanup
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-17 11:11:23 -05:00
Lukas Voegl 76b48f6194 cinterion: implement FDL update method
Adds AT^SFDL based Firmware Download as an update method for supported Cinterion modems.

Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-09-16 12:26:18 +02:00
Aleksander Morgado a1214b5fd5 build: unstable release version bump to 1.23.11 2024-09-16 09:19:23 +00:00
Aleksander Morgado a1f2d8c99b broadband-modem-mbim: log hex value of IP type if unknown
The L850 seems to report 0xFFFFFFFF as MbimContextIpType value, which
is not a correct value.

Instead of printing "(none)" (the default used by glib when trying to
print a NULL pointer as a string), make it so that we end up printing
the actual numeric value in hex.

   <dbg> [modem0] 'home' settings found at configuration index 0
   <dbg> [modem0] 'non-partner' settings found at configuration index 1
   <dbg> [modem0] 'partner' settings not found
   <dbg> [modem0] updates in the home LTE attach configuration settings:
   <dbg> [modem0]   ip type: 'unknown (0xffffffff)' -> ''ipv4v6'
   <dbg> [modem0] updates in the partner LTE attach configuration settings:
   <dbg> [modem0]   none (skipped)
   <dbg> [modem0] updates in the non-partner LTE attach configuration settings:
   <dbg> [modem0]   none
2024-09-11 11:01:19 +00:00
Aleksander Morgado 4748ebf300 broadband-modem-mbim: update all home/partner/non-partner LTE attach settings
Instead of updating the attach settings associated with the home
network, update all three to the same values, so that network attach
while roaming uses the same settings as in home.

This is a major change in behavior; if there is ever a need to roll
back to the old behavior because a given device doesn't support this,
we can provided device-specific behaviors using the
load_set_initial_eps_bearer_settings_mask() virtual method.
2024-09-11 11:01:18 +00:00
Aleksander Morgado 8a5aab8be5 fibocom: L850 specific hack when using an AT&T 310280 SIM card
L850 modems running a firmware version less than 18500.5001.0.7 and
using AT&T SIM cards with MCCMNC 310280 do not support specifying
"partner" settings in the MBIM operation to set the LTE attach
configuration.
2024-09-11 11:01:18 +00:00
Aleksander Morgado 58f25ec5f9 broadband-modem-mbim: rework the logic to set LTE attach configuration
The ModemManager API provides a single method to update the attach
settings used in LTE registration, but in the MBIM protocol there are
three different distinct configurations associated with that
operation.

Until now we have exclusively updated the "home" settings, leaving the
"partner" and "non-partner" settings untouched (i.e. we loaded the
existing settings for these sections, and used the same ones when
providing our update operation).

Unfortunately, this logic does not fit all needs. Some modems will
require all 3 elements to be unconditionally updated, and some other
modems may need to fully skip one of the configuration sections.

The rework done in this commit does not change the behavior, but
provides the ability for subclasses to modify how the operation is
done, via a set of flags that is provided on each update attempt (as
sometimes the behavior is operator-specific).
2024-09-11 11:01:18 +00:00
Aleksander Morgado a5c15ec7d8 broadband-modem-mbim: rework home settings lookup in LTE attach config response
We look for the home settings, but also allow to optionally lookup for
the partner and non-partner settings, logging in each case if we find
anomalies (e.g. if not found or if found duplicated entries).
2024-09-11 11:01:18 +00:00
Aleksander Morgado 9d4eb8f1ba modem-helpers-mbim: minor coding style fix 2024-09-11 11:01:18 +00:00
Dan Williams 478e9645ca tests: test mm_split_string_groups()
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-10 19:03:31 -05:00
Dan Williams 1a43833d99 modem-helpers: remove duplicate include
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-09-10 19:03:31 -05:00
Kyle Evans 7fadbc0615 mm-sms-list: tag dbg messages with base sms identifier
This helps identify which base sms the message belongs to.

Previous
[modem0/sms-list] found existing multipart SMS object with reference
'126': adding new part

New
[modem0/sms0] found existing multipart SMS object with reference
'126': adding new part

Signed-off-by: Kyle Evans <kvans32@gmail.com>
2024-09-09 08:48:37 +00:00
Kyle Evans 7eca4583cd sms-part-3gpp: add the message timestamp in dbg
This aids in determining the age of messages stuck in receiving.

Signed-off-by: Kyle Evans <kvans32@gmail.com>
2024-09-09 08:48:37 +00:00
Kyle Evans ae88eeed49 mm-base-sms: cmp by reference & number
Messages from different senders can have the same reference.
Stale messages from the same sender can also conflict.

Consider the number of the sender and also the max parts
when assigning parts to a base sms.

Ref 3gpp specification section 9.2.3.24.1

Fixes #757

Signed-off-by: Kyle Evans <kvans32@gmail.com>
2024-09-09 08:48:37 +00:00
Lukas Voegl d763b94677 quectel: implement DFOTA update method 2024-09-09 08:26:15 +00:00