Commit Graph

2305 Commits

Author SHA1 Message Date
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
Carlo Lobrano
ac243f9467 sms: prevent crash if date is out of range
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out
of range, and currently mm_new_iso8601_time passes the GDateTime created
by those two functions to date_time_format_iso8601 without checking for
NULL values, causing a g_date_time_format_iso8601 crash if PDU data is
corrupted with wrong date.

To prevent this, mm_new_iso8601_time now can return NULL and set a new
GError if GDateTime created by g_date_time_new is NULL.

Fixes #546
2022-04-08 15:41:49 +02:00
Carlo Lobrano
e175ada2ce plugins,telit: remove unnecessary after sim unlock 1s delay
Currently the Telit modem implements modem_after_sim_unlock() with 1s
timeout, however the #QSS URC management (introduced later) waits for
QSS=1 URC in csim_unlock_periodic_check up to 3s, which makes this 1s
delay not necessary anymore.

see also:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/3
2022-04-07 10:29:33 +02:00
Carlo Lobrano
cf7b58ce21 telit: reorganize common_parse_bnd_response for readability 2022-03-29 14:18:55 +00:00
Carlo Lobrano
c208d33e5b telit: fix AT#BND parsing for LE910C1-EUX
Some modems, like LE910C1-EUX, express the LTE part of #BND output in
HEX format, but currently the MM parser for such case is limited to
modems that have "ext_4g_bands". This commits use the new MMTelitModel
info to decide how to parse #BND command output.

Fixes #487
2022-03-29 14:18:55 +00:00
Carlo Lobrano
30a35e6dc3 telit: detect modem model from revision
Telit revision string can be used to identify the specific model, which
in turn is useful to specialize the behavior of the plugin.

This change adds revision parsing to detect some telit modems. Initially
it adds the ones that have different behaviors in #BND output parsing
for example.
2022-03-29 14:18:55 +00:00
Carlo Lobrano
3df96a4255 telit: override load revision
Currently, firmware revision string is obtained via AT+CGMR or AT+GMR
commands from the default mm-broadband-modem. For a class of Telit
modems however this command does not return the actual Telit Software
Package version, but the "Modem FW Version", which is only a component
of the whole firmware. For this class of modems, the correct string is
obtained with "AT#SWPKGV" command.

This change overrides load_revision* functions to add the ability to
parse "AT#SWPKGV" command for the modems that support it, and falls back
to the same logic that was implemented in mm-broadband-modem otherwise.
2022-03-29 14:18:55 +00:00
Aleksander Morgado
ea247f7e69 foxconn: consolidate checks for T99W175 and T99W265
These two devices require QDU and MCFG+APPS version string
comparison. We now have a single place where we check for this
requirements.
2022-03-28 08:06:10 +00:00
Aleksander Morgado
cd2dd20b08 foxconn: consolidate logic deciding required update methods 2022-03-28 08:06:10 +00:00
Aleksander Morgado
b16b49f9d5 foxconn: consolidate logic deciding requested firmware version type
We don't want to have in two different places the vid:pid match list
when selecting the type of firmware version we ask for.
2022-03-28 08:06:10 +00:00
Aleksander Morgado
4efb5f61cf foxconn: switch to use autoptr() in firmware info loading 2022-03-28 08:06:10 +00:00
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
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
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
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
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
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
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