Commit Graph

2341 Commits

Author SHA1 Message Date
Aleksander Morgado
f419f56628 build: drop autotools 2022-11-07 14:26:02 +00:00
Aleksander Morgado
7ea2452b1e build: fix building without tests support 2022-11-07 14:25:34 +00:00
Aleksander Morgado
30d77d378a build: fix building without MBIM support
The foxconn shared utils are only built when MBIM is enabled, and
therefore the dell and foxconn plugins should only expect those shared
utils to be present if MBIM is enabled. The foxconn plugin will be
fully disabled when MBIM is disabled.

The fibocom shared utils are only built when MBIM is enabled, and
therefore the fibocom plugin should not expect them built
unconditionally, they will only be present if MBIM is enabled
2022-11-07 14:25:34 +00:00
Aleksander Morgado
b3f315ad2d core,log: new 'MSG' log level between 'INFO' and 'WARN'
We're bumping the current "INFO" level messages to the new "MSG"
level, also making the new level the default.

The old "INFO" level will be used to setup an intermediate level of
logging which is not as verbose as "DEBUG" but still provides some
capabilities to analyze the behavior of a modem.
2022-11-04 13:12:56 +00:00
Alexey Orishko
1c4ba76295 plugin, telit: set last band to EUTRAN_85
Modems based on MDM9205 chipset support LTE Band 85, thus last define
was changed to reflect that band
2022-10-17 10:39:20 +00:00
Alexey Orishko
8ecc0f64e4 plugin, telit: add support for LPWA modem
- properly identity access technology for Cat-M and NB-IoT RATs
2022-10-17 10:39:20 +00:00
Fanice.luo
908ab33328 foxconn: updating the T77W968 requires MCFG+APPS version
updating T77W968(0x413c:0x81d7 ; 0x413c:0x81e0 ; 0x413c:0x81e4 ;
0x413c:0x81e6): supports FASTBOOT and QMI PDC, and requires MCFG+APPS
version.
2022-10-17 10:03:31 +00:00
Sven Schwermer
1ef46a6886 fibocom: Don't disconnect initial EPS bearer
During profile setup, the profile manager normally disconnects a profile
before re-using it. We do not want to do this for the initial EPS bearer
because that would trigger de-registration.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer
71a9739f1d fibocom: Set initial EPS bearer CID for MA510
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer
c509159dfe fibocom: Add initial EPS bearer support
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer
855977c4c7 fibocom: Implement power down/off
Also bump the timeout for the +CFUN operations as they may take up to
10s according to the AT command manual (e.g. MA510).

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:30 +00:00
Sven Schwermer
e5bb33a463 fibocom: Monitor connection status using +GTRNDIS?
In situations where the configured APN for the initial EPS bearer
(cid=1) does not match the APN for the actual connection, ModemManager
sets up a context (cid!=1) with the proper APN when connecting. If the
APN for the initial EPS bearer was not valid, the SIM may fall back to a
default one. If that default matches the APN for the proper connection,
the initial EPS bearer is re-used for the actual connection. In that
scenario, +CGACT? will report deactivated for the actual connection
context (cid!=1). ModemManager subsequently reports the connection as
disconnected.

+GTRNDIS? will always reflect the correct state for the context ID we
used to set up the ECM connection. Hence, it makes sense to use this
command to assess the connection status.

This has been tested with the MA510-GL modem module.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:30 +00:00
Fanice.luo
fab0481027 foxconn: remove QMI_SERVICE_FOX from Generic MBIM modem object
Allocate the fox_client to attempt loading the firmware info using
QMI_SERVICE_FOX,and release it when no longer needed.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/599
2022-10-10 11:46:57 +00:00
Carlo Lobrano
651ddb95d1 plugins,telit: LM940 has LTE band ext after given version
Currently, LM940 is expected to have not LTE band extended, however they
have been introduced since version 24.01.516.

This change adds a software revision compare function for Telit modem
limited to LM9x0 modems (LM940 and LM960 share the same revision format
string) to verify if the current LM940 software revision is equal or
newer than 24.01.516 and enable/disable LTE band extended accordingly.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
072c8eba9e plugins,telit: LM960 has LTE extended bands 2022-09-29 07:03:37 +00:00
Carlo Lobrano
7f82c38dcb plugins,telit: Detect alternate_3g_bands flag from modem model
Currently, mm-shared-telit:Private:alternate_3g_bands value provided via
ID_MM_TELIT_BND_ALTERNATE tag.

This commit maps the value of alternate_3g_bands to the modem model,
detected via software version string.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
72ca66765f plugins,telit: Detect ext_4g_bands flag from modem model
Currently, mm-shared-telit:Private:ext_4g_bands value is inferred from
the #BND? response, based on the convention that the #BND? response has
4 tokens only if the modem has LTE extended bands.

This commit maps the value of ext_4g_bands to the modem model, detected
via software version string, which is a more reliable source.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
b0c5756b0f plugins,telit: Add MM_TELIT_MODEL_FN990 2022-09-29 07:03:37 +00:00
Carlo Lobrano
049c5ab277 plugins,telit: remove unnecessary argument
is_bnd_4g_format_hex() function does not need MMBaseModem.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
3ab3d5e899 plugins,telit: refactor to reduce scope of variable
In mm_telit_build_bnd_request the scope of some 3g related variables can
be reduced.
2022-09-29 07:03:37 +00:00
Carlo Lobrano
a55384d7b0 plugins,telit: refactor functions dealing with #BND
Currently functions dealing with #BND request

- mm_telit_parse_bnd_query_response
- mm_telit_parse_bnd_test_response
- mm_telit_build_bnd_request

have all a long list of arguments configuring how to deal with the BND
string.

This commit reworks this list of arguments into a single new structure
"MMTelitBNDParseConfig" with the following advantages

- shorter list of arguments for the above functions
- future changes to this arguments will be transparent for the functions
  above that only pass the values
- one single point where the structure is created: a new function
  mm_shared_telit_get_bnd_parse_config.
2022-09-29 07:03:37 +00:00
Christian Taedcke
99cde83942 cinterion: Fix CDC-ECM support for ELS61-E2
When the data connection is started with AT^SWWAN, the modem expects
the DHCP discover packet from the TE while the command is running,
i.e. while the modem has not replied yet. In order to achieve that,
the bearer is marked as connected as soon as the command is
issued. This makes the NetworkManager start the DHCP process.

If the modem replies with an error, the bearer will be marked
disconnected later on.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/50
for a similar functionality in the ublox driver.

Includes minor coding style fixes from Aleksander Morgado
<aleksandermj@chromium.org>.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2022-09-28 10:47:45 +00:00
Christian Taedcke
a25b45f795 cinterion: add support for mode setting using SXRAT
The previously used COPS command to set to LTE-only mode did not work
for an ELS81 modem.
Now ^SXRAT is used to switch modes instead of COPS, if SXRAT is
supported by the modem.
2022-09-28 10:26:08 +00:00
Sven Schwermer
fcd393a6c2 quectel: Trigger reprobe upon RDY URC
Apparent self-resets without re-enumeration have been observed on
Quectel modems EC21 and EG91. See #285 and
https://lists.freedesktop.org/archives/modemmanager-devel/2022-September/009407.html

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/285

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-09-28 09:22:55 +00:00
Aleksander Morgado
011f9b366b foxconn: carrier mapping conf file shouldn't be executable 2022-09-15 09:30:33 +02:00
Aleksander Morgado
726442b576 fibocom: source files shouldn't be executable 2022-09-15 09:30:02 +02:00
Ivan Mikhanchuk
fca0e3a2f3 quectel: add MM_PLUGIN_REQUIRED_QCDM flag
EM120/160 uses QCDM port for firmware updates. fwupd lists all known
ports from ModemManager and uses QCDM port to reboot the modem into
the firmware download mode.
2022-09-08 13:34:02 +00:00
Fanice.luo
484d1d065e cinterion: add support thales PCIE vid(0x1269) in the cinterion.
For SDX55 and SDX65 can identify the corrrect plugin(cinterion), and the plugin is updated to support the wwan subsystem.
2022-09-08 11:44:57 +00:00
Aleksander Morgado
8eeaba1882 modem-helpers-ublox: rework +UIPADDR response parser
We setup all output variables with g_autofree and then use
g_steal_pointer() to return the needed ones.
2022-09-05 17:37:14 +00:00
Aleksander Morgado
e6c40349b8 modem-helpers-cinterion: rework CNMI test response parser
We setup all output variables with g_autoptr() and then use
g_steal_pointer() to return the needed ones.
2022-09-05 17:37:14 +00:00
Aleksander Morgado
74fc5baca2 core: port GRegex/GMatchInfo to use autoptr()
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1
to pcre2. In some cases it was made more strict, which is fine, in
other cases it exposed some change in how it behaves on certain
matches that is not extremely clear whether it's ok or not.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2729
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621

Either way, one thing that was assumed was that initializing all
GRegex/GMatchInfo variables to NULL and making sure they're NULL
before they're initialized by glib (especially the GMatchInfo) was a
good and safer approach.

So, whenever possible, g_autoptr() is used to cleanup the allocated
GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used
to ensure that no free/unref is attempted unless the given variable is
not NULL, and also so that the variable is reseted to NULL after being
disposed.
2022-09-05 17:33:11 +00:00
Carlo Lobrano
34d534a520 plugins,telit: add missing 4G BND HEX format modem models
Currently, supported band AT query #BND=? is failing with LM9x0 because
it expects BND 4G decimal format instead than hexadecimal.

Adding also LN920 and FN980 for completeness. They do not fail right now
because they have also "4g band extended" which format is always
hexadecimal.
2022-09-05 11:50:45 +00:00
Aleksander Morgado
ff7e062e94 mtk: fix task completion when loading supported modes 2022-08-25 13:33:45 +00:00
Aleksander Morgado
0d6b6ebcf1 icera: fix double free on %%IPSYS=? response processing 2022-08-25 13:31:12 +00:00
Stephan Gerhold
bc1cecbfc4 broadband-modem-qmi: choose endpoint number based on data port
At the moment the endpoint type/number is chosen based on the QMI
control port. The assumption is that multiplexing is implemented using
an additional protocol layer (e.g. QMAP) or that each network interface
has its own QMI control port.

This is not necessarily the case for BAM-DMUX. To use the built-in
multiplexing the WDS client must be bound to the correct data port.
This works already for older firmware versions using "Bind Data Port"
(SIO port numbers), but not for newer ones using "Bind Mux Data Port"
(endpoint type/interface numbers).

Make it work for newer firmware versions as well by choosing the
endpoint type/number based on the data port similar to the existing
implementation for SIO port numbers.

Note: The correct endpoint interface number is currently only used for
the steps in mm-bearer-qmi. Ideally more refactoring should be done in
mm-port-qmi to call WDA Set Data Format for each of the endpoints.
In practice it usually works fine without because the data format is
set correctly by default.
2022-08-18 18:12:49 +02:00
Stephan Gerhold
4ab459109d qcom-soc: simplify QMI port lookup for BAM-DMUX
mm_broadband_modem_qmi_peek_port_qmi() already looks up a QMI port
exactly the same way it is implemented in the BAM-DMUX variant of
peek_port_qmi_for_data(), so we can just reuse it to simplify the code.

No functional change.
2022-08-18 15:35:35 +02:00
Dan Carpenter
a8b9058a0c sierra: disable CPOL in the GL7600
Similar to the EM7345 (also from Sierra Wireless), the GL7600 becomes
unresponsive after using "AT+CPOL?".

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/595
2022-07-20 13:09:46 +02:00
Prakash Pabba
5c0db37432 mm-iface-modem,mm-broadband-modem,mm-shared-qmi: support SIM IMSI switch
It is possible that SIM IMSI might change in roaming conditions for a sim.

Register for UIM refresh indication always and reprobe if ICCID or IMSI changes for QMI modem.
2022-07-16 22:22:59 +02:00
Fanice Luo
c8a4a76630 foxconn: updating the T77W968 carrier mapping table
add new MCCMNC of EE UK(23430,23431,23432,23433,23434,23476,23501,23502,23577)
add new MCCMNC of ATT(310650,310980,90118)
add new MCCMNC of Verizon(312770)
add new MCCMNC of Vodafone(46601,46603)
add new MCCMNC of Orange(21409,23105,26005)
2022-07-14 14:18:16 +08:00
Fanice Luo
f2a3d836db dell: Add DW5829e(T77W968) modules
add new device(0x413c:0x81e4 0x413c:0x81e6)
2022-07-12 09:00:11 +00:00
Sven Schwermer
bbf1b272e6 fibocom: Ignore +SIM READY URC
This URC is emitted when the SIM phonebook is initialized. We don't care
about that but don't want this URC to mess with the initialization
sequence either.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-07-11 11:50:00 +00:00
Sven Schwermer
eebdbc45b5 fibocom: Add alternative MA510 USB config
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-07-08 08:26:33 +02:00
Sven Schwermer
38646bb68f fibocom: Add alternative L610 USB config
This is the factory-default setting. Make sure to support it as well as
the ECM/RNDIS settings. The L610 in GTUSBMODE=31 only enumerates with
serial USB interfaces using the option driver, so we need to allow that
driver too.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-07-08 08:25:40 +02:00
Sven Schwermer
a2195babf2 fibocom: Fix GTRNDIS parsing function
This fixes a bug introduced in a2a0e2d754. Since the state pointer is
always non-NULL, the function will always fail if GTRNDIS is inactive,
i.e. the modem will return state=0 and no cid field.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-06-28 14:39:01 +02:00
Sven Schwermer
a2a0e2d754 fibocom: ensure RNDIS disconnected before a new connection attempt
The ECM dialling guide requires to check whether RNDIS is already active
before attempting to establish an ECM/RNDIS connection.

If it is active (regardless of its settings), we will disconnect it
first, before attempting the new connection with the user-provided
settings.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-06-27 19:15:31 +00:00
Carlo Lobrano
b9ca16486e telit:broadband-mbim: save MBIM originated revision into software_package_version
Currently, MBIM broadband Telit modem does not store firmware revision
into 'software_package_version', so it won't be possible to specialize
behavior based on modem model (using mm_telit_model_from_revision).

This change overloads load-revision in MBIM broadband Telit in order to
call parent's loading and store the returned 'caps_firmware_info' into
'software_package_version' via mm_shared_telit_store_revision.
2022-06-22 08:37:34 +02:00
Carlo Lobrano
50f20163d4 telit: add function to store revision 2022-06-22 08:37:21 +02:00
Daniele Palmas
9d10dd8aab telit: add support for QCDM ports
The new QCDM probing mechanism does not probe and grab QCDM ports
if the plugin is not allowed, so QCDM ports currently ignored in
compositions can be safely marked as ID_MM_PORT_TYPE_QCDM.
2022-06-19 13:40:48 +00:00
Daniele Palmas
473c41dc63 plugins: add MM_PLUGIN_REQUIRED_QCDM to plugins requiring QCDM
The new QCDM port probing and grabbing mechanism implements a new
property for detecting the plugins which require the QCDM port to
be probed and grabbed.

Add the property to the affected plugins.
2022-06-19 13:40:48 +00:00
Carlo Lobrano
19a0ea6cf9 plugins,telit: do not crash if revision is not set
In mm_telit_model_from_revision there is nothing that prevents to use
the input revision string if it is NULL, which currently happens if
the modem is pure MBIM (i.e. LE910-V2 pid:0x0032).

Fix the above error returning a default safe value and not using the
NULL variable.
2022-06-09 08:50:29 +00:00