Commit Graph

7132 Commits

Author SHA1 Message Date
Aleksander Morgado
268bf4f98a core: update copyright years to 2021 2021-01-17 10:33:45 +01:00
Aleksander Morgado
6c0c67d6f0 doc: skip running gtkdoc-rebase on local install step
We can leave the relative paths to other books (e.g. '../glib' or
'../ModemManager') because running gtkdoc-rebase seems to be broken
since the 1.29 release, see:

  https://gitlab.gnome.org/GNOME/gtk-doc/-/issues/138
2021-01-16 17:57:48 +01:00
Aleksander Morgado
3826795228 docs: add 'online-location' references
So that the gtkdoc-rebase step fixes the URLs to contain the correct
links; e.g.:

   $ make dist V=s
   make[8]: Entering directory '/home/aleksander/Development/foss/ModemManager/docs/reference/libmm-glib'
   make  \
     top_distdir="../../../ModemManager-1.15.0" distdir="../../../ModemManager-1.15.0/docs/reference/libmm-glib" \
     dist-hook
   ../ModemManager/ -> https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ (914)
   ../gio/ -> https://developer.gnome.org/gio/unstable/ (2564)
   ../glib/ -> https://developer.gnome.org/glib/unstable/ (5534)
   ../gobject/ -> https://developer.gnome.org/gobject/unstable/ (499)
   make[8]: Leaving directory '/home/aleksander/Development/foss/ModemManager/docs/reference/libmm-glib'

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/298
2021-01-16 17:56:15 +01:00
Aleksander Morgado
d1bc679365 build: add new RELEASING doc explaining how releases are made 2021-01-16 15:37:35 +01:00
Louis-Alexis Eyraud
9c353cf6f0 zte: add 1 second delay after sim unlock to avoid IMSI reading issue
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/306

Signed-off-by: Louis-Alexis Eyraud <louis-alexis.eyraud@sigfox.com>
2021-01-16 10:27:58 +00:00
Frederic Martinsons
89cd1696c3 tools: add unit test for test-modemmanager-service.py
The tests spawn the service via GTestDBus framework and make
some test API call while checking libmm interface to verify
that informations are well propagated.

To be able to use the fresh built libmm typelib, I used a
wrapper script to set GI_TYPELIB_PATH (because DBus activation
process clean the environment so it is not possible to set
it directly in the file).

This requires also the install of libgirepository-dev and python3-gi
in the CI docker.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-01-15 16:44:19 +00:00
Aleksander Morgado
17ea1dfa13 docs: add MMBearerPropertiesCmpFlags to ignored list 2021-01-15 11:38:08 +01:00
Aleksander Morgado
d12ab8a25a iface-modem: avoid leaking the MmGdbusModem when bearers are updated
See See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/302
2021-01-11 14:27:46 +01:00
Aleksander Morgado
102de14c15 telit: plug GPS data port leak
The _get_port_gps() returns a full reference, use _peek_port_gps()
instead.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/302
2021-01-11 14:13:28 +01:00
Timo Jyrinki
8f465d44a5 po: add Finnish translation
Translation by JRfi:
 https://l10n.gnome.org/vertimus/ModemManager/master/po/fi/
2021-01-08 21:23:25 +01:00
Andrew Lassalle
8ccd63ef64 test-sms-part-cdma: fix memory leak 2021-01-08 10:51:04 -08:00
Frederic Martinsons
18b72a046e mmcli: don't assume that mm_object_peek_modem or mm_object_get_modem return non null
This very peculiar case can happen when an intermediate initiliazition step
of a modem fails.

The ModemManager daemon should always expose the modem interface but let not
assume that in mmcli and protect these calls.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-12-21 13:00:40 +00:00
Frederic Martinsons
2f53a08e5f iface-modem: don't consider charset setup failure as fatal.
On some modem (for example SORACOM SC-QGLC4-C1) , the character set setup
step fails with "Unknown error" when the SIM card is missing or locked.
This leads to not expose Modem interface and not being able to unlocked
the SIM.
We should not consider this step as fatal but just issue a warning to let
other steps continue (which will let modem in failed state anyway).

Closes #289

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-12-21 13:00:40 +00:00
Aleksander Morgado
3d4dd64dd0 broadband-modem-qmi: disable signal/access-tech polling if indications enabled
We can rely on QMI indications when the signal quality and access tech
changes happen, instead of doing explicit polling.

The modem will run the signal quality retrieval once, and then just
rely on indications, with polling disabled:

  ModemManager[278759]: <debug> [1606862198.230492] [modem1] signal strength (lte): -79 dBm
  ModemManager[278759]: <debug> [1606862198.230520] [modem1] signal strength: -79 dBm --> 55%
  ModemManager[278759]: <debug> [1606862198.230583] [modem1] access technology changed (unknown -> lte)
  ModemManager[278759]: <debug> [1606862198.230654] [modem1] signal quality updated (55)
  ModemManager[278759]: <debug> [1606862198.230675] [modem1] periodic signal quality and access technology checks not rescheduled: unneeded or unsupported
  ModemManager[278759]: <debug> [1606862198.230692] [modem1] periodic signal checks disabled

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/231
2020-12-21 12:05:57 +00:00
Aleksander Morgado
47f39c9e1a broadband-modem-qmi: fix disabling of signal strength events
Attempting to disable the signal strength events was failing because
the protocol handler expects a valid set of thresholds also during the
disabling. So, just pass always the thresholds.

  ModemManager[274522]: [/dev/cdc-wdm1] sent generic request (translated)...
  <<<<<< QMUX:
  <<<<<<   length  = 17
  <<<<<<   flags   = 0x00
  <<<<<<   service = "nas"
  <<<<<<   client  = 3
  <<<<<< QMI:
  <<<<<<   flags       = "none"
  <<<<<<   transaction = 7
  <<<<<<   tlv_length  = 5
  <<<<<<   message     = "Set Event Report" (0x0002)
  <<<<<< TLV:
  <<<<<<   type       = "Signal Strength Indicator" (0x10)
  <<<<<<   length     = 2
  <<<<<<   value      = 00:00
  <<<<<<   translated = [ report = 'no' thresholds = '{}' ]

  ModemManager[274522]: [/dev/cdc-wdm1] received generic response (translated)...
  <<<<<< QMUX:
  <<<<<<   length  = 19
  <<<<<<   flags   = 0x80
  <<<<<<   service = "nas"
  <<<<<<   client  = 3
  <<<<<< QMI:
  <<<<<<   flags       = "response"
  <<<<<<   transaction = 7
  <<<<<<   tlv_length  = 7
  <<<<<<   message     = "Set Event Report" (0x0002)
  <<<<<< TLV:
  <<<<<<   type       = "Result" (0x02)
  <<<<<<   length     = 4
  <<<<<<   value      = 01:00:08:00
  <<<<<<   translated = FAILURE: NoThresholdsProvided
2020-12-21 12:05:57 +00:00
Aleksander Morgado
da15958799 broadband-modem-qmi: reload initial EPS bearer on data system updates 2020-12-21 12:05:57 +00:00
Aleksander Morgado
2d9b62d23b iface-modem-3gpp: allow requesting the reload of the initial EPS bearer 2020-12-21 12:05:57 +00:00
Aleksander Morgado
5629f47a59 libmm-glib,bearer-properties: allow loose comparisons
When comparing bearer properties provided by the user versus loaded
from the modem, we shouldn't be very strict, e.g.:
 * Password or other fields may not be readable from the device.
 * Some fields may not apply at all (e.g. RM protocol for EPS bearers)
 * NULL strings could be assumed equal to empty strings.
 * If no explicit IP type specified, an IPv4 default may be assumed.
 * If no explicit allowed auth specified, 'none' default may be
   assumed.

These loose comparisons are applied when managing the initial EPS
bearer settings and status, and we keep the strict comparison only
during the connection attempt lookup of a bearer with certain
settings, as those bearer objects are all created in the same place
with the same rules.
2020-12-21 12:05:57 +00:00
Aleksander Morgado
c99cc9210e iface-modem-3gpp: log requested/updates initial EPS bearer settings 2020-12-21 12:05:57 +00:00
Aleksander Morgado
5613215db8 broadband-modem-qmi: implement initial EPS bearer settings loading and setting 2020-12-21 12:05:57 +00:00
Aleksander Morgado
527b4e3232 broadband-modem-qmi: implement initial EPS bearer info loading 2020-12-21 12:05:57 +00:00
Aleksander Morgado
295400688a broadband-modem-qmi: allocate a generic WDS client
For generic WDS operations not tied to any connection attempt.
2020-12-21 12:05:57 +00:00
Aleksander Morgado
7b52efda34 build: require libqmi 1.27.3 to support initial EPS management 2020-12-21 12:05:57 +00:00
Aleksander Morgado
0729ba5c88 broadband-modem-mbim: plug memleak when processing USSD in GSM7 2020-12-19 11:10:44 +01:00
Aleksander Morgado
7f88280929 altair: make sure parse_vendor_pco_info() always returns an error
The parse_vendor_pco_info() method was returning NULL without error if
the pco info string was empty.

Under this situation, the code would have tried to add a NULL MMPco
into the pco_list list, which is not desired.

Avoid this, by making sure a NULL return always sets an error.
2020-12-19 10:45:14 +01:00
Aleksander Morgado
243272c111 cinterion: add AT primary/secondary port type hints for PLS8 2020-12-14 09:58:59 +01:00
Aleksander Morgado
ba4b3f60b7 cinterion: add QCDM and GPS port type hints for PLS62 2020-12-14 09:58:15 +01:00
Aleksander Morgado
067b09c835 cinterion: add PLS83 port type hints 2020-12-14 09:58:08 +01:00
Aleksander Morgado
bee8a391bf broadband-modem-mbim: ignore MS SAR notifications explicitly
SAR service will be introduced in the stable libmbim 1.26.0, but it's
been flagged in the dev 1.25.1 version already.
2020-12-13 17:37:12 +01:00
Torsten Hilbrich
8072ed2d6f broadband-modem-mbim: Add MM_BROADBAND_MODEM_MBIM_QMI_UNSUPPORTED
This property (initially set to FALSE) controls whether QMI over MBIM
should never be considered. This property is set to TRUE for XMM-based
MBIM devices as they don't support QMI.

This fixes a probing delay of 15s on a Fibocom L850-GL device
(2cb7:0007) found in the Lenovo T14 Gen 1.

The establishing of a QMI connection was refused multiple time with
MBIM error OperationNotAllowed. Only the timeout of 15s for this
connection resumed the probing.

The properties in the MMBroadbandModemMbim are only installed when
WITH_QMI and QMI_MBIM_QMUX_SUPPORTED are set. Actually, this should only
disable the PROP_QMI_UNSUPPORTED but as this is the only property this
avoids the "unused variable 'self'" warnings/errors when trying to
compile set_property and get_property without QMI support. This can be
changed once other properties are needed.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/284
2020-12-03 08:00:30 +01:00
Aleksander Morgado
f80c8d8be6 broadband-modem-qmi: fix reporting of signal strength indications
We had all the logic in place... but we were never actually enabling
the signal strength indications because the `enable` flag in the
context was never set.

The bug was introduced back in May 2018, and released with 1.10.0.

Fixes baefe53ab9
2020-12-01 22:08:41 +00:00
Dylan Van Assche
d531992897 tests: added parse ERROR response test 2020-12-01 20:42:55 +00:00
Dylan Van Assche
c15d103ca6 serial-parsers: also match ERROR responses that are not at end of line
Do not fail to detect an error response with a call or text incoming. This happens during port probing when there's no URC parsers installed in the serial port. This probably will not happen when the serial port was managed by the modem object.w
2020-12-01 20:42:55 +00:00
Dylan Van Assche
c05580ca9a tests: added parse OK response test 2020-12-01 20:42:55 +00:00
Dylan Van Assche
750fb2bc4a serial-parsers: also match OK responses that are not at end of line
Do not fail to detect a valid response with a call or text incoming.
This happens also during port probing when there's no URC parsers
installed in the serial port. This probably will not happen when the
serial port was managed by the modem object.
2020-12-01 20:42:55 +00:00
Eric Caruso
446d497040 introspection: fix Bearer documentation
If e.g. a bearer with IPv6 configuration has DNS servers but exports
its link-local address, MM will avoid giving it the "static" method
type, and instead fall back to the "dhcp" type. However, it may
still have DNS information. Therefore, the comment that "method" is
the only property on configuration with type DHCP is misleading.
2020-11-30 09:25:10 -08:00
Dylan Van Assche
756894bc76 build: Allow elogind for suspend/resume support 2020-11-27 18:07:02 +01:00
Pavan Holla
1f0c04644d base-sim: Reprobe modem if puk lock is discovered after sending pin1
Enabling/Disabling/Changing/Sending the PIN1 lock is usually limited to
3 retries. If these attempts are exhausted, the modem is puk_locked.
We reprobe the modem to get rid of any unwanted interfaces and move
to a locked state.
2020-11-26 08:53:14 +00:00
Pavan Holla
38f6704fa1 base-sim: Reprobe modem if lock status cannot be read after sending puk
If the lock status cannot be read during a puk unblock attempt, reprobe
the modem. It is likely that the SIM was permanently blocked if the lock
status cannot be read.
2020-11-26 08:53:14 +00:00
Thomas Dendale
92c86e2b1b huawei: add GPS port type hints for Huawei ME906e 2020-11-25 21:14:19 +01:00
Aleksander Morgado
935e73c8df build: fix build with single plugins
We need to quote arguments with [] so that lists are not expanded as
different arguments.

Fixes 65560dd885
2020-11-22 14:34:07 +01:00
Aleksander Morgado
6e0380c165 base-modem: order ports by name by default
When there are multiple ports with the same purpose (e.g. multiple net
data ports, or multiple QMI control ports), sort them by name by
default.

The port order does not make any difference for ports that have
flagged with a specific purpose (e.g. AT primary).

The sorting is done both in the internal lists and when looking up
ports with find_ports().
2020-11-20 09:24:51 +00:00
Aleksander Morgado
65560dd885 build: qcom-soc plugin by default disabled
It will not be automatically enabled by the implicit
--enable-all-plugins; instead, it must be explicitly enabled with
--enable-plugin-qcom-soc.

This plugin only makes sense under very specific SoC builds, so there
is no point in always building it by default. It should be explicitly
requested only in those SoC builds that are really going to make use
of it (e.g. postmarketOS).
2020-11-20 09:24:51 +00:00
Stephan Gerhold
9065e3b227 qcom-soc: simplify port type hint rules 2020-11-20 09:24:51 +00:00
Aleksander Morgado
8fc60754dd qcom-soc: new plugin for Qualcomm SoCs
This plugin implements support for old Qualcomm SoCs like the MSM8916
or the MSM8974, where:
 * control ports are available via RPMSG channels exported as devices
   e.g. with rpmsgexport:
   https://github.com/andersson/rpmsgexport
 * network ports are exposed by the bam-dmux kernel driver:
   https://github.com/msm8916-mainline/linux/commits/bam-dmux

Adding support for newer Qualcomm SoCs (e.g. QRTR+IPA) could be done
in a similar way on this very same plugin.

This plugin is the first and only one that implements support for a
modem device that is "built in" the system, as opposed to external
modems that may be available via USB or PCI.

The ID_MM_PHYSDEV_UID based udev tags provided by the plugin provide
the logic to bind all the SoC ports together in the same modem object,
and therefore ID_MM_PHYSDEV_UID should not be used by users to
override the ones set by the plugin.

All "rpmsg[0-9]*" ports that are considered part of the modem are
flagged as candidate, ignoring the parent "rpmsg_ctrl[0-9]*" ports on
purpose. This setup therefore assumes that the channels have been
exported already as devices (e.g. using rpmsgexport).

libqmi 1.27.2 is required to support the "WDS Bind Data Port" message.
2020-11-20 09:24:51 +00:00
Aleksander Morgado
cab4b54ad1 core: new 'rpmsg' subsystem
Most older Qualcomm SoCs (e.g. MSM8916, MSM8974, ...) communicate with
the integrated modem via shared memory (SMD channels). This is similar
to QRTR on newer SoCs, but without the "network" layer. In fact, the
older SoCs also have QRTR, but the modem QMI services are not exposed
there.

The mainline Linux kernel exposes SMD channels via the "remote processor
messaging bus" (rpmsg). Through special IOCTL calls it is possible to
create a char device for a rpmsg/SMD channel. We can then use these to
send QMI/AT messages to the modem, much like the ordinary serial char
devices when using a Qualcomm modem through USB.

This commit introduces support for the new 'rpmsg' subsystem, which
allows exporting QMI-capable and AT-capable ports.

By default NO rpmsg port is flagged as candidate, it is assumed that
the plugin adding support for the rpmsg subsystem will add specific
rules to do so (e.g. so that non-modem ports are explicitly not
flagged as candidate).

All rpmsg ports will be probed for AT or QMI capabilities, unless
explicit port type hints (e.g. ID_MM_PORT_TYPE_QMI or
ID_MM_PORT_TYPE_AT_PRIMARY) are set.

These changes are highly based on the initial integration work done by
Stephan Gerhold <stephan@gerhold.net> in postmarketOS, see:
  https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/363
2020-11-20 09:24:51 +00:00
Aleksander Morgado
3d12272d18 kerneldevice: allow loading port attributes
In addition to loading port and device properties, we now also allow
loading sysfs properties that are assumed to be static (i.e. their
values won't change since loaded the first time).
2020-11-20 09:24:51 +00:00
Aleksander Morgado
399a042dad bearer-qmi: support binding to data port
Allow plugins to specify a QmiSioPort value to bind to. This is used
e.g. in the RPMSG+BAM-DMUX setup in order to allow any RPMSG port to
control all the available net ports.
2020-11-20 09:24:51 +00:00
Aleksander Morgado
3be07bb38d tests,cdma: test CDMA SMS with different text lengths 2020-11-20 00:40:39 +01:00
David Leonard
7ac42e7648 sms: fix 7-bit ASCII SMS decoding
Fixes an issue where (5+8n)-character long SMS messages received on a
CDMA network would be dropped with a "cannot read user data" error,
while other length SMS messages would be delivered fine.

Fix thanks to Peter Hunt
2020-11-20 00:40:39 +01:00