Commit Graph
2327 Commits
Author SHA1 Message Date
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
Rukun Mao 3da84c2079 suspend: add suspend/resume support with powerd on ChromeOS
ModemManager handles suspend and resume signals sent from powerd

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-06-09 08:32:13 +00:00
Daniele Palmas 0f1cd36e65 telit: add LE910Cx MBIM composition port hints 2022-05-24 09:22:06 +02:00
Daniele Palmas 1642c5e00f telit: add wwan support 2022-05-24 09:22:06 +02:00
Daniele Palmas 654c5f5014 base-modem: add subsystem vendor ID property
Subsystem vendor ID can be used for identifying PCI modems,
so expose the property.
2022-05-24 09:22:06 +02:00
Aleksander Morgado b497de325a iface-modem: common SIM event reporting logic
We no longer have separate mm_base_modem_process_sim_event() and
mm_broadband_modem_sim_hot_swap_detected() methods. The only
difference between both of them was that one of them would attempt to
cleanup the ports context associated to the SIM hot swap event logic
as soon as a swap was detected, in order to avoid queueing up multiple
such events.

The previous logic wasn't working well, though, as there could be
mixed AT+QMI or AT+MBIM devices that would also require that same
cleanup and so we didn't always know which one should have been
called.

Now we have a single mm_iface_modem_process_sim_event() method, which
will trigger the reprobe and disabling, but which will also perform
the cleanup of the SIM ports swap setup as specified by the
implementation.

So, if a plugin explicitly initializes the serial ports context for
SIM hot swap handling, it should also explicitly clean it up.

Also, the initialization of the serial ports context for SIM hot swap
handling is no longer done automatically for all modems, it will be
done only for those modems using it; i.e. the modems that explicitly
report support SIM hot swap handling using AT URCs.
2022-05-20 09:03:54 +00:00
Aleksander Morgado c987757a2c broadband-modem-mbim-quectel: SIM hot swap supported by default in MBIM 2022-05-20 09:03:54 +00:00
Aleksander Morgado 61144e2103 iface-modem: remove MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED property
This property is used in the MMIfaceModem to flag whether the SIM hot
swap setup has been performed or not. The flag is now moved to the
iface-specific private context.

The property was also used in AT-based modems, so that implementations
supporting the SIM hot swap via AT URCs could flag the upper layers
whether the enabling of the feature was done correctly or not, and if
so, create and keep the AT ports context open. But this feature only
made sense in AT-based modems, i.e. an MBIM modem that detects SIM hot
swaps via MBIM indications exclusively should not require the AT ports
context open for anything. The check in the MMBroadbandModem object
has therefore been removed, and the logic will be updated so that it
only applies to AT-based modems.
2022-05-20 09:03:54 +00:00
Aleksander Morgado c659492022 xmm: wait for +XLSRSTOP URC before starting next session
It is important to gracefully stop the session before starting the
next session, making sure the engine is completely stopped. This can
be ensured by waiting for the +XLSRSTOP URC just after having received
the +XLSRSTOP command response.

We'll do an explicit wait for that URC with a 10s timeout, in order to
avoid waiting forever if the URC is never received. It will be assumed
that the engine is off if the 10s timeout happens, in the same way as
we were doing until now.

During the wait time for the URC, the operation task ownership is
shared among the response processor, the URC handler and the timeout
source. Once any of them decides to complete the task, the others will
automatically avoid attempting to complete the same task.

Based on a patch originally developed by:
Som_SP <somashekhar.puttagangaiah@intel.com>
2022-05-19 11:45:37 +00:00
Andrew Lassalle 3745ce8b1f Revert "plugins,fibocom: Add udev filter for pci wwan"
This reverts commit 115a5d876e.
2022-05-09 14:24:09 -07:00
Andrew Lassalle 115a5d876e plugins,fibocom: Add udev filter for pci wwan
Add a udev filter to identify pci wwan ports from fibocom modems.
2022-05-05 09:35:36 -07:00
Aleksander Morgado 4207ee61b7 huawei: disable +CPOL based features in Huawei E226
Issue and bugfix suggestion by Alex Leopoldo Villacís Lasso.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/552
2022-04-15 15:23:53 +02:00
Konrad Zapałowicz 96fb425906 cinterion: add PLS63 port type hints
The PLS63 is a drop-in replacement for PLS62 model, however it uses
different USB SoC and enumerates differently on the USB bus.

This commit adds relevant type hints with a correct Vendor and Product
IDs so that the device is correctly discovered. Without these type hints
the modem would not work correctly as it uses wrong port for PPP.
2022-04-13 22:10:21 -07:00
Carlo Lobrano 0645b70aea plugins,telit: SWPKGV parsing needs more permissive regex
In some cases the "base" software package string does not have the
currently expected format of \d{2}.\d{2}.\d{3}. Specifically the last
triplet of characters might not be digits. For example a valid version
string might be 25.20.-04, which the current regex is unable to parse.

This change replace the previous regex with one less restrictive,
checking only the first part of the version's format.
2022-04-12 08:46:29 +02:00
Carlo Lobrano 818b539d65 test,modem-helpers-telit: fix test inputs
test input strings for test_telit_parse_swpkgv_response invert <CR> and
<LF>. The correct match is \r for <CR> and \n for <LF>.
2022-04-11 17:49:37 +02:00