Commit Graph

8674 Commits

Author SHA1 Message Date
Nagi Marupaka
20a95cf428 mm-broadband-modem-mbim: treat "status error = `NotInitialized'" the same way as "ReadyState = 'sim-not-initialized'" 2023-09-18 16:52:24 +00:00
Lukas Voegl
8cd1c1bdb9 api,modem: new 'Physdev' property
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2023-09-18 10:53:12 +02:00
QuectelDuke
1fc061b6a5 quectel: Add RM520 with firehose support
Signed-off-by: QuectelDuke <duke.xin@quectel.com>
2023-09-15 09:49:50 +00:00
QuectelDuke
bae7242af6 quectel: Add new EM160 product with firehose support
Signed-off-by: QuectelDuke <duke.xin@quectel.com>
2023-09-14 07:51:12 +00:00
Aleksander Morgado
1fc58d4749 broadband-modem: don't assert if no AT port in QMI modem enabling unsolicited messages
2023-09-11T20:23:49.294555Z <err> mm_port_get_device: assertion 'self != NULL' failed
  2023-09-11T20:23:49.294691Z <dbg> [modem0] enabling messaging unsolicited events on primary port (null)
  2023-09-11T20:23:49.294865Z <dbg> [modem0] enabling parent messaging unsolicited events failed: Cannot run sequence: port not given
2023-09-11 22:37:46 +00:00
Aleksander Morgado
36dc193b40 iface-modem-simple: ignore ps wait state result, only check error
As we do in the similar modem state wait operations in the modem
interface, the caller of the wait operation may ignore the state
result as it's really not required in this case. Only looking at
whether an error is set or not is enough.

This by itself fixes a crash where
mm_iface_modem_3gpp_wait_for_packet_service_state_finish() may have
returned UNKNOWN without error set.

  0x000079616c2564ed (libglib-2.0.so.0 - gtestutils.c: 3256)      g_assertion_message
  0x000079616c25654b (libglib-2.0.so.0 - gtestutils.c: 3282)      g_assertion_message_expr
  0x000057ba46231150 (ModemManager - mm-iface-modem-simple.c: 344)        packet_service_attach_in_3gpp_network_step
  0x000079616c0efb02 (libgio-2.0.so.0 - gtask.c: 1232)    g_task_return_now
  0x000079616c0eeb54 (libgio-2.0.so.0 - gtask.c: 1301)    g_task_return
  0x000057ba4620e5bd (ModemManager - mm-iface-modem-3gpp.c: 189)  wait_for_packet_service_state_context_complete
  0x000057ba4620b441 (ModemManager - mm-iface-modem-3gpp.c: 261)  packet_service_state_changed
2023-09-11 19:39:59 +00:00
Aleksander Morgado
47239b8499 iface-modem-3gpp: ensure error is set when UNKNOWN returned in ps state wait 2023-09-11 19:39:59 +00:00
Aleksander Morgado
c1382b3255 iface-modem: ensure error is set when UNKNOWN returned in modem state wait 2023-09-11 19:39:59 +00:00
Aleksander Morgado
5adda62912 iface-modem-3gpp: ignore UNKNOWN ps state explicitly during wait operation 2023-09-11 19:39:59 +00:00
Aleksander Morgado
fb66cc26be iface-modem: ignore UNKNOWN modem state explicitly during wait operation 2023-09-11 19:39:59 +00:00
QuectelDuke
0a87294725 quectel: add Sahara udev tag to EM061K-GL modems
Signed-off-by: QuectelDuke <duke.xin@quectel.com>
2023-09-08 08:35:48 +00:00
Eric Caruso
201c8533e0 mm-sms-part-3gpp: avoid buffer overflow if packed data is too large
With GSM7 encoding, packedlen is the length of the unpacked string
after expanding septets to octets so it will be ~14% bigger than
the original string length. This means we have to be careful not
to copy too much data into the PDU buffer.

Similar issues exist in other branches of the same function.

Thanks rhezashan@gmail.com for the report.
2023-08-30 12:42:15 -04:00
QuectelDuke
8fc9b77750 quectel: add support for EM060K-GL usb modules
Signed-off-by: QuectelDuke <duke.xin@quectel.com>
2023-08-14 12:03:02 +00:00
Daniele Palmas
490eeb0ade port-qmi: add QMAP support to mhi_net based setups 2023-08-07 10:52:55 +00:00
Daniele Palmas
65e2db75ed port-qmi: restore driver initial MTU for mhi-net when resetting link
Kernel driver mhi-net sets a custom MTU for the netdevice: use the
same value when resetting the netdevice to its initial state.

This is important especially when rmnet is used on top of mhi-net,
since rmnet netdevices get their initial MTU from the mhi-net one.
2023-08-07 10:52:55 +00:00
Aleksander Morgado
639900ed36 build: unstable release version bump to 1.21.8 2023-08-07 05:01:31 +00:00
Aleksander Morgado
50caac4bdd fibocom: disable multiplexing support in NL668
The NL668 doesn't seem to support multiplexing, as it fails to
transfer data even in the one multiplexed PDN case.
2023-08-05 22:08:01 +00:00
Aleksander Morgado
3008012adc bearer-mbim: simplify the logic to require static IPv6 addressing
Rely exclusively on whether a global IPv6 was given or not, regardless
of what the DNS or gateway settings are, same as we do for IPv4.

Also, assume we only get 1 single IPv6 address. No need to have a
FIXME to add support for more addresses.
2023-08-04 11:57:52 +02:00
Aleksander Morgado
c1fc816d0c plugin-manager: increase probing timeouts
This will make device probing slower unconditionally, but it should
also ensure newer more complex devices that take longer to boot are
handled properly.
2023-07-28 08:57:22 +00:00
Daniele Palmas
df61559511 port-qmi: set qmi_wwan requested dl dap max size to 16384 for rmnet
The current requested downlink data aggregation protocol maximum size is
set to 32768, but this is not accordingly set as the MTU of the main
qmi_wwan interface, that is instead set to RMNET_MAX_PACKET_SIZE that is
16384.

So, the modem is able to send QMAP aggregated blocks larger than 16384,
but the driver is not able to properly collect them, since the URB size
is 16384.

It is not simply possible to set qmi_wwan main interface MTU to the
returned dl max aggregated size, since when creating the rmnet netdevice
the rmnet kernel module automatically set the mtu as the size of the
parent netdevice MTU - the qmap header size (4), but this won't work
because the rmnet kernel module does not support MTU > 16384.

As an immediate fix, set the requested dl dap max size to 16384, while
thinking about how to refactor the logic for supporting higher values.

qmi_wwan inbox qmap management is not affected by this issue.
2023-07-17 13:47:19 +02:00
Daniele Palmas
3082d5d37b port-qmi: fix rmnet setup when QMAP is configured in the modem at MM startup
It could happen that when MM starts the aggregation protocol is already
configured on the modem side (e.g. if MM is stopped and restarted): this
prevents the links to be properly configured, resulting in using the qmimux
multiplex implementation even if rmnet is available.

Fix the issue by always performing the first time the links reset procedure,
even if the data format on the modem side is the expected one.
2023-07-17 13:47:19 +02:00
Daniele Palmas
16f9ff68fb port-qmi: fix rmnet checksum flag with qmi_wwan
When using QMAPv5 and QMAPv4 the checksum is enabled by default
at the modem level, so it should be also enabled when creating the
rmnet netdevices: add the required flags also when rmnet is used
through qmi_wwan.
2023-07-17 13:47:19 +02:00
Aleksander Morgado
b75198d9f9 broadband-modem-mbim: only update bearer speeds if connected
We should not update speeds on already disconnected bearers.
2023-07-14 13:02:39 +00:00
Aleksander Morgado
32b3aee8f0 broadband-modem-mbim: reset packet service state if unregistered 2023-07-14 13:02:39 +00:00
Aleksander Morgado
22d06d6b53 broadband-modem-mbim: propagate packet service state to 3GPP iface unconditionally 2023-07-14 10:33:06 +00:00
Aleksander Morgado
0724f45731 build: require udevdir if udev support is disabled
We cannot guess the udevdir path from the pkgconfig variable if there
is no udev support in the system, so explicitly fail.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/750
2023-07-13 10:22:05 +00:00
okaestne
aaacc8120a huawei: don't add DST to TZ offset
DST is already included in TZ offset. Adjust tests accordingly.
2023-07-13 10:00:24 +00:00
okaestne
d856cae75b huawei: check ^NWTIME not ^NTCT for time support
^NTCT seems to be used to enable or disable ^NWTIME messages.
2023-07-13 10:00:24 +00:00
diekleinekuh
4d02e9d463 ci: support overriding branch of dependency libs
(cherry picked from commit b3e1edaf1afc28a92dfcc52ab0fb1e8a97b446bb)
2023-07-13 08:28:14 +00:00
Andrey Skvortsov
4174575d5d quectel: fix debug output if QGPS isn't supported
FEATURE_NOT_SUPPORTED is equal 1 in the enum FeatureSupport, as a
result even if QGPS isn't supported by modem debug message printed
available support.
2023-07-13 08:15:10 +00:00
Daniele Palmas
187bccf0af port-qmi: fix qmi_device_list_links usage
qmi_device_list_links can return TRUE, but with a NULL value for
the links list: check for validity before using the list.
2023-07-12 12:27:14 +02:00
Aleksander Morgado
53f063b851 quectel: avoid assuming modem is MBIM capable in shared utils
(ModemManager:10426): GLib-GObject-WARNING **: 09:44:23.142: invalid cast from 'MMBroadbandModemQmiQuectel' to 'MMBroadbandModemMbim'
  **
  ERROR:../git/src/mm-broadband-modem-mbim.c:284:mm_broadband_modem_mbim_peek_port_mbim: assertion failed: (MM_IS_BROADBAND_MODEM_MBIM (self))
  Bail out! ERROR:../git/src/mm-broadband-modem-mbim.c:284:mm_broadband_modem_mbim_peek_port_mbim: assertion failed: (MM_IS_BROADBAND_MODEM_MBIM (self))

See https://lists.freedesktop.org/archives/modemmanager-devel/2023-July/009729.html
2023-07-07 05:50:12 +00:00
diekleinekuh
3c2849d722 fibocom: allow qmi over mbim 2023-06-24 22:52:43 +00:00
Andrey Skvortsov
5eb3acee0a shared-qmi: fix memory leak in set_supl_server command
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;
```
2023-06-23 23:19:53 +03:00
Aleksander Morgado
2ea67ae3e8 fibocom: limit multiplexing in NL668 to one single PDN
NL668 doesn't correctly support more than one multiplexed PDN
connection. Limit this explicitly so that it never attempts to use
more than one.

   #  mmcli -m a --simple-connect="multiplex=requested,apn=internet,ip-type=ipv4v6,apn-type=default"
   successfully connected the modem

   # mmcli -m a --simple-connect="multiplex=requested,apn=internet2,ip-type=ipv4v6,apn-type=default"
   error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported: Invalid bearer properties: Maximum number of multiplexed bearers reached'
2023-06-16 21:00:16 +00:00
Aleksander Morgado
3004a3e532 broadband-modem-qmi|mbim: allow limiting multiplexed links with udev tags
Certain QMI or MBIM devices may not be able to support multiplexing at
all, or they may support a limited amount of links.

The new ID_MM_MAX_MULTIPLEXED_LINKS udev tag allows specifying the
maximum number of supported multiplexed links; e.g. 0 to report none
supported or 1 to report that one single multiplexed link is
supported.
2023-06-16 20:58:04 +00:00
Aleksander Morgado
547d40009c docs: add missing reference to ID_MM_REQUIRED 2023-06-16 09:01:34 +00:00
Aleksander Morgado
4db5635f44 iface-modem: sim swap check always refers to the active SIM
Since 503e886c02 the events on inactive SIMs don't trigger a full
modem reprobe, and the slot index check is fully unused.
2023-06-14 13:54:32 +00:00
Aleksander Morgado
af89e63c35 iface-modem: ignore sim swap check if not implemented
Explicitly return TRUE to indicate success because otherwise the
caller will expect a valid GError set.
2023-06-14 13:48:06 +00:00
Jordi Mas
a6a87e4a06 po: add Catalan translation 2023-06-14 09:16:23 +00:00
Ujjwal Pande
e3a1206c57 api: new carrier lock support
Adding support for carrier lock for MBIM modems using google simlock
mechanism.
2023-06-08 20:16:12 +00:00
Aleksander Morgado
97c32d6e51 build: unstable release version bump to 1.21.7 2023-06-06 13:27:12 +00:00
Sabri Unal
86970f6f18 po: update Turkish translation 2023-06-05 09:34:36 +00:00
Aleksander Morgado
614cc3e467 iface-modem-3gpp: cleanup packet service state on disabling
Otherwise the state cached by the protocol implementation will be
different to the one exposed in the 3GPP interface.
2023-05-25 08:19:37 +00:00
Aleksander Morgado
edf2235259 broadband-modem-mbim: common process for register state messages
Both the register state indications and the register state set
response messages will be processed in the same way.

This ensures that the registration state reported during the set
response, along with the additional info provided in that
message (e.g. access technologies) are taken into account.

This change also avoids fully relying on the register state
indications sent by the modem, as the indication may not be sent after
a successful update operation (given that the operation response
already contains the last valid state).
2023-05-25 08:19:37 +00:00
Aleksander Morgado
3424c17688 broadband-modem-mbim: run explicit packet service query
When running the 3GPP registration checks (e.g. after reaching enabled
state, or when synchronizing state after a quick suspend/resume), we
also update the current packet service state explicitly, without
needing to fully rely on the indications.
2023-05-25 08:19:37 +00:00
Aleksander Morgado
b7d94a4daa broadband-modem-mbim: common process for packet service messages
Both the packet service indications and the packet service set
response messages will be processed in the same way.

This ensures that the packet service state reported during the set
response, along with the additional info provided in that
message (e.g. speeds) are taken into account.

This change also avoids fully relying on the packet service
indications sent by the modem, as the indication may not be sent after
a successful update operation (given that the operation response
already contains the last valid state).
2023-05-24 10:34:30 +00:00
Kristian Sloth Lauszus
f32a625a56 mm-modem-helpers-ublox: added support for ublox LARA-R6001 / LARA-R6001D modules 2023-05-22 19:48:48 +02:00
Aleksander Morgado
b70fd80c0f charsets: fix read of uninitialized memory in gsm unpacked conversion
==1==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x59c6c88a31ef in gsm_ext_char_to_utf8 src/mm-charsets.c:256:13
    #1 0x59c6c88a31ef in charset_gsm_unpacked_to_utf8 src/mm-charsets.c:339:20
    #2 0x59c6c88a31ef in mm_modem_charset_bytearray_to_utf8 src/mm-charsets.c:857:30
    #3 0x59c6c889babd in sms_decode_address src/mm-sms-part-3gpp.c:143:16
    #4 0x59c6c8899d3a in mm_sms_part_3gpp_new_from_binary_pdu src/mm-sms-part-3gpp.c:514:15
2023-05-18 21:00:45 +00:00
Aleksander Morgado
a03da1f3cb broadband-modem: plug leak processing SIM loading steps
==6971== 52 (16 direct, 36 indirect) bytes in 1 blocks are definitely lost in loss record 3,764 of 6,140
  ==6971==    at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==6971==    by 0x4A1ADE8: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==6971==    by 0x4A31FF1: g_slice_alloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==6971==    by 0x4A3266D: g_slice_alloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==6971==    by 0x49FD397: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==6971==    by 0x49FD8B4: g_error_new_valist (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==6971==    by 0x49FDACE: g_set_error (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==6971==    by 0x187A4C: mm_base_modem_peek_best_at_port (mm-base-modem.c:1129)
  ==6971==    by 0x184116: _at_command (mm-base-modem-at.c:634)
  ==6971==    by 0x1841FE: mm_base_modem_at_command (mm-base-modem-at.c:660)
  ==6971==    by 0x18F6F1: load_sim_identifier (mm-base-sim.c:2016)
  ==6971==    by 0x18CA03: mm_base_sim_load_sim_identifier (mm-base-sim.c:820)
2023-05-17 14:07:20 +02:00