Commit Graph

8067 Commits

Author SHA1 Message Date
Aleksander Morgado
b81680a3fd foxconn: remove unneeded input bundle unref 2022-03-28 08:06:10 +00:00
Freedom Liu
a56f96f074 foxconn: use new qmi service(fox) to get firmware version
foxconn modules get firmware version:
Try with the new FOX service first. If FOX service failed, try with DMS service.
T99W175(vid:105b) ; T77W968(0489:e0b4 ; 0489:e0b5):
    qmi service: dms
T99W265(0489:e0da ; 0489:e0db):
    qmi service: fox
2022-03-28 08:06:10 +00:00
Aleksander Morgado
8d0d90a6dd build: require libqmi 1.31.4 for FOX service support 2022-03-28 08:06:10 +00:00
Iñigo Martínez
0bc0831b22 build,meson: Fix udev rules and keyfiles tests
The port to the meson build system a set of defines were lost, that
made the udev rules and the keyfiles tests to not run properly.

This has been changed so defines are now in their proper place and
tests are run properly.

Fixes #537
2022-03-27 00:02:23 +01:00
Aleksander Morgado
1fdc3ac703 linktop: new port type hints
Flag ttyACM0 as data port and ttyACM1 as primary port, as per
https://bugzilla.gnome.org/show_bug.cgi?id=637140#c10

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/14
2022-03-26 15:51:11 +01:00
Theodore A. Roth
e8bb90e006 cinterion: Add support for PLSx3w modems
Signed-off-by: Theodore A. Roth <theodore_roth@trimble.com>
2022-03-25 11:22:46 +00:00
Stephan Gerhold
8d95c82f9c shared-qmi: ignore slot status indications until initial status is known
Recent ModemManager versions no longer work on the Samsung A5 (Qualcomm
MSM8916) smartphone: MM ends up in an infinite loop trying to probe the
modem over and over again.

Looking at the debug log it seems to be related to a "Slot Status"
indication that comes in during probe time and causes MM to restart
the probing process:

    [/dev/wwan0qmi0] Sent generic request (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Register Events" (0x002E)
      << TLV: translated = physical-slot-status
    [/dev/wwan0qmi0] Received generic indication (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Slot Status" (0x0048)
      << TLV: translated = { [0] = '[ physical_card_status = 'present', ...
    [/dev/wwan0qmi0] Received generic response (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Register Events" (0x002E)
      << TLV: translated = SUCCESS
    [modem42] registered for slot status indications
    [/dev/wwan0qmi0] Sent generic request (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Get Slot Status" (0x0047)
    [modem42] received slot status indication
    [modem42] An active slot had a status change, will reprobe the modem
     <infinite loop>

The "Slot Status" indication (uim_slot_status_indication_cb) arrives
immediately after starting to listen for the event, which is before
ModemManager has actually loaded the initial slot status in
uim_get_slot_status_ready. In this situation !slot_array_status_equal()
will always cause the modem to reprobe, even though it is not necessary
during the probe phase.

To fix this add a simple check to uim_slot_status_indication_cb() that
ignores the indication if the initial slot status was not loaded yet.
2022-03-23 20:39:14 +01:00
Aleksander Morgado
8ab31cf0e6 broadband-modem-mbim: consolidate initialized SIM creation method
The logic to create a new SIM object from the slot status info was
used in several places.
2022-03-22 21:53:08 +00:00
som
035879dab9 broadband-modem-mbim: update sim-type and esim-status of inactive slot
During initialization if the number of slots is more than 1 then
update the sim-type and esim-status of the inactive slot as well.
2022-03-22 21:53:08 +00:00
Daniele Palmas
c447785fd8 telit: fix mode 'any' setting with AT commands
When setting mode 'any' with +WS46 command the supported modes
should be considered for choosing the at command correct argument.
2022-03-18 16:32:24 +01:00
Aleksander Morgado
598d99b5bd test,modem-helpers: add test for the EM9191 COPS=? response
Including 5GNR network reporting (act=12)

https://forum.sierrawireless.com/t/5g-network-scan-with-the-em9191-operation-not-allowed/26374/9
2022-03-16 11:04:06 +00:00
Aleksander Morgado
2c8cfb4768 modem-helpers: improve and fix COPS=? numeric fields parsing
The numeric fields in the +COPS=? response were relying on a very weak
parsing logic, assuming that they were single-digit numeric values and
not using the common string to integer conversion utilities.

This commit improves the conversion from the 3GPP/ETSI defined network
availability and access technology values to the MM defined ones,
providing enum-based matches even if the numeric values are the same.

The commit also fixes the parsing of access technology values > 10,
required to report 5G related values.
2022-03-16 11:04:06 +00:00
Aleksander Morgado
5ba67aff82 modem-helpers: act given in COPS=? may have more than one digit
The new 5GNR related values are >= 10, so don't expect one single
digit (\d), expect one or more (\d+).
2022-03-16 11:04:06 +00:00
Simon Deziel
8ce4555a79 systemd: don't run ModemManager in containers
This assumes the needed modem hardware is typically not available
inside containers. If however, the local admin configures the container
to get access to the hardware in question, ModemManager can be
instructed to run in that specific container by doing:

`sudo systemctl edit ModemManager.service`

Then entering the following text in the editor:

  [Unit]
  # Remove condition of "not container"
  ConditionVirtualization=

Upon saving/exiting, ModemManager can then be started with:

`sudo systemctl start ModemManager.service`

Signed-off-by: Simon Deziel <simon@sdeziel.info>
2022-03-14 10:30:45 -04:00
Sven Schwermer
95eef34d37 modem-helpers: Consider minimum ID when choosing best profile
+CGDCONT? may list profiles with IDs that are illegal to write, i.e.
+CGDCONT=? returns a minimum ID larger than some of the existing
profiles. E.g. for Fibocom L610-EU, +CGDCONT=? returns

+CGDCONT: (1-7),"IP",,,(0-3),(0-4)
+CGDCONT: (1-7),"IPV6",,,(0-3),(0-4)
+CGDCONT: (1-7),"IPV4V6",,,(0-3),(0-4)
+CGDCONT: (1-7),"PPP",,,(0-3),(0-4)
+CGDCONT: (1-7),"Non-IP",,,(0-3),(0-4)

while the default EPS bearer is established at profile 0:

+CGDCONT: 0,"IP","xxx","xxx.xxx.xxx.xxx",0,0
[...]

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-03-09 22:43:20 +00:00
Aleksander Morgado
c74a377f98 fibocom: new shared interface for common logic
The set_initial_eps_bearer_settings() operation is the same in XMM
capable and generic MBIM modem objects. Place it in a common shared
interface so that we don't duplicate code.
2022-03-09 22:05:32 +00:00
Jack Song
5fc6b9ee1b fibocom: toggle modem power after attach APN on mbim 2022-03-09 22:05:32 +00:00
Prakash Pabba
92db190f37 mm-shared-qmi: Return an error in load_current_capabilities() if none is found. 2022-03-09 14:01:23 +00:00
Sven Schwermer
318bac1186 fibocom: Add reset functionality
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-03-09 09:23:15 +00:00
Aleksander Morgado
f7656de128 broadband-bearer: remove unused cid_selection_3gpp() method
It was replaced by the profile management operations instead in the
1.18 release.
2022-03-08 21:16:06 +01:00
Aleksander Morgado
84e22e9b98 intel: custom setup for all available AT ports
Fully disable send delay as we're using AT ports via the new WWAN subsystem.
2022-03-07 09:51:43 +00:00
Aleksander Morgado
671164a64f xmm: setup single GPS control port exclusively
Use the same logic always to decide which is the best GPS control/data
port, and then perform the initial port setup (GNSS engine off) only
that single port.
2022-03-07 09:51:43 +00:00
Aleksander Morgado
f3e885e067 xmm: prefer port flagged as AT_GPS_CONTROL to manage the GNSS engine
Use the new AT_GPS_CONTROL udev tag to decide which is the best port
to manage the GNSS engine.
2022-03-07 09:51:43 +00:00
Aleksander Morgado
343f27a5e7 api: allow tagging AT ports as GPS control
There are devices with multiple AT ports where only one of them is
supposed to be used for GNSS control (and data).
2022-03-07 09:51:43 +00:00
Aleksander Morgado
deaf0646c4 intel: inherit GNSS location support from the shared XMM interface
We're not going to implement all XMM shared operations from the shared
utils, as the newer Intel modems support the new operations in the
Microsoft MBIM Extensions.

Just inherit the GNSS management capabilities.
2022-03-07 09:51:43 +00:00
Aleksander Morgado
c3c4cdde7a intel: periodic signal checks disabled by default
As we can rely on async MBIM notifications.
2022-03-07 09:51:43 +00:00
Aleksander Morgado
5d6b9c56cc intel: SIM hot swap supported by default 2022-03-07 09:51:43 +00:00
Aleksander Morgado
2da9ee5bd1 intel: avoid attempting QMI over MBIM in non-Qualcomm device 2022-03-07 09:51:43 +00:00
Aleksander Morgado
4a895b2820 intel: disable data over TTY by default
Only data over NET is expected
2022-03-07 09:51:43 +00:00
som
fcf5e3af0d intel: new MBIM capable device 2022-03-07 09:51:43 +00:00
som
40c791e293 intel: new plugin for PCI devices with vendor id 0x8086
For now, just detecting the device and creating generic MBIM or AT
based modems.
2022-03-07 09:51:43 +00:00
Iñigo Martínez
81c3b59f75 build,meson: Fix daemon enums dependencies
meson generates the `mm-daemon-enums-types` source and header files.
These are used when building `ModemManager` executable and different
plugins. However, these enums are only stated as dependencies on the
`ModemManager` executable build.

This has been fixed by also adding the generated files targets as
dependencies in the required plugins.
2022-03-01 09:27:08 +01:00
Iñigo Martínez
2bc697ce32 plugins: Fix port enums includes
The `broadmobi`, `dlink`, `telit` and `tplink` plugins include the
`mm-port-enums-types.h` header. However, they do not use any symbol
defined there.

The `huawei` plugin as includes the `mm-port-enums-types.h` header
but it does not include the build targets as dependencies.

These issues have been fixed by removing the unnecessary includes
from `broadmobi`, `dlink`, `telit` and `tplink` plugins and by
including the enums build target in the `huawei` target.
2022-03-01 09:24:37 +01:00
Aleksander Morgado
17dca109dd broadband-modem-qmi: avoid the deprecated QmiMessageDmsGetStoredImageInfoInput type 2022-02-28 21:54:24 +01:00
Aleksander Morgado
18aa526f8c shared-qmi: use the new QmiSlotEidElement type
This type was introduced to avoid having GArrays of GArrays in libqmi.
2022-02-28 21:54:24 +01:00
Aleksander Morgado
a21b7740d8 shared-qmi: avoid the deprecated QmiConfigTypeAndId type
This type was a JSON description bug in libqmi, it should have never
been a struct by itself. This was changed in libqmi by the 1.31.3
snapshot, so let's use the new methods instead of the deprecated ones.
2022-02-28 21:54:24 +01:00
Aleksander Morgado
cfbbbdfbaa build: require libqmi 1.31.3
In order to use the new methods that avoid intermediate structs like
QmiConfigTypeAndId.
2022-02-28 21:54:24 +01:00
Sven Schwermer
b64ffeee9c fcc-unlock: Make scripts POSIX shell compatible
This allows us to not rely on bash which may not be available on
constrained systems, e.g. Yocto-built embedded systems. The scripts now
pass shellcheck.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-02-25 21:51:36 +01:00
guihkx
c615be77fd fibocom: remove executable bit from rules file
This silents a warning given by udev:

Configuration file /usr/lib/udev/rules.d/77-mm-fibocom-port-types.rules is marked executable. Please remove executable permission bits. Proceeding anyway.
2022-02-19 00:01:05 -03:00
Michal Mazur
5ead5875d7 broadband-modem-mbim: include puk locks in facilities
The MBIM command PIN LIST returns only status of pin locks and omits
puk-locked facilities. This caused the pop-up window for unlocking
PUK is not shown after reboot.
Currenty active PUK lock has to be obtained using additional call
for PIN command but only single facility is supported this way.
2022-02-17 20:27:17 +00:00
Michal Mazur
a719cb26f4 modem-helpers-mbim: add pin type to 3gpp facility converter 2022-02-17 20:27:17 +00:00
Aleksander Morgado
27f6679aa8 charsets: set error if UTF-8 validation fails
Otherwise, mm_modem_charset_bytearray_to_utf8() may return NULL
without error set, and that will trigger a crash in the caller.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/511
2022-02-17 09:59:24 +01:00
Aleksander Morgado
6aec0a6c80 sim-mbim: report error if decoding EID from APDU response fails
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/510
2022-02-16 21:48:19 +01:00
Aleksander Morgado
97c50e53af fibocom: detect ID_MM_FIBOCOM_INITIAL_EPS_OFF_ON on runtime
We won't create a full new different modem object based on whether the
ID_MM_FIBOCOM_INITIAL_EPS_OFF_ON tag is found or not. Instead, we
always will create the same object type, and detect whether the OFF/ON
cycle is required during runtime.
2022-02-16 13:04:45 +00:00
Aleksander Morgado
499cdf79dc fibocom: initial EPS settings update always available in parent
Assume that the method to change the initial EPS bearer settings is
always implemented in the parent, so that we can avoid the runtime
check.

This also fixes the codepath that would happen if the
iface_modem_3gpp_parent->set_initial_eps_bearer_settings == NULL
condition was valid, as that would end up with a GTask never completed.
2022-02-16 13:04:45 +00:00
Jack Song
d902ddfee5 fibocom: toggle modem power after attach APN
When the attach APN settings are changed, the device will go through a
radio on -> radio off -> radio on cycle so that the new changes are
taken into consideration.

This change is done in a Fibocom-specific MBIM modem implementation
because it's working around a firmware bug that would prevent for the
attach settings to be considered automatically.
2022-02-16 13:04:45 +00:00
Aleksander Morgado
45102fcd60 iface-modem-signal: polling and thresholds only in effect if modem enabled
If the modem is disabled:
 * Polling is completely halted.
 * Thresholds are disabled.
 * The user is allowed to call Setup() or SetupThresholds() to change
   the settings, even if the actual polling or thresholds setup isn't
   in effect.

When the modem is enabled:
 * Polling will be started if there is a existing polling rate.
 * Thresholds will be setup based on the existing threshold settings.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/504
2022-02-16 11:28:03 +00:00
Aleksander Morgado
5d953bbe8d ci: enable gtk-doc in meson build 2022-02-16 00:30:20 +01:00
Aleksander Morgado
9d4f3fff7e ci: enable tests in meson build 2022-02-16 00:29:17 +01:00
Aleksander Morgado
d2bc98a1eb tools,tests: make test-wrapper.sh.in template executable
So that when the meson build does the template replacement, the
generated file is also executable and can be used as Exec line in the
test DBus service file.

Fixes the 'test-stub' unit test in meson.
2022-02-16 00:27:51 +01:00