Commit Graph

2158 Commits

Author SHA1 Message Date
Aleksander Morgado
4cf12bb8bc helpers: skip g_warning() in mm_3gpp_parse_ws46_test_response()
Use mm_obj_warn() instead.
2021-06-16 11:59:51 +02:00
Ivan Mikhanchuk
83ac824705 quectel: add support for EM120/160 PCIe modules 2021-06-16 00:40:26 -07:00
Dylan Van Assche
c00eff43ac quectel: ignore QLWURC
QLWURCs are not ignored and causes calls to be rejected in some cases
2021-06-01 12:52:05 +02:00
Felipe Borges
0b8607bc5d cinterion: avoid maybe-uninitialized warning by GCC 10
Reported at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1371
2021-05-27 15:05:55 +02:00
Aleksander Morgado
6fae479bd7 plugins: ignore reload_connection_status() where not supported
Some of the AT-based connection methods don't have any way to query
connection status, or we don't have a proper implementation for those
yet. Ignore the reload operation in all those.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
4038c243f9 cinterion: reuse the same method for load and reload
The load_() method is used for connection monitoring; while the
reload_() method is used to sync connection status after a
suspend/resume operation. The same method can be used for both things
in the Cinterion plugin.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
c188ba3c15 sierra: reuse the same method for load and reload
The load_() method is used for connection monitoring; while the
reload_() method is used to sync connection status after a
suspend/resume operation. The same method can be used for both things
in the Sierra plugin.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
205f46620e novatel-lte: reuse the same method for load and reload
The load_() method is used for connection monitoring; while the
reload_() method is used to sync connection status after a
suspend/resume operation. The same method can be used for both things
in the Novatel LTE plugin.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
10651ba93f quectel: the generic AT based modem supports SIM hot swap 2021-05-26 12:20:00 +00:00
Aleksander Morgado
e4f106f311 broadband-modem-qmi: assume all QMI based modems support SIM hot swap
As we have a generic SIM hot swap implementation in the QMI broadband
modem object.
2021-05-26 12:20:00 +00:00
Aleksander Morgado
43db860c44 base-bearer: report connection error on network initiated disconnections
By default, fallback to "unknown" mobile equipment error when the
modem gets disconnected by the network and we don't have any way to
know a more detailed reason.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
8da8fd0248 api: update MMMobileEquipmentError enum values
Update the list of mobile equipment error codes according to v17.1.0
of 3GPP TS 27.007 (March 2021).

A lot of the enum values that were prefixed with the 'GPRS_' keyword
have now been flagged as deprecated, and a new enum name given to the
corresponding value.

The deprecated symbol names are kept in the compat support to avoid
breaking API/ABI.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
9fdbbc6929 foxconn: setup FCC unlock step
Use the new "DMS Foxconn Set FCC authentication" command to request
the modem unlock during a power up operation.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/373
2021-05-23 00:23:17 +02:00
Aleksander Morgado
e1567c30df foxconn: don't assume parent location is available
If ModemManager is not built with QMI support, the generic MBIM modem
object will not have any location support, so we cannot assume that
iface_modem_location_parent will be valid and that it will have all
load_location_capabilities(), enable_location_gathering() and
disable_location_gathering() implemented.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/362
2021-05-03 00:10:03 +02:00
Aleksander Morgado
25a1b28fbf core: strict return type in g_object_ref()
This is now a requirement when using glib 2.56.
2021-04-30 11:05:42 +00:00
Freedom Liu
35b1672b85 foxconn: add new MBIM QDU firmware update method support
Based on the QDU service newly added in libmbim,
T99W175 module (vid: 0x105b) supports MBIM QDU based update.
2021-04-30 10:44:19 +02:00
Aleksander Morgado
49b63cc62b icera: implement profile management support
Using AT%IPDPCFG for authentication related profile settings
management (querying, updating), and relying on the parent
implementation for the remaining ones.

And using AT%IPDPACT for activation status management (deactivate),
while relying on the parent implementation for the activated check.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
887358663d broadband-bearer: rely on profile management for the cid selection
There is no longer need to perform all the CID selection logic in the
broadband bearer connection procedure, we can rely on the new profile
management operations to do the same thing.

We can do this because we're sure that all the MMBroadbandModem
objects implement the MMModem3gppProfileManager interface.

Additionally, given that we now provide the profile ID value as part
of the MMBearerConnectResult, we no longer need a custom
mm_broadband_bearer_get_3gpp_cid() as we can use the generic
mm_base_bearer_get_profile_id() for the same purpose.
2021-04-29 10:13:22 +00:00
Freedom Liu
47ea5c98f4 foxconn: add support for the T99W175 module
0x0489 is the vendor ID of T77W968, 0x105b is the vendor ID of T99W175.
{0x105b, 0xe0b0},{0x105b, 0xe0b1} is T99W175 PCI device, used by Dell.
{0x105b, 0xe0ab} is T99W175 PCI device, used by Lenovo.

If the modem has an mbim port, create a MbimFoxconn object, regardless
of what the product ID is.

The firmware version format in the T99W175 was selected to have
firmware version + carrier config version + apps version.
2021-04-29 00:58:35 +00:00
Freedom Liu
c31488608a foxconn: change modem-foxconn-t77w968 to modem-mbim-foxconn
Named the object in a more generic way.
2021-04-29 00:58:35 +00:00
Loic Poulain
fefbf4d302 plugins: generic: Add 'wwan' subsystem support
wwan is a new subsystem for WWAN devices, allowing to expose the
WWAN device and its ports in a generic way.

The sysfs hierarchy for such device is

/sys/class/wwanX
/sys/class/wwanX/wwanXpYP

Where X is the WWAN device index, Y the port index and P the
control protocol name (QMI, MBIM...). A control port is also
exposed as character device in /dev.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Dylan Van Assche
1beea40270 quectel: set QGPSXTRA to enable assistance support
Quectel modems require to enable XTRA GNSS assistance first with QGPSXTRA=1, before it can be used.
2021-04-20 15:29:29 +00:00
Aleksander Morgado
aeed8c9e5b qcom-soc-plugin: add support for QRTR+IPA based setups 2021-04-14 11:27:27 +02:00
Zrshuo Zhang
179e12befc fibocom: add port type hints for the NL668-AM 2021-04-07 12:18:58 +02:00
Aleksander Morgado
851a708442 modem-helpers: ip family normalization doesn't need log_object 2021-04-01 11:24:42 +02:00
Aleksander Morgado
2c27a7aadc base-bearer: remove default IP family property
There is no point in providing a configurable default IP family in the
bearer object, because we can always assume IPv4 as being the only
default expected.

Simplify the logic and also provide a new method to get the normalize
the IP family, using IPv4 as default always.
2021-03-31 23:46:31 +02:00
Aleksander Morgado
3179006351 cinterion: remove unused checkup of default IP family
Looks like the logic is just there to write a debug log, as the
selected IP family is not used anywhere else. Just remove this.
2021-03-31 23:13:33 +02:00
Aleksander Morgado
634682b602 cinterion: make sure FALSE sets GError in parse_smong_response()
The g_regex_match_full() method may return FALSE without setting the
GError, so that case needs to be considered.

In addition to that, the following g_assert() was not doing what it
should have been, as it was comparing the address of the variable and
not the variable itself; rework the code to avoid that as well:
  g_assert (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);
2021-03-21 13:44:16 +01:00
Aleksander Morgado
d01bca493d cinterion: make sure FALSE sets GError in provcfg_response_to_cid()
The g_regex_match_full() method may return FALSE without setting the
GError, so that case needs to be considered.

Reported by Jan Mazura.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
2021-03-21 13:40:01 +01:00
Aleksander Morgado
5285e958ab cinterion: allow '*' in Prov/Cfg response
E.g. in a Cinterion PLS8-E (REVISION 04.004) to match the following
line:

  ^SCFG: "MEopMode/Prov/Cfg","fallback*"

Fix suggested by Jan Mazura.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
2021-03-21 13:39:33 +01:00
Dylan Van Assche
192e067f97 quectel: ignore QGPSURC
QGPSURCs are not ignored and causes calls to be rejected in some cases
2021-03-21 10:01:52 +00:00
Aleksander Morgado
abc417f37a sierra: disable CPOL in the EM7345
Using CPOL? in the EM7345 (firmware FIH7160_V1.1_MODEM_01.1349.12)
ends up with the whole AT port stuck and non-responsive, which leads
to flagging the modem as unusable later on as soon as 10 consecutive
AT command timeouts happen.

In order to avoid that, we explicitly disable all CPOL based features
in this specific module.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/336
2021-03-12 12:41:35 +01:00
Aleksander Morgado
064e92e9b7 api,simple: new 'multiplex' setting in bearer properties
Both the Simple.Connect() and Modem.CreateBearer() are updated to
allow a new 'multiplex' setting in the properties provided by the user
in both of these methods.

The new setting expects a MMBearerMultiplexSupport enum indicating
what kind of multiplex needs the user has:
 * none: if multiplex must not be used.
 * requested: if multiplex should be used if available.
 * required: if multiplex must be used.

The underlying implementations will take care of accepting or
rejecting the setting depending on the system and modem capabilities.
2021-03-10 10:59:19 +01:00
Louis-Alexis Eyraud
154455a723 zte: disable CMER/CIND support explicitly
It looks like when indicators are enabled in ZTE modems like the
MF833V, the whole connection process is very unstable. The AT
reference doesn't do any mention to +CIND/CMER/CIEV either, so we'll
just disable all and use +CSQ based signal loading.

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

Signed-off-by: Louis-Alexis Eyraud <louis-alexis.eyraud@sigfox.com>
2021-03-05 10:19:23 +01:00
Aleksander Morgado
5d176a1e61 base-modem: explicitly say if NET or TTY data ports are supported
A modem that creates exclusively bearer objects that work with NET
ports (e.g. all QMI or MBIM modems) must not add any TTY port in the
list of data ports.

A modem that creates exclusively bearer objects that work with TTY
ports (e.g. the generic modem) must not add any NET port in the
list of data ports.

A modem that may use both TTY and NET ports should add all in the list
of data ports.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/324
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/329
2021-03-04 18:03:28 +01:00
Aleksander Morgado
aba237df4e broadband-modem-qmi: allow lookup of QMI for data without SIO port 2021-02-25 14:13:03 +01:00
Aleksander Morgado
381e2f382b base-modem: separate method to lookup exact port by name
There's no point in returning a list of all ports with a given name,
just provide a lookup method that returns the single port with the
given name.
2021-02-25 14:13:03 +01:00
Aleksander Morgado
1b35d74c15 kernel-device: add get_interface_number() method
We already have methods to query for interface specific attributes
like class/subclass/protocol, so add a new one for the interface
number, and make sure we use ATTRS{bInterfaceNumber} to load it
always, instead of assuming the ID_USB_INTERFACE_NUM property is set.
2021-02-24 20:47:57 +01:00
Aleksander Morgado
ab4c31ec0b cinterion: rework mno decoding to use str_to_utf8() 2021-02-23 11:35:11 +00:00
Aleksander Morgado
6bc07b4b14 cinterion: rework band encoding to use str_to_utf8()
Also providing support to report errors when attempting to decode the
strings.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
16df1e17e6 helpers: rework normalize_operator() to use str_to_utf8()
Instead of blindly assuming that we can take whatever string given as
valid UTF-8, we'll always attempt to convert from the current modem
charset into UTF-8. Before we were doing this for hex-encoded UCS2,
but not for example for GSM-7.

And due to the now applied GSM-7 conversion, the mf627a/mf627b +COPS
parsing unit tests are updated accordingly, because when converting
from an input string that contains byte 0x40 ('@' in UTF-8) as if it
were GSM-7, the 0x40 is taken as character '¡', encoded as 0xc2,0xa1
in UTF-8).
2021-02-23 11:35:11 +00:00
Aleksander Morgado
3ac248a7a6 cinterion: move sequence to set bands to private ctx
The sequence of commands is exclusively used during the set current
bands operation, so there is no point in storing it in the private
object data.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
e5363b546b charsets: use new str_from_utf8() instead of take_and_convert_to_current_charset() 2021-02-23 11:35:11 +00:00
Aleksander Morgado
033e174e44 charsets: make charset_gsm_unpacked_to_utf8() private
Use the generic mm_modem_charset_bytearray_to_utf8() instead.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
75b37e16b1 charsets: make charset_utf8_to_unpacked_gsm() private
Use the generic mm_modem_charset_bytearray_from_utf8() instead.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
bc449cbe87 charsets: make translit optional in utf8_to_unpacked_gsm()
If the conversion is not fully compatible, the user of the method
needs to request transliteration enabled explicitly in order to avoid
returning errors in this method.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
5ce97abd73 charsets: make translit optional in gsm_unpacked_to_utf8()
Until now, this method would automatically apply transliteration;
i.e. replacing characters with '?' when no direct translation was
available.

We can attempt to do that transliteration on strings that are not
critical, e.g. the operator name reported by the network. But we
should not do that on other types of strings, e.g. on SMS contents
that may really have additional purposes than just being
human-readable.

This commit makes the transliteration option to be explicitly
requested by the caller.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
34de613dea libmm-glib,common-helpers: make hexstr2bin() return a guint8 array
It makes much more sense than returning a gchar array, as gchar is
signed.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
a211981d4a libmm-glib,common-helpers: make hexstr2bin() accept input string length
Optionally given explicitly, and -1 can be used to assume it's
NUL-terminated.
2021-02-23 11:35:11 +00:00
Aleksander Morgado
657cabcfce libmm-glib,common-helpers: make hexstr2bin() return a GError
This util method checks whether the input string is a valid hex
string, so make sure we return a GError on failure.
2021-02-23 11:35:11 +00:00