Commit Graph

7420 Commits

Author SHA1 Message Date
Undef
a381622304 service: Fix Mobile Data on EG25
This allows mobile data to work on the EG25 (and probably other modems).
2021-05-20 11:07:37 +00:00
Aleksander Morgado
18fe7856af base-bearer: trivial fix printing stats reports 2021-05-18 23:17:01 +02:00
Aleksander Morgado
d661d822f7 libmm-glib,common-helpers: avoid signed vs unsigned comparisons
mm-common-helpers.c: In function 'mm_get_int_from_str':
  mm-common-helpers.c:1349:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (eol == num)
               ^~
  mm-common-helpers.c: In function 'mm_utils_hexstr2bin':
  mm-common-helpers.c:1718:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < len; i += 2) {
                     ^
2021-05-18 14:51:05 +02:00
Aleksander Morgado
21ff48ed7d libmm-glib: drop default timeout checks in Command()
The g_dbus_proxy_get_default_timeout() is by default -1 unless
explicitly updated, so the check doesn't make any sense really. We
didn't see any warning produced because mmcli provides an explicit
timeout of 30s, so it was never the default -1.
2021-05-18 14:51:05 +02:00
Aleksander Morgado
a325acd6b1 libmm-glib: remove unused cmp_allow_roaming() method
mm-bearer-properties.c:725:1: warning: 'cmp_allow_roaming' defined but not used [-Wunused-function]
   cmp_allow_roaming (gboolean                   a,
   ^~~~~~~~~~~~~~~~~
2021-05-18 14:51:05 +02:00
Aleksander Morgado
268cab885b core: drop "volatile" for g_once_init_enter locations
This fixes a few (fatal in gcc 11) warnings.

See https://gitlab.gnome.org/GNOME/glib/-/issues/600
2021-05-18 11:28:18 +02:00
Aleksander Morgado
0ea6e01c9b libmm-glib,location-3gpp: fix string overflow
mm-location-3gpp.c: In function ‘mm_location_3gpp_get_mobile_country_code’:
  mm-location-3gpp.c:139:12: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    139 |     mcc[4] = '\0';
        |     ~~~~~~~^~~~~~
  mm-location-3gpp.c:132:11: note: at offset 4 to object ‘mcc’ with size 4 declared here
    132 |     gchar mcc[4];
        |           ^~~
2021-05-17 14:29:35 +02:00
Teijo Kinnunen
5e629b8ea7 broadband-modem-qmi: set MNC PCS digit in modem_3gpp_load_operator_name()
If the network has three digit MNC and MNC < 100, set the PCS digit status
field in the QMI request.
2021-05-17 12:46:52 +03:00
Teijo Kinnunen
1147d376cd shared-qmi: set MNC PCS digit for manual network registration
Set the MNC PCS digit status when attempting to register to a network
with 3 digit MNC and MNC < 100.
2021-05-17 12:46:52 +03:00
Teijo Kinnunen
2471b950b0 sim-qmi: use mm_3gpp_parse_operator_id() for preferred PLMN MNC digits
MNC PCS digit status is now available from mm_3gpp_parse_operator_id(),
so use it.
2021-05-17 12:46:52 +03:00
Teijo Kinnunen
44671ced03 cli,location: use mm_location_3gpp_get_operator_code() in location output 2021-05-17 12:46:52 +03:00
Teijo Kinnunen
879ec1a5d4 libmm-glib,iface-modem-location: add MMLocation3gpp 3 digit MNC support
MMLocation3gpp provides MCC/MNC information as integers, so it can not
make distinction between operator codes such as XXX01 and XXX001.

This commit deprecates mm_location_3gpp_get_mobile_network_code() and
implements a new function mm_location_3gpp_get_operator_code() which
provides the MCC+MNC in string format.

The mm_location_3gpp_get_mobile_country_code() is still available as
returning the MCC as an integer does not have ambiguity issues.
2021-05-17 12:46:52 +03:00
Teijo Kinnunen
14c4f27ae4 modem-helpers: add 3 digit MNC output to mm_3gpp_parse_operator_id()
MNC digit count information is lost on conversion to integers. Make it
possible for the caller to get this information through a separate
boolean.
2021-05-17 12:46:52 +03:00
Aleksander Morgado
98fbd5a156 iface-modem-3gpp: don't assume operator code implies we're registered
The modem may be camping in a forbidden network just for emergency
services, and we'll be able to have a MCCMNC reported in that case,
but this does not mean the modem is registered.

So, don't consider that a valid registration flag during the new
network registration request.
2021-05-15 21:55:28 +00:00
Aleksander Morgado
af756a1bf7 port-qmi: avoid running install_properties() without properties defined
We'll setup the properties only if QRTR support is being built,
otherwise we fully skip all property related setup.

  (ModemManager:480463): GLib-GObject-CRITICAL **: 22:48:14.264: g_object_class_install_properties: assertion 'n_pspecs > 1' failed

  Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff76e3295 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  (gdb) bt
  #0  0x00007ffff76e3295 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #1  0x00007ffff76e4579 in g_logv () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #2  0x00007ffff76e4743 in g_log () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #3  0x00005555556af70c in mm_port_qmi_class_init (klass=0x5555557fae20) at mm-port-qmi.c:2619
  #4  0x00005555556a94c3 in mm_port_qmi_class_intern_init (klass=0x5555557fae20) at mm-port-qmi.c:34
  #5  0x00007ffff77ed1d1 in g_type_class_ref () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #6  0x00007ffff77d05e1 in g_object_new_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #7  0x00007ffff77d06cd in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #8  0x00005555556af25a in mm_port_qmi_new (name=0x5555557e54e0 "cdc-wdm0", subsys=MM_PORT_SUBSYS_USBMISC) at mm-port-qmi.c:2481
  #9  0x000055555563c8d7 in wdm_probe_qmi (self=0x5555557de1b0) at mm-port-probe.c:517
  #10 0x000055555563cc70 in wdm_probe (self=0x5555557de1b0) at mm-port-probe.c:623
  #11 0x00007ffff76dd04e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #12 0x00007ffff76dd400 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #13 0x00007ffff76dd6f3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #14 0x00005555555b1ae4 in main (argc=1, argv=0x7fffffffe558) at main.c:213
2021-05-15 23:24:50 +02:00
Andrew Lassalle
7711e84af9 iface-modem-3gpp: Add verbose logging for initial eps bearer
Print a debug message when the user provides initial eps bearer settings
that match the ones being used. This will save time to whomever is
experimenting with initial eps bearer settings.
2021-05-15 06:14:58 -07:00
Loic Poulain
c39d1d2fbc udev: Do not consider USB WWAN ports as valid candidates
For now WWAN subsystem support has only been validated for PCI/MHI
based devices and extra patches for USB based devices (qmi_wwan,
cdc-mbim...) may be required, so do not consider WWAN ports being
on USB bus.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-05-14 22:15:40 +00:00
Freedom Liu
76e700f4fd broadband-modem-mbim: get model through QMI-over-MBIM
move the modem_load_model() async method from mm-broadband-modem-qmi.c
to mm-shared-qmi.c, and then make use of the method from both the QMI
and MBIM implementations.
2021-05-14 22:10:49 +02:00
Aleksander Morgado
bb928dbf74 iface-modem: fix segfault if attempting to switch slot and slots unsupported
Reported and fix suggested by Maxim Anisimov

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/368
2021-05-12 22:12:46 +02:00
goapunk
f916d075a7 modem-helpers-qmi: fix auth validation always returning error 2021-05-09 10:42:09 +02:00
Eric Caruso
ba0701b67d mm-shared-qmi: parse ICCID as hex instead of BCD
Fixes issue 364.
2021-05-05 18:51:08 +00:00
Andrew Lassalle
27c43075f9 bearer-mbim: Fix double free in ip_configuration_query_ready 2021-05-04 13:45:51 -07:00
Teijo Kinnunen
d77d8dff42 libmm-glib,simple: fix docs: g_object_ref -> g_object_unref 2021-05-04 14:14:15 +03:00
Aleksander Morgado
973b1bdec8 broadband-modem-mbim: use the new 'LTE attach info' message name
The older 'LTE attach status' message name is deprecated.
2021-05-03 23:58:55 +00: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
9e2c9cce97 iface-modem-3gpp: delete unused mm_iface_modem_3gpp_disable_facility_lock()
The action of disabling facility locks is user-triggered, so there is
no need to have an internal method to run the logic without user
interaction.
2021-04-30 18:40:29 +00:00
Aleksander Morgado
d47babd5b7 api,introspection: fix DisableFacilityLock() documentation
make[4]: Entering directory '/home/aleksander/Development/foss/ModemManager/docs/reference/api'
    DOC   Preparing build
    DOC   Building XML
    DOC   Scanning header files
    DOC   Introspecting gobjects
    DOC   Building XML
    DOC   Building HTML
  ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml:181: parser error : Opening and ending tag mismatch: variablelist line 165 and para
  </para>
         ^
2021-04-30 18:40:29 +00:00
Aleksander Morgado
77fd343bb6 mmcli,3gpp: common method to parse --disable-facility-lock input string 2021-04-30 18:40:29 +00:00
Aleksander Morgado
c070ca82f8 modem-helpers: improve logging on unhandled features when parsing UIM Get Configuration 2021-04-30 18:40:29 +00:00
Michal Mazur
7f425d9b15 broadband-modem: support disabling facility lock on MBIM and QMI modems 2021-04-30 18:40:29 +00:00
Michal Mazur
e8edcedc9e modem-helpers: introduce functions to convert MMModem3gppFacility 2021-04-30 18:40:29 +00:00
Michal Mazur
dfc04cbc2e iface-modem-3gpp: define new API to disable facility locks 2021-04-30 18:40:29 +00:00
Michal Mazur
25ffe4211a api,libmm-glib,cli: add command to disable facility lock 2021-04-30 18:40:29 +00:00
Michal Mazur
b1dde0aec3 libmm-glib: add helper to get 3gpp facility from string 2021-04-30 18:40:29 +00:00
Michal Mazur
2a2ae2819c broadband-modem-qmi: use UIM Get Configuration to probe all facility locks 2021-04-30 18:40:29 +00:00
Michal Mazur
ab60f88403 modem-helpers-qmi: introduce parser for Get Configuration message 2021-04-30 18:40:29 +00:00
Aleksander Morgado
0a7bfcfb42 build: require glib 2.56
When using glib < 2.55.1 there was a bug in GLib triggering a huge
amount of memory leaks in the normal ModemManager runtime. This has
caused multiple issues in multiple setups, and so the best way to make
sure it no longer happens is to require 2.56.

The 2.56.0 glib version is also the one provided by Ubuntu 18.04 LTS,
and so we can now say that this LTS release is the last one we support
in newer MM releases. The previous Ubuntu 16.04 LTS is already out of
the standard 5-year support.
2021-04-30 11:05:42 +00: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
Vincent Palatin
edee1e3f84 broadband-modem-qmi: ensure we do not re-use old EPS registration state
When updating the registration state, in the case where LTE is not ready,
ensure we reset the EPS registration state rather than leaving its old
value.
Else when the consolidated registration is built, it can wrongly think
we are registered, e.g. the following case was happening:
[modem0] consolidated registration state: cs 'home', ps 'home', eps 'home', 5gs 'unknown' --> 'home'
a bit later
[modem0] consolidated registration state: cs 'unknown', ps 'unknown', eps 'home', 5gs 'unknown' --> 'home'
then it wrongly tries immediatly to connect
and fails due to 'no-service'

On Qualcomm SC7180, running the following sequence would often reproduce
it:
<stop higher level network manager>
mmcli -m 0 -d
mmcli -m 0 --set-power-state-low
sleep 10
mmcli -m 0 -e
mmcli -m 0 --simple-connect="apn=broadband"
2021-04-30 10:28:52 +00:00
Aleksander Morgado
c330d44343 build: version bump to flag existence of new API (QDU fw update) 2021-04-30 10:45:14 +02: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
d5041cc814 iface-modem-3gpp: ignore 'profile-id' and 'apn-type' matching initial EPS settings
We should not try to match the 'profile-id', as that setting is not
available in the input bearer settings provided by the user.

And we should not try to match the 'apn-type', as not all
implementations support it and it's not really necessary for this
purpose anyway.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
55f8e3b9a7 broadband-modem-qmi: switch initial EPS bearer settings to use profile management
The operation required to load/update the initial EPS bearer settings
are completely the same as for profile management, because at the end
the settings are bound to a specific profile id.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
0d60b9497b bearer-qmi: implement connection logic using existing profiles 2021-04-29 10:13:22 +00:00
Aleksander Morgado
ce383abfe1 bearer-qmi: refactor connection context setup logic
Place all the logic in a separate load_settings_from_bearer() method
that takes care of propagating all bearer settings to the connect
context.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
fffe49d03e modem-helpers-qmi: perform validation in allowed_auth_to_qmi_authentication()
If we find that none of the requested auth settings are supported, we
should fail and return an error.

Also, make sure we set the CHAP fallback default only if either user
or password are given.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
865014510a broadband-modem-qmi: implement profile management support 2021-04-29 10:13:22 +00:00
Aleksander Morgado
5d2db5de98 bearer-mbim: implement connection logic using existing profiles
Unlike other implementations, with MBIM we cannot tell the modem to
connect a given profile by its profile number, which is a bit strange,
but it looks like there is no way to do that. So, if the user requests
to connect a given profile, what we do is load the profile settings by
querying the modem, and use those settings in the connect request.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
72879e4095 broadband-modem-mbim: implement profile management support
We use the "Provisioned Contexts" message support to add and edit
profiles.

We also use the same message, with context-type set to "none" to
attempt deleting it, although that doesn't seem to be fully supported
by all modems. E.g. the EM7345 (FIH7160_V1.1_MODEM_01.1349.12) will
still report contexts 'deleted' in this way, with the context-type set
to "none".º
2021-04-29 10:13:22 +00: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