Commit Graph

7792 Commits

Author SHA1 Message Date
Aleksander Morgado
f226b63301 libmm-glib,location: new signaled location API support
We allow clients to receive asynchronous updates of location
information, e.g. if "location signaling" is explicitly enabled (with
the setup() method).

But if so, we should also allow clients to easily process those
asynchronous updates in the libmm-glib library, instead of requiring
them to run explicit DBus queries to refresh the location information.

These new signaled location APIs allow clients to do so; they can
enable location signaling, and then just wait for the updates to
arrive.
2021-07-01 01:10:39 +02:00
Aleksander Morgado
4e4cb6d66a libmm-glib,location: build_locations() doesn't own the dictionary
Rework the build_locations() method so that it doesn't take ownership
of the input dictionary. This allows us reusing this method with
dictionaries for which ownership cannot be transferred.
2021-06-30 23:02:33 +02:00
Aleksander Morgado
e1fbc1ccb7 cinterion: fix double free when loading initial EPS context
The properties object stored in the context is being returned as task
result; so we should make sure that object is no longer left in the
context so that it's not freed twice.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/395
2021-06-30 22:31:17 +02:00
Aleksander Morgado
12613eac87 libmm-glib,modem: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
4bf7657086 libmm-glib,location-3gpp: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
219700ba6d libmm-glib,simple-status: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
a09b13de86 libmm-glib,pco: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
27a192c1ef libmm-glib,modem-3gpp: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
6363add86a libmm-glib,location-gps-nmea: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
b38586a12c libmm-glib,simple-connect-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
febd5778e7 libmm-glib,bearer-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
c1fae670b7 libmm-glib,call-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
49f52d9182 libmm-glib,location-gps-nmea: add missing type check in get_traces() 2021-06-25 19:01:06 +02:00
Aleksander Morgado
c368a63e01 libmm-glib,oma: deprecate method names without the mm_modem_oma prefix 2021-06-25 10:56:38 +02:00
Aleksander Morgado
fefd59e3ce libmm-glib,3gpp: fix initial-eps-bearer-settings property updates 2021-06-25 10:36:25 +02:00
Aleksander Morgado
ce50d9c483 mmcli,messaging: fix leak when printing supported storages 2021-06-24 15:53:50 +02:00
Aleksander Morgado
dfeaec99ce libmm-glib,messaging: avoid array cleanup in get_supported_storages()
If we return a reference to the internal array in
ensure_internal_supported_storages() and then we free the array
unconditionally in the caller, the next time we call it, the array
would be valid, but it would be fully empty.
2021-06-24 15:51:04 +02:00
Aleksander Morgado
059f13ffd3 libmm-glib,modem: add missing input argument checks 2021-06-24 15:43:33 +02:00
Andrew Lassalle
b0f40cf966 port-qmi: Increase the reference counter of the QrtrNode
Currently, we are not increasing the reference counter of the QrtrNode
when creating a PortQmi for a QRTR port, and we are clearing the object
when disposing the port.
2021-06-22 14:56:42 -07:00
Aleksander Morgado
6175cf562f examples,modem-watcher-python: also monitor modem state updates
$ sudo ./modem-watcher-python
  [ModemWatcher] ModemManager 1.16.6 service is available in bus
  [ModemWatcher] /org/freedesktop/ModemManager1/Modem/0: modem managed by ModemManager [015805000283080]: foxconn (MBIM [105B:E0AB])
  [ModemWatcher] /org/freedesktop/ModemManager1/Modem/0: modem state updated: disabled -> enabling (user-requested)
  [ModemWatcher] /org/freedesktop/ModemManager1/Modem/0: modem state updated: enabling -> enabled (user-requested)
  [ModemWatcher] /org/freedesktop/ModemManager1/Modem/0: modem state updated: enabled -> registered (unknown)
2021-06-21 11:22:29 +02:00
Aleksander Morgado
a357777d39 port-qmi: apply master MTU handling to all multiplexing types in qmi_wwan
If using rmnet and IP passthrough setting in qmi_wwan, also configure
the master interface with an MTU equal to the maximum data aggregation
size.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/367
2021-06-21 08:26:44 +00:00
Alyssa Ross
a8f086bfb3 tools: fix signal type in service test
The signal definition is:

    <signal name="StateChanged">
      <arg name="old" type="i" />
      <arg name="new" type="i" />
      <arg name="reason" type="u" />
    </signal>

So the first two arguments need to be adjusted.

Without this change, the test was failing for me:

    (/build/source/tools/tests/.libs/lt-test-stub:77030): GLib-GObject-CRITICAL **: 15:05:35.276: ../gobject/gsignal.c:3167: value for 'gint' parameter 0 for signal "state-changed" is of type 'guint'
2021-06-18 08:34:06 +00:00
Aleksander Morgado
b100189f49 broadband-modem: plug memleak when listing profiles
==4263== 747 (72 direct, 675 indirect) bytes in 3 blocks are definitely lost in loss record 5,739 of 5,787
  ==4263==    at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==4263==    by 0x50C6DE8: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==4263==    by 0x50DDFF1: g_slice_alloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==4263==    by 0x50B8EB9: g_list_prepend (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==4263==    by 0x27CE4C: mm_3gpp_parse_cgdcont_read_response (mm-modem-helpers.c:1845)
  ==4263==    by 0x1E5485: profile_manager_cgdcont_query_ready (mm-broadband-modem.c:10200)
  ==4263==    by 0x4ED54A1: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==4263==    by 0x18605E: at_command_ready (mm-base-modem-at.c:538)
  ==4263==    by 0x4ED54A1: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==4263==    by 0x25ADFA: serial_command_ready (mm-port-serial-at.c:393)
  ==4263==    by 0x4ED54A1: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==4263==    by 0x254752: command_context_complete_and_free (mm-port-serial.c:141)
2021-06-17 15:58:57 +02:00
Aleksander Morgado
4c5733e49b build: version bump to flag existence of new API (firehose fw update) 2021-06-16 21:23:27 +02:00
Aleksander Morgado
f9231bad34 base-manager: skip using g_warning() in process_initial_kernel_events()
Use mm_obj_warn() instead.
2021-06-16 11:59:51 +02:00
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
Aleksander Morgado
89bbc2ccb8 core: dump fatal initialization errors to stderr 2021-06-16 11:59:51 +02:00
Aleksander Morgado
8905cf4670 filter: trivial: reorder WWAN rule before the TTY ones 2021-06-16 11:59:51 +02:00
Aleksander Morgado
9639e52726 filter: remove support for TTY blacklist, TTY greylist and TTY default allowed
These lists were used in the corresponding TTY_BLACKLIST and
TTY_MANUAL_SCAN_ONLY filter rules, in the LEGACY and PARANOID filter
types, which are no longer supported.

The DEFAULT_ALLOWED filter rule made sense only in the LEGACY filter
type, and therefore it is also now removed, leaving the
DEFAULT_FORBIDDEN fallback rule exclusively. In other words, there is
now no way to ask ModemManager to implicitly allow TTY ports; the only
way to do that is by explicit making the TTY ports fall in one filter
rule that would allow them.
2021-06-16 11:59:51 +02:00
Aleksander Morgado
00c1bbfd57 filter: remove LEGACY and PARANOID filter types
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/390
2021-06-16 11:59:42 +02:00
Aleksander Morgado
a02cd5ee93 docs: add missing references for several filter rules 2021-06-16 10:44:39 +02:00
Aleksander Morgado
756f9c5e75 docs: remove LEGACY(DEFAULT) and PARANOID filter policy documentation 2021-06-16 10:44:39 +02:00
Aleksander Morgado
172b350871 api,tags: deprecate tags used in LEGACY and PARANOID filter types 2021-06-16 10:44:39 +02:00
Ivan Mikhanchuk
83ac824705 quectel: add support for EM120/160 PCIe modules 2021-06-16 00:40:26 -07:00
Ivan Mikhanchuk
4165052e8f api: add Firehose firmware update method 2021-06-16 00:40:26 -07:00
Ivan Mikhanchuk
4b4ce6c445 port-serial: do not call config_fd on wwan qcdm port
wwan qcdm port is not a serial port, calling config_fd on it
will always fail, i.e.:
ModemManager[124587]: <debug> [1619584182.125262] [wwan0p1QCDM/probe] probing QCDM...
ModemManager[124587]: <debug> [1619584182.125398] [wwan0p1QCDM/qcdm] opening serial port...
ModemManager[124587]: <debug> [1619584182.151759] [wwan0p1QCDM/qcdm] failed to configure serial device
ModemManager[124587]: <warn>  [1619584182.151836] [wwan0p1QCDM/qcdm] failed to open serial device
ModemManager[124587]: <warn>  [1619584182.170152] [plugin-manager] task 1,wwan0p1QCDM: error when checking support with plugin 'generic': (wwan/wwan0p1QCDM) Failed to open QCDM port: Failed to open QCDM port: -2
2021-06-11 17:22:04 -07:00
Eric Caruso
611d598836 mm-sim-qmi: parse ICCID as hex instead of BCD 2021-06-10 06:47:18 -07:00
Stephan Gerhold
43d705ab93 udev: Ignore WWAN "FIREHOSE" ports
FIREHOSE ports are used for firmware updates which are done
independently from ModemManager, so we should ignore those ports.

A similar change was originally made by Loic Poulain here:
32b0eb79cd
2021-06-09 14:52:56 +02:00
Stephan Gerhold
4282c8d843 udev: Match WWAN "type" attribute instead of device name
Recent changes in the WWAN framework in the kernel changed the WWAN
port names from e.g. "wwan0p1AT" and "wwan0p2QMI" to "wwan0at0" and
"wwan0qmi0" [1, 2]. This means that the udev rules no longer match
since AT/QMI are now lower-case and no longer at the end of the name.

However, recently additionally a "type" sysfs attribute was added
for all WWAN ports [3], which makes it much more reliable to match
the WWAN port names without relying on their exact device name.

Add some additional udev rules to apply the port hints based on the
"type" sysfs attributes. This fixes the port enumeration on newer
Linux kernels that include the aforementioned commits.

Note that we still need to keep the old udev rules for now since
Linux 5.13 does not have the "type" attribute yet.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=392c26f7f133b9f09e5f58db1ce6ef4b3b4df49f
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=f458709ff40b0d992fec496952f79c7820dd3fde
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=b3e22e10fdda8e7be3830289a4a63ae8b88d450c
2021-06-09 13:49:08 +02:00
Aleksander Morgado
ac18b5ac5b udev: only flag as candidates the wwan ports, not the full device
Explicitly ignore the "wwan_dev" device as it is not associated with
separate ports (which is what MM needs), but with the whole device
instead.

See https://lists.freedesktop.org/archives/modemmanager-devel/2021-May/008629.html
2021-06-06 15:23:36 +02:00
Aleksander Morgado
40c647ce3e Revert "api: QDU update method defined in MM 1.16.6 already"
This reverts commit 6ffe84a122.
2021-06-06 12:15:56 +02:00
Aleksander Morgado
464c0d464c core: skip suggesting FCC unlock may be needed
This message is too specific, and there are a lot of cases where it
wouldn't apply.

E.g. when a MBIM module is stuck in low power mode due to some other
reason (like hardware rfkill), this message would pop up to the users
and completely confuse them.
2021-06-06 12:11:10 +02:00
Aleksander Morgado
eefcf9204f shared-qmi: add missing g_autoptr() NULL initializer 2021-06-02 09:56:00 +02: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
Aleksander Morgado
e25a585c9f broadband-modem-mbim: skip switch() when selecting MBIM services
Having a switch() for the MBIM services when processing indications
forces us to update it on every new MBIM service added to libmbim,
because we build with -Wswitch-enum by default.

This warning type is extremely useful, and we should not stop using
it, so let's simplify a bit the indication handling code and skip
using a switch().

There are right now only 4 different service indications expected, so
it shouldn't be a big deal.
2021-06-01 09:36:53 +02:00
Jarvis-Jiang-G
52bf2c6411 mbim: Increase mbim_device_open_full timeout
After fwupd upgrade with mbim-qdu method, MM sometimes generate plugin failed with the regenerated MHI driver.
This patch increases the mbim_device_open_full timeout from 30 seconds to 45 seconds to prevent such issue.
Signed-off-by: Jarvis Jiang <jarvis.w.jiang@gmail.com>
2021-05-31 17:19:50 +08: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
695e9932db bearer-mbim: implement reload_connection_status()
Implement connection status reloading for MBIM based bearers.

Based on a patch by Dylan Van Assche <me@dylanvanassche.be>
2021-05-26 13:14:52 +00:00
Aleksander Morgado
a97bc9912f bearer-qmi: implement reload_connection_status() for the sync operation
The original load_connection_status() method would return an
UNSUPPORTED error if connection monitoring wasn't required (which is
the default in most QMI modems).

The new reload_connection_status() method requires the check to always
be done unconditionally.

We take most of the original logic in the load_connection_status() for
the new reload_connection_status(), and we add the UNSUPPORTED error
logic exclusively in the new load_connection_status().
2021-05-26 13:14:52 +00: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