Commit Graph

8313 Commits

Author SHA1 Message Date
Aleksander Morgado
fa6d64550b base-sim: implement GID1 and GID2 loading using AT commands 2022-09-30 13:51:56 +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
2c66d43bb9 broadband-modem-qmi: select last used level when enabling SAR
Same as we do in the MBIM protocol implementation.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
1ea5a577e3 iface-modem-sar: report updated level on SAR enable
The SAR enable operation may be selecting an explicit SAR level by
itself, so make sure the protocol implementation reports back to the
interface the default level that was used while enabling SAR.

No level change is reported in the interface if the SAR is being
disabled.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
950d36d4ee iface-modem-sar: avoid changing level if already in the target level 2022-09-27 08:28:07 +00:00
Aleksander Morgado
72457c25f4 iface-modem-sar: avoid changing state if already in the target state 2022-09-27 08:28:07 +00:00
Aleksander Morgado
b50c24acd1 iface-modem-sar: disallow changing SAR level if SAR disabled
This was already forbidden in the MBIM implementation, and we should
also have it in the QMI implementation, so just make it a generic
check in the interface.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
0994087f18 iface-modem-sar: fix set power level async method completion
Not a big deal because both enable_finish() and set_power_level()
finish were doing the same thing until a recent change.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
258b8f8ee5 broadband-modem-qmi: attempt to preallocate SAR client
Otherwise the SAR support check will fail.
2022-09-27 08:28:07 +00:00
Madhav
04e7f777be broadband-modem-qmi: Implement the SAR interface
Implement the sar interface for QMI modems.
2022-09-27 08:28:07 +00:00
Aleksander Morgado
4a36f50de8 iface-modem-3gpp-profile-manager: fix requested IP type normalization
mm_iface_modem_3gpp_profile_manager_set_profile() was changed so that
the input profile object was not touched, and instead a copy of the
same would be used within the method.

Unfortunately, that change missed the update of the IP type
normalization step, which would end up modifying the original settings
instead of the newly created copy.

Fixes 7464940971
2022-09-26 08:49:47 +00:00
Aleksander Morgado
7b0b3e7e48 iface-modem-3gpp: helpers to check if specific domains are supported 2022-09-20 14:09:41 +00:00
Aleksander Morgado
1fa67b3842 iface-modem-3gpp: allow applying domain registration updates altogether
When processing QMI and MBIM messages to report domain registration
updates, we should do that altogether so that we don't report bogus
transitions to idle if the registration state switches from one domain
to another.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/629
2022-09-20 14:09:41 +00:00
Aleksander Morgado
453e8bc7d1 iface-modem-3gpp: fix clearing 5GS reg status if explicit registration fails 2022-09-20 14:09:41 +00:00
Xiao Liyun
cd5e22841a api,enums: added NGRAN-53 band
According to 3GPP Rel16.3, 38104, band NGRAN-53 is supported.
Band info as below:
n53 2483.5 MHz - 2495 MHz, TDD

Signed-off-by: Slark Xiao <slark_xiao@163.com>
2022-09-19 08:46:52 +00:00
Jack Song
ab80c31898 mm-iface-modem: don't attempt to check lock status when current active slot have eSIM without profiles
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/630
2022-09-19 16:11:48 +08:00
Alexey Orishko
4ab2c80858 enum, bearer: added non-ip bearer 2022-09-16 10:52:56 +00:00
Alexey Orishko
664610819e enum,MMModemAccessTechnology: added Cat-M and NB-IoT LPWA access technologies 2022-09-16 10:52:56 +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
Andrey Skvortsov
22ba849724 charsets: Add test_text_split_two_pdu_gsm7_extended_chars to use extended character 2022-09-13 20:49:01 +00:00
Andrey Skvortsov
4ebf8ca4e0 sms: fix spliting messages into chunks in gsm7 encoding
1) Not every allowed GSM7 character in UTF-8 incoding takes one
byte. Some (for example, 'à') take several bytes in input string, but
signle byte in GSM7.
2) Extended characters in GSM7 encoding take two bytes.

Otherwise for example sending following SMS fails:

```
 mmcli -m a --messaging-create-sms="text='[wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww',number='+XXXXXXXXXXX'"
Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/99
 mmcli --send -s 99
error: couldn't send the SMS: 'GDBus.Error:org.freedesktop.libqmi.Error.Protocol.WmsEncoding: Couldn't write SMS part: QMI protocol error (58): 'WmsEncoding''
```

```
mmcli -m a --messaging-create-sms="text='|àààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààà',number='+XXXXXXXXXXX'"
Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/72
mmcli --send -s 72
error: couldn't send the SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.InvalidArgs: Couldn't convert UTF-8 to GSM: input UTF-8 validation failed'
```
2022-09-13 20:49:01 +00:00
Andrey Skvortsov
2ece78c80f charsets: move mm_sms_part_3gpp_util_split_text to mm_charset_util_split_text 2022-09-13 20:49:01 +00:00
Aleksander Morgado
9f5a84f777 sim-mbim: implement loading GID1 and GID2 of active SIM 2022-09-12 08:41:38 +00:00
Aleksander Morgado
6e04142a96 sim-mbim: preload id of active UICC application
This would be the application id that refers to the active SIM card.
2022-09-12 08:41:38 +00:00
Akash Aggarwal
af9b6d4f2d mm-bearer-qmi: Add Support for PCO
Get PCO information after the call is established
by using get runtime settings request
Register for Extended IP configuration Indication

If PCO is changed we get the indication and refetch
the pco information from modem

Send the PCO info using 3gpp_update_pco_list
2022-09-09 18:51:26 +05:30
Aleksander Morgado
61e540c8d9 sim-mbim: minor coding style fix 2022-09-08 14:06:31 +00: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
cb676b5964 modem-helpers-mbim: add new MBIM PIN types 2022-09-07 22:35:20 +00:00
Aleksander Morgado
9fbeb3348e build: require libmbim 1.27.9 for the MBIM UICC file read support 2022-09-07 20:40:38 +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
9bbc768666 modem-helpers: rework the +CGEV indication 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
845667c7b3 modem-helpers: rework +CGCONTRDP 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
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
Akash Aggarwal
b2a186b5c8 mm-broadband-modem-qmi: fix updating access technology and location
Access technology and location properties are updated if modem is in
registered state.

Cache and update them when processing DSD system status indication.
2022-09-05 13:00:54 +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
51a333cd9a test-modem-helpers: add EOL to strings matched with G_REGEX_NEWLINE_CRLF
Looks like pcre2 (used since glib 2.73.2) requires EOLs to match if
G_REGEX_NEWLINE_CRLF is explicitly used. The tests are updated
accordingly, because the modem responses will anyway have the EOLs
as well.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1544130

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
2022-09-02 17:23:56 +02:00
Aleksander Morgado
79a5a4eed2 serial-parsers: fix invalid EXZ error parser
Passed undetected when glib2 was using pcre1, it triggers an error now
with pcre2.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1542038

Reported and fix suggested by: Marco Trevisan (Treviño) <mail@3v1n0.net>
2022-09-01 15:06:04 +02:00