Commit Graph
4190 Commits
Author SHA1 Message Date
Aleksander Morgado aee12967ee build,meson: simplify build of daemon enums sources 2021-09-16 09:31:25 +02:00
Aleksander Morgado 986fbd5093 build,meson: make PLUGINDIR an absolute path
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/433
2021-09-15 05:26:27 +02:00
Iñigo Martínez ab805e0914 build,meson: Fix suspend/resume option
The suspend/resume option does not build properly if journal option
is disabled. This is beacause the journal option is check to add
suspend/resume code.

It has been fixed by replacing journal option check by the
suspend/resume option.
2021-09-10 08:39:37 +00:00
Aleksander Morgado 15671dc137 core: remove execution bit from file modes in source files 2021-09-10 10:36:19 +02:00
Aleksander Morgado 34e671f41c broadband-modem-qmi: don't error out on empty call list
Only error out if the required TLVs are missing.
2021-09-08 10:26:04 +02:00
Aleksander Morgado f2901446e0 iface-modem-voice: avoid warning with -Wincompatible-pointer-types
../src/mm-iface-modem-voice.c: In function ‘mm_iface_modem_voice_reload_all_calls’:
  ../src/mm-iface-modem-voice.c:2549:64: warning: passing argument 2 of ‘((MMIfaceModemVoice *)g_type_interface_peek((void *)((GTypeInstance *)self)->g_class,  mm_iface_modem_voice_get_type()))->load_call_list’ from incompatible pointer type [-Wincompatible-pointer-types]
   2549 |                                                                reload_all_calls_ready,
        |                                                                ^~~~~~~~~~~~~~~~~~~~~~
        |                                                                |
        |                                                                void (*)(MMIfaceModemVoice *, GAsyncResult *, GTask *) {aka void (*)(struct _MMIfaceModemVoice *, struct _GAsyncResult *, struct _GTask *)}
  ../src/mm-iface-modem-voice.c:2549:64: note: expected ‘GAsyncReadyCallback’ {aka ‘void (*)(struct _GObject *, struct _GAsyncResult *, void *)’} but argument is of type ‘void (*)(MMIfaceModemVoice *, GAsyncResult *, GTask *)’ {aka ‘void (*)(struct _MMIfaceModemVoice *, struct _GAsyncResult *, struct _GTask *)’}
2021-09-08 10:14:26 +02:00
Aleksander Morgado 03b75c85d0 broadband-modem-qmi: refactor process_get_all_call_info() to avoid handling the GTask
The process_get_all_call_info() was not completing the input GTask on
every possible code path (e.g. when remote party number or call info
wasn't available).

The method is now updated to avoid processing the GTask itself,
instead it will attempt to build the call list and return a GError on
any kind of failure.
2021-09-08 10:12:20 +02:00
Dylan Van Assche 15d66197b3 mm-broadband-modem-qmi: add AT URCs fall back for calls
Enable AT URCs for calls on top of QMI Voice indications
for AT+QMI devices only. Some AT+QMI devices send unreliable
QMI indications when the host is resuming. In such cases,
AT URCs can be used as a fall back to make calls reliable.

While AT+QMI devices relied before on AT commands to load
call list information and handle AT URCs for async updates,
this is now handled through QMI by forcefully reloading the
call list instead of processing the AT URCs.
This approach is disabled by default through the
MM_IFACE_MODEM_VOICE_INDICATION_CALL_LIST_RELOAD_ENABLED property.
This property is set to true in case of QMI modems.
2021-09-08 10:02:51 +02:00
Dylan Van Assche 92ad38432c mm-modem-helpers: only parse calls in voice mode
Calls in a CLCC response in data-only or fax-only mode
do not count as actuall calls.
2021-09-08 07:59:16 +00:00
Iñigo Martínez 77d1c24361 build: Port to meson
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.
2021-09-07 10:55:43 +00:00
Aleksander Morgado 7177eeea99 build: use WITH_QRTR exclusively to check for QRTR support
The user may request to disable QRTR support using `--without-qrtr`
even if libqmi has QRTR support.
2021-08-31 15:33:15 +02:00
Andrew Lassalle 5af93dbfee broadband-modem-mbim: Fix password on initial EPS bearer settings
Currently, we are sending the username twice instead of username and
password. Fix the password value.
2021-08-27 09:42:15 -07:00
Aleksander Morgado 965c43fec7 port-qmi: limit MTU to max RMNET packet size
The maximum MTU that the master interface can support should be less
or equal than RMNET_MAX_PACKET_SIZE, as defined in the
`rmnet_private.h` file in the linux sources (not a public header).

Only applicable to RMNET link management (i.e. not to qmi_wwan
add_mux/del_mux).

Fixes https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/71
2021-08-09 12:22:26 +00:00
Aleksander Morgado 5adc469701 port-qmi: only consider port setup not needed if data modes match
When not requesting multiplexing support, only assume we don't need
any additional setup if multiplexing is disabled AND if the data modes
match between kernel and device.

This fixes the connection setup in MSM8916 (rpmsg+bam/dmux).
2021-08-09 12:22:26 +00:00
Aleksander Morgado 185e492c0a core: new '--test-multiplex-requested' option
The new option will change the default setting in MBIM and QMI bearers
to "request" when no explicit "multiplex" configuration is given by
the user.

This option will help test the multiplexing support in the modems
before it's made a default in a future release.
2021-08-09 12:22:26 +00:00
Aleksander Morgado c49f3f5f46 bearer-qmi: don't enable multiplexing by default unless in IPA
The next 1.18 release will have multiplexing support, but not enabled
by default, to avoid breaking setups that don't expect the new virtual
net interfaces for the multiplexed sessions.

The exception is Qualcomm SoCs using the IPA driver, where
multiplexing is fully required.
2021-08-09 12:22:26 +00:00
Aleksander Morgado 0628514239 bearer-mbim: don't enable multiplexing by default
The next 1.18 release will have multiplexing support, but not enabled
by default, to avoid breaking setups that don't expect the new virtual
net interfaces for the multiplexed sessions.
2021-08-09 12:22:26 +00:00
Aleksander Morgado 168ec6ba09 broadband-bearer: default to 'none' if no multiplexing config provided 2021-08-09 12:22:26 +00:00
Aleksander Morgado 8d019a399c base-bearer: remove default multiplex support symbol
Using "requested" as a common default for every possible
implementation works, because it can handle setups without
multiplexing capabilities (e.g. plain AT+PPP modems) and also setups
without non-multiplexing capabilities (e.g. IPA based SoCs).

But if we don't want "requested" as default, then there will be
failing cases; e.g. we cannot use "none" as default for all as it
would break IPA, and we cannot use "required" as default for all as it
would break AT+PPP setups.

So, remove the common default, it's not flexible enough.
2021-08-09 12:22:26 +00:00
Aleksander Morgado 4a07ab39f1 broadband-modem-qmi: fix max bearers computation in IPA based setups
In IPA based setups, there are only multiplexed bearers supported,
there is no way to not enable multiplexing.

We change the logic that computes the maximum number of multiplexed
and non-multiplexed bearers, so that we check which are the current
kernel data modes before computing them.
2021-08-09 12:22:26 +00:00
Aleksander Morgado 04dba846c9 bearer-list: if non-multiplexing not supported, 0 max non-multiplexed bearers 2021-08-09 12:22:26 +00:00
Aleksander Morgado 9d2782cc5a bearer-list: if multiplexing not supported, 0 max multiplexed bearers
Fixes warnings on AT+PPP based devices:

   ModemManager[602870]: <debug> [1626948725.168355] [modem0] allowed up to 1 active bearers

   (ModemManager:602870): GLib-GObject-WARNING **: 12:12:05.185: value "0" of type 'guint' is invalid or out of range for property 'max-active-multiplexed-bearers' of type 'guint'
2021-08-09 12:22:26 +00:00
Aleksander Morgado b77c15f8b5 broadband-modem-mbim: minor rework in SIM event related comments 2021-08-04 14:21:44 +02:00
Aleksander Morgado bcf5f2bc8b broadband-modem-mbim: also report as available not fully ready SIMs
If a SIM card is not fully ready or in a failed state in the
non-active slot, we should still report them as available.
2021-08-04 14:21:39 +02:00
ZhangMingjie 3004e99fcb broadband-modem-mbim: deal with the slot info status notification event for DSSA 2021-08-04 11:02:43 +02:00
Loic Poulain 9e5e699227 kernel-device-generic: Fix ptr_array_add_sysfs_attribute_link_basename
A pointer can not be used anymore after its ownership has been transfered
using the g_steal_pointer function (pointer is nullified).

In this function, g_steal_pointer() is used when inserting 'value' inside
the array but can also be subsequently used when dumping 'value' to
'out_value' via g_strdup().

Fix that with simple reordering.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-08-04 07:40:09 +00:00
Joel Selvaraj b91bf1e3a6 modem-qmi: implement multiparty functionalities
The following functionalities are implemented:
1. Hold all and accept
2. Hangup all and accept
3. Hangup all
4. Join multiparty
5. Leave multiparty
6. Call transfer
2021-08-02 13:11:29 +00:00
Joel Selvaraj 691cb9b694 modem-qmi: implement call waiting setup and query 2021-08-02 13:11:29 +00:00
Joel Selvaraj 1894dd7767 modem-qmi: implement setup in call unsolicited events
Handle supplementary service notification indication.
Useful to know when existing call is on hold, unheld and waiting.
2021-08-02 13:11:29 +00:00
Joel Selvaraj 82054410e2 call-list: allow getting call object by index 2021-08-02 13:11:29 +00:00
Teijo Kinnunen 0610267fa8 test,modem-helpers: add test case of AT+CPOL? response parsing 2021-08-02 12:42:13 +03:00
Teijo Kinnunen 948099bff0 modem-helpers: allow unquoted operator code in AT+CPOL? response
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/409
2021-08-02 12:39:38 +03:00
Loic Poulain b0248e471c kernel-device: generic: Support ATTR condition
Only the plural ATTRS form was checked but we also need to support
the single ATTR for matching device's attribute only.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-07-30 14:03:40 +00:00
Iñigo Martínez 7c4db66eb3 build: Rename template files
The template files in the `build-aux` directory used in enums sources
and headers generation use the `{$name}-template.[ch]` pattern.
However, the examples in the official guide[0] and usually GNOME and
Freedesktop packages use the `{$name}.[ch].template` pattern.

Due to this, the name of the template files and build commands have
been changed.

[0] https://developer.gnome.org/gobject/stable/glib-mkenums.html
2021-07-30 10:14:52 +00:00
Aleksander Morgado 15f53851c8 port-mbim: increase timeout of first command after port open
The port open operation may be happening very early after the device
has booted, so let's give the module some more time to reply the very
first MBIM query we do. The original 10s seems to be a bit tight in
some cases.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/405#note_1006746
2021-07-27 16:00:58 +02:00
Aleksander Morgado bcf11c0e50 port-qmi: open without data format explicitly if requested by user
Regardless of whether WDA is supported or not.
2021-07-27 00:39:29 +02:00
Aleksander Morgado ee0f473233 port-qmi: early check if WDA is supported
We should check if WDA is supported before running any other logic
that may change the state of the kernel or the modem. E.g. if we don't
do this as the first step, the loading of the supported kernel data
modes may end up changing the expected kernel data mode to raw-ip.
2021-07-27 00:39:29 +02:00
Aleksander Morgado ae09baf61b port-qmi: cleanly close device if an open operation failed
ModemManager[703345]: <debug> [1626962477.971869] [modem0] couldn't open QMI port with data format update: Unexpected kernel data mode: cannot setup using CTL
   ModemManager[703345]: <debug> [1626962477.972197] [cdc-wdm0/qmi] Opening QMI device...
   ModemManager[703345]: <debug> [1626962477.972310] [cdc-wdm0/qmi] Checking if QMI device already opening...
   ModemManager[703345]: <warn>  [1626962477.975182] [modem0] couldn't start initialization: QMI device open/close operation in progress
2021-07-27 00:39:29 +02:00
Aleksander Morgado 9be34affe2 port-qmi: support devices that only run in 802.3 mode
E.g. the ZTE MF190 has a very old QMI firmware that is not able to run
CTL Set Data Format (raw-ip).

   ModemManager[666366]: [/dev/cdc-wdm0] QMI Device supports 4 services:
   ModemManager[666366]: [/dev/cdc-wdm0]    ctl (1.2)
   ModemManager[666366]: [/dev/cdc-wdm0]    wds (1.3)
   ModemManager[666366]: [/dev/cdc-wdm0]    dms (1.2)
   ModemManager[666366]: [/dev/cdc-wdm0]    nas (1.0)
   ModemManager[666366]: [/dev/cdc-wdm0] Setting network port data format...
   ModemManager[666366]: [/dev/cdc-wdm0] Sent message...
   <<<<<< RAW:
   <<<<<<   length = 21
   <<<<<<   data   = 01:14:00:00:00:00:00:03:26:00:09:00:10:02:00:02:00:01:01:00:00
   ModemManager[666366]: [/dev/cdc-wdm0] Sent generic request (translated)...
   <<<<<< QMUX:
   <<<<<<   length  = 20
   <<<<<<   flags   = 0x00
   <<<<<<   service = "ctl"
   <<<<<<   client  = 0
   <<<<<< QMI:
   <<<<<<   flags       = "none"
   <<<<<<   transaction = 3
   <<<<<<   tlv_length  = 9
   <<<<<<   message     = "Set Data Format" (0x0026)
   <<<<<< TLV:
   <<<<<<   type       = "Protocol" (0x10)
   <<<<<<   length     = 2
   <<<<<<   value      = 02:00
   <<<<<<   translated = raw-ip
   <<<<<< TLV:
   <<<<<<   type       = "Format" (0x01)
   <<<<<<   length     = 1
   <<<<<<   value      = 00
   <<<<<<   translated = absent
   ModemManager[666366]: [/dev/cdc-wdm0] Received message...
   <<<<<< RAW:
   <<<<<<   length = 19
   <<<<<<   data   = 01:12:00:80:00:00:01:03:26:00:07:00:02:04:00:01:00:2D:00
   ModemManager[666366]: [/dev/cdc-wdm0] Received generic response (translated)...
   <<<<<< QMUX:
   <<<<<<   length  = 18
   <<<<<<   flags   = 0x80
   <<<<<<   service = "ctl"
   <<<<<<   client  = 0
   <<<<<< QMI:
   <<<<<<   flags       = "response"
   <<<<<<   transaction = 3
   <<<<<<   tlv_length  = 7
   <<<<<<   message     = "Set Data Format" (0x0026)
   <<<<<< TLV:
   <<<<<<   type       = "Result" (0x02)
   <<<<<<   length     = 4
   <<<<<<   value      = 01:00:2D:00
   <<<<<<   translated = FAILURE: InvalidDataFormat
   ModemManager[666366]: <debug> [1626961628.001354] [cdc-wdm0/qmi] QMI port open operation failed: QMI protocol error (45): 'InvalidDataFormat'
   ModemManager[666366]: <warn>  [1626961628.002563] [modem0] couldn't start initialization: QMI protocol error (45): 'InvalidDataFormat'
   ModemManager[666366]: <warn>  [1626961628.004181] [modem0] couldn't initialize: 'Modem is unusable, cannot fully initialize'
2021-07-27 00:39:29 +02:00
Aleksander Morgado 939cf166dd broadband-modem-qmi: remove trailing whitespaces 2021-07-27 00:37:53 +02:00
Loic Poulain 064624c69d bearer-mbim: Disable multiplex support for wwan devices
WWAN network devices expose link management over netlink (wwan type),
but it is not yet supported by libmbim.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-07-26 20:43:24 +00:00
Loic Poulain 2f38ea0155 kernel-device: Add get_wwandev_sysfs_path
The wwan subsystem is a new bus agnostic framework exposing wwan
device and its components (ports, netdev...). It can be useful to
get the wwan device a device belongs to

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-07-26 20:43:24 +00:00
Pavan Holla 97ab517348 mm-sim-mbim: Remove trailing F in ICCID
QMI modems remove trailing F in 19 digit ICCID. Do the same on
MBIM modems for consistency.
2021-07-26 09:25:09 +00:00
Joel Selvaraj 95f4a232ce port-qmi: open dpm port automatically in case of IPA net driver
Requires IPA kernel driver to expose the TX and RX endpoint IDs through sysfs.
Available from linux 5.14 onwards.
2021-07-21 20:40:42 +05:30
Joel Selvaraj 3b79f7379f base-modem: set net sysfs path
Required by MMPortQmi for fetching the TX and RX endpoint IDs
through sysfs from linux 5.14 onwards
2021-07-21 20:36:07 +05:30
Joel Selvaraj 43c9c47b04 port-qmi: allow MMPortQmi to get the net sysfs path
Will be set by base modem when organizing ports, similar to
net driver name. Required for fetching the TX and RX endpoint IDs
through sysfs from linux 5.14 onwards.
2021-07-21 20:35:33 +05:30
Aleksander Morgado 1d4caa929f broadband-modem-mbim: fix passing new slots array in the set operation 2021-07-14 15:14:18 +02:00
Aleksander Morgado 1830801f0f broadband-modem-mbim: slot index in MM starts at 1
When querying the slots using "Slot info status", the modem expects
the slot index passed in the [0,number_slots-1] range.

But for the ModemManager API, the slot indices start at 1; i.e. they
are in the [1,number_of_slots] range.

Consider that wen reporting the current slot index using MBIM.
2021-07-14 15:14:18 +02:00
ZhangMingjie 48261375d3 mm-broadband-modem-mbim: implement the set_primary_sim_slot() method for DSSA 2021-07-14 15:14:18 +02:00
ZhangMingjie b151740d15 mm-broadband-modem-mbim: implement the load_sim_slots() method for DSSA 2021-07-14 15:14:18 +02:00