Commit Graph

4774 Commits

Author SHA1 Message Date
Aleksander Morgado
913022ed90 broadband-modem-mbim: MbimSmsStatusFlag is flags, not an enum
We can directly use this change instead of requiring the libmbim
version bump because the numeric values of the enum didn't change:
  NEW_MESSAGE == 2 == (1<<1)

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/673
2022-12-05 22:38:57 +00:00
Aleksander Morgado
b515f72bb0 base-sms: improve logging of user operations 2022-11-30 13:40:19 +00:00
Aleksander Morgado
bab798211a base-sms: refactor memory management in handlers
Use g_auto* helpers where needed, and switch to use the slice
allocator for the handler operation contexts.
2022-11-30 13:40:19 +00:00
Aleksander Morgado
c359a05219 iface-modem-messaging: improve logging of user operations 2022-11-30 13:40:19 +00:00
Aleksander Morgado
a962d63179 iface-modem-messaging: refactor memory management in handlers
Use g_auto* helpers where needed, and switch to use the slice
allocator for the handler operation contexts.
2022-11-30 13:40:19 +00:00
Aleksander Morgado
74441e8549 iface-modem-messaging: use the abort_invocation_if_state_not_reached() helper 2022-11-30 13:40:19 +00:00
Aleksander Morgado
ef6cf656f7 iface-modem-messaging: allow Delete operation during enabling/disabling
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/671
2022-11-30 13:02:07 +00:00
Akash Aggarwal
f4d867cd59 mm-sim-qmi: use UIM service for loading operator identifier and name
Output of NAS Get Home Network depends on network state, and we may fail
to read SIM card info if device is not attached.

Load card operator name and identifier using UIM Read Transparent.
2022-11-28 12:31:00 +00:00
Aleksander Morgado
f8e544483c broadband-modem-qmi: don't fail profile update indications setup if one client missing
Using mm_shared_qmi_ensure_client() ensures that the client must exist
or otherwise the operation would fail. Instead, try to peek the
clients independently with mm_shared_qmi_peek_client() and only fail
if both exist.

The state machine logic already treats the clients as optional.
2022-11-22 11:28:30 +00:00
Akash Aggarwal
65efdded07 mm-broadband-modem-qmi: register for profile change indication
Update profile manager and notify clients if there is a change in modem
profiles list.
2022-11-22 11:25:02 +00:00
Aleksander Morgado
49234bd235 broadband-modem-qmi: don't depend on other TLVs when processing Signal Info
When processing the NAS Signal Info message, don't assume that a
previously processed TLV creates the MMSignal object for a given
access technology.
2022-11-22 11:07:22 +00:00
Akash Aggarwal
f676420b57 mm-broadband-modem-qmi: update UMTS RSCP while loading signal values 2022-11-22 11:04:01 +00:00
okaestne
03df6d4021 mm-broadband-modem-qmi: fix Nr5g SNR value
value needs to be divided by 10 as for LTE
2022-11-22 09:57:00 +00:00
okaestne
695f83758d mm-broadband-modem-qmi: fully free SignalLoadValuesResult 2022-11-21 17:11:53 +01:00
SunXinzhao
b758c57030 broadband-modem-mbim: add AT based fallback to load model name
Modify the load_model function to use the AT command to get the
model name and display the module name in the model instead of
[vid:pid].
Test on L860 Linux Device, use `mmcli -L`, it can show: "/org/free
desktop/ModemManager1/Modem/0 [Intel] L860-GL-16 LTE Module"
2022-11-15 19:43:55 +00:00
okaestne
be6392c745 mm-broadband-modem-qmi: fix loading Nr5g signal info 2022-11-15 12:38:07 +01:00
Aleksander Morgado
00c40b5b3f context: include MSG log level in --help 2022-11-15 09:10:13 +00:00
Aleksander Morgado
4a2e13c16f test,modem-helpers-qmi: unit tests for NAS system info registration processing
Requires the response parser methods in libqmi.
2022-11-10 10:57:54 +00:00
Aleksander Morgado
55796d5824 broadband-modem-qmi: use new system info processor helper 2022-11-10 10:57:54 +00:00
Aleksander Morgado
ea160e3a3c modem-helpers-qmi: new helper to process System Info messages 2022-11-10 10:57:54 +00:00
Aleksander Morgado
7e0af1d99d modem-helpers: new method to check if reg state is registered 2022-11-10 10:47:33 +00:00
Aleksander Morgado
f446bd9dac broadband-modem-mbim: simplify caps loading logic by using autoptr 2022-11-10 09:35:09 +00:00
Daniele Palmas
e0fb1cb643 broadband-modem-mbim: use ms extensions, if available, for capabilities 2022-11-10 09:30:55 +00:00
Daniele Palmas
ea275d05e6 broadband-modem-mbim: add supported modes from CustomDataClass
Some modems (e.g. Telit FN990) reports 5G capabilities in CustomDataClass
field of device-caps cid: take this into account when building the
modes according to the data caps.
2022-11-10 09:30:55 +00:00
Aleksander Morgado
24fd0026ec iface-modem-3gpp: fix memory leak when processing PCOs
==109786== 2,798 (96 direct, 2,702 indirect) bytes in 2 blocks are definitely lost in loss record 5,882 of 5,903
  ==109786==    at 0x4841888: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==109786==    by 0x4A01329: g_malloc (gmem.c:130)
  ==109786==    by 0x4A23F17: g_slice_alloc (gslice.c:1074)
  ==109786==    by 0x4A4B8F8: UnknownInlinedFun (gvariant-core.c:488)
  ==109786==    by 0x4A4B8F8: UnknownInlinedFun (gvariant-core.c:626)
  ==109786==    by 0x4A4B8F8: g_variant_builder_end (gvariant.c:3756)
  ==109786==    by 0x48FD6DC: mm_pco_to_variant (mm-pco.c:251)
  ==109786==    by 0x1AB397: mm_iface_modem_3gpp_update_pco_list (mm-iface-modem-3gpp.c:2274)
  ==109786==    by 0x2306DF: ms_basic_connect_extensions_notification_pco (mm-broadband-modem-mbim.c:5101)
  ==109786==    by 0x2306DF: ms_basic_connect_extensions_notification (mm-broadband-modem-mbim.c:5280)
  ==109786==    by 0x2306DF: device_notification_cb (mm-broadband-modem-mbim.c:5332)
  ==109786==    by 0x4CD3BD6: g_cclosure_marshal_VOID__BOXEDv (gmarshal.c:1686)
  ==109786==    by 0x4CED11B: UnknownInlinedFun (gclosure.c:895)
  ==109786==    by 0x4CED11B: g_signal_emit_valist (gsignal.c:3456)
  ==109786==    by 0x4CED203: g_signal_emit (gsignal.c:3606)
  ==109786==    by 0x50ADA0F: indication_ready (mbim-device.c:870)
  ==109786==    by 0x4B92DD3: g_task_return_now (gtask.c:1232)
2022-11-08 21:29:56 +00:00
Aleksander Morgado
64c77e3114 bearer-mbim: remove explicit packet service set during attempt
An explicit packet service state update request sent during a
connection attempt may end up triggering an explicit re-attach with
the network, which in turn cancels the ongoing connection attempt.

The logic to trigger an explicit attach is now managed by the
Simple.Connect() operation, which will make sure that no new request
is sent if the modem is already attached, so there is no need for this
step in the MBIM connection logic any more.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/622
2022-11-08 14:25:32 +00:00
Aleksander Morgado
3e13044e10 broadband-modem-mbim: track uplink/downlink speeds only via indications
The uplink and downlink speeds will be exclusively tracked via packet
service indications, and stored within the MBIM modem object.

When the bearer connect result is built, we will include the latest
speeds reported, which may have changed upon the operation to connect
to the network.
2022-11-08 14:25:32 +00:00
Aleksander Morgado
c9bcaa3312 broadband-modem-mbim: translate UNSUPPORTED error during packet attach
So that the upper layers are allowed to decide what to do in case the
modem doesn't support the operation.
2022-11-08 14:25:32 +00:00
Aleksander Morgado
9f330da90b broadband-modem-mbim: return nw_error on packet service attach failure
If the packet attach operation fails we may still get the response
with a nw_error field telling us a more detailed error reason for the
failure. Try to parse the message and return an error including the
nw_error information.
2022-11-08 14:25:32 +00:00
Aleksander Morgado
d28d00f04f broadband-modem-mbim: increase to 30s the packet service set timeout
Same timeout as used in the connection attempt.
2022-11-08 14:25:32 +00:00
Aleksander Morgado
179a800ab6 iface-modem-simple: explicitly request packet service attach if needed
Instead of just waiting for the packet service to be attached, if we
waited and still didn't get it, an explicit request will be sent.
2022-11-08 14:25:32 +00:00
Aleksander Morgado
cabb003dd6 iface-modem-3gpp: allow internal request to set packet service
Provide a new internal method in the 3GPP interface to request an
explicit packet service state update.
2022-11-08 13:43:07 +00:00
Jack Song
347c25445c mm-broadband-modem-mbim: ignore SIM related indications during SIM slot switch
Using pending_sim_slot_switch_action to ignore SIM slot update during modem shutdown

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/645
2022-11-08 13:09:01 +00:00
Aleksander Morgado
f419f56628 build: drop autotools 2022-11-07 14:26:02 +00:00
Aleksander Morgado
634f6cbcbc build: disable Test interface in base manager if building without tests
There is no real need for this interface if tests are not being built.
2022-11-07 14:25:34 +00:00
Aleksander Morgado
7ea2452b1e build: fix building without tests support 2022-11-07 14:25:34 +00:00
Aleksander Morgado
fb13be6e0e base-modem: log port names and types detected 2022-11-04 13:12:58 +00:00
Aleksander Morgado
815e7f7c7e bearer-qmi: improve logging of connection failures
Clearly specify whether the IPv4 or IPv6 path is failing.
2022-11-04 13:12:58 +00:00
Aleksander Morgado
cd5c5d8374 iface-modem-3gpp: decrease severity of logs that don't affect functionality
Instead of warning about various unimportant things failing that don't
affect functionality, just print the logs in debug level and go on.
2022-11-04 13:12:58 +00:00
Aleksander Morgado
fa0cfd4c4d base-sim: include GID1/GID2 loaded values in info level 2022-11-04 13:12:58 +00:00
Aleksander Morgado
ceee8938e8 base-sim: decrease severity of logs that don't affect functionality
Instead of warning about various unimportant things failing that don't
affect functionality, just print the logs in debug level and go on.

E.g. this warning can be completely skipped:
 <wrn> [modem0/sim0] couldn't load GID2: Couldn't read data from UIM: QMI protocol error (16): 'NotProvisioned'
2022-11-04 13:12:58 +00:00
Aleksander Morgado
a872541259 iface-modem: decrease severity of logs that don't affect functionality
Instead of warning about various unimportant things failing that don't
affect functionality, just print the logs in debug level and go on.

E.g. this warning can be completely skipped:
 <wrn> [modem0] couldn't load list of own numbers: Couldn't get MSISDN: QMI protocol error (16): 'NotProvisioned'
2022-11-04 13:12:58 +00:00
Aleksander Morgado
c7fcc2dc2f broadband-modem: improve logging during SIM swap check
Log the contents loaded during the operation and treat them as
personal info so that they are hidden if needed.
2022-11-04 13:12:58 +00:00
Aleksander Morgado
20390488dd base-sim: improve logging during initialization
We will print all the loaded SIM contents, treating as personal info
the SIM ICCID, IMSI and EID.
2022-11-04 13:12:57 +00:00
Pavan Holla
1533112182 iface-modem-signal: print signal quality under INFO verbosity 2022-11-04 13:12:57 +00:00
Aleksander Morgado
ec5eb6c3ac iface-modem-simple: improve logging of user request to disconnect modem 2022-11-04 13:12:57 +00:00
Aleksander Morgado
794386d490 iface-modem-simple: improve logging of user request to connect modem 2022-11-04 13:12:57 +00:00
Aleksander Morgado
b5a727d086 iface-modem-sar: improve logging of user-requested actions 2022-11-04 13:12:57 +00:00
Aleksander Morgado
9d8e92b965 iface-modem-3gpp-profile-manager: improve logging of user request to delete profile 2022-11-04 13:12:57 +00:00
Aleksander Morgado
f75be75e5c iface-modem-3gpp-profile-manager: improve logging of user request to set profile 2022-11-04 13:12:57 +00:00