Commit Graph

5661 Commits

Author SHA1 Message Date
Aleksander Morgado
ae9efa05c8 signal: cleanup previous extended info if no new one given
E.g. if the modem switches from 4G to 3G while the extended signal
information is enabled, we should no longer expose LTE specific signal
quality values, only the UMTS specific ones.

E.g. to avoid this:

    $ mmcli -m 1 --signal-get
      -------------------------
      UMTS   | RSSI: '0,00' dBm
             | RSCP: '-92,00' dBm
             | EcIo: '-13,00' dB
      -------------------------
      LTE    | RSSI: '0,00' dBm
             | RSRQ: '-6,50' dB
             | RSRP: '-96,00' dBm
             |  SNR: '0,00' dB
2018-08-05 14:29:42 +02:00
Aleksander Morgado
ab0133445c build: ignore all tester programs for plugin-specific modem helpers 2018-08-04 17:39:41 +02:00
Aleksander Morgado
b8c7773a74 cinterion: fix band related unit tests
The sort_band() method used in the tester was totally wrong, it was
comparing the addresses of the variables instead of the MMModemBand
values.

Use the common mm_common_bands_garray_sort() instead, which works as
expected.
2018-07-31 00:23:25 +02:00
Aleksander Morgado
3a4a137de3 broadband-modem-mbim: avoid use of uninitialized variable 2018-07-30 23:30:50 +02:00
Reinhard Speyerer
ebe9fcd574 mm-modem-helpers-cinterion: update band table for PLS8-J
The default AT^SCFG="Radio/Band" value for Cinterion PLS8-J devices is
"16819472". Add UMTS band 19 and LTE band 19 entries based on the
information given in the PLS8 datasheet.
2018-07-30 21:22:07 +02:00
Bob Ham
a160832fce iface-modem-voice: fix ordering of D-Bus signals for call addition/deletion
To have proper ordering in the D-Bus signals, the skeleton's property
changes must be flushed before the Call{Add,Delet}ed signals are
emitted.  Without this flush, the emission of the PropertiesChanged
signal is delayed until the main loop is idle.  This causes problems
on the client side, for example the CallAdded signal being received
before the Calls property contains the call.

Closes: #81
2018-07-27 18:30:50 +02:00
Aleksander Morgado
95cee88ccd man,mmcli: fix documentation for --set-current-bands
Reported by: Matthew Stanger <stangerm2@gmail.com>
2018-07-27 17:47:23 +02:00
mstanger
7913fe4faf mm-modem-helpers-cinterion: update freq/band table
This info comes from PLS8-X/E/J/V/US, HC25 & PHS8 references, the
last two can be found publicly via Google search.

Swapped bit-mask locations for G850 & PCS bands as they may have
changed with FW or where accidently put in the wrong place.

Updated many 3G & 4G bit-mask fields.
2018-07-27 17:47:23 +02:00
Aleksander Morgado
8ea8d4e774 broadband-modem-mbim: show USB product attribute as model 2018-07-19 19:25:44 +00:00
Aleksander Morgado
0a2060cc78 kerneldevice: allow loading physdev product string 2018-07-19 19:25:44 +00:00
Aleksander Morgado
df8ead4808 blacklist: include all devices from Prusa Research 2018-07-19 15:57:10 +02:00
Aleksander Morgado
d3bc046764 broadband-modem-qmi: plug memleak when processing a factory reset 2018-07-10 23:02:39 +02:00
Aleksander Morgado
fff3f0ff71 broadband-modem: skip concatenated AT commands
Not all modems support AT command concatenation (e.g. u-blox TOBY-L4
doesn't, according to a specific note about it in the AT command
reference). So just skip concatenation in the few places where it's
used.
2018-07-10 19:45:55 +00:00
Aleksander Morgado
d134402efc ublox: always send user/pass strings, even if no authentication requested
The TOBY-L2 allowed to skup the user/pass string fields when no
authentication was requested, but according to the AT command
reference, all the remaining u-blox modules do require these two
fields given always (e.g. just as empty strings).

As per this sequence in a TOBY-L4:

 (ttyACM2): --> 'AT+UAUTHREQ=?<CR>'
 (ttyACM2): <-- '<CR><LF>+UAUTHREQ: (1-4),(0-2),,<CR><LF><CR><LF>OK<CR><LF>'
 (ttyACM2): --> 'AT+UAUTHREQ=1,0<CR>'
 (ttyACM2): <-- '<CR><LF>+CME ERROR: 4<CR><LF>'

It should have been: AT+UAUTHREQ=1,0,"",""
2018-07-10 19:45:05 +00:00
Aleksander Morgado
3570604bc4 iface-modem-simple: no need for an extra 'self' reference when using GTask 2018-07-10 19:43:44 +00:00
Aleksander Morgado
a77beaa271 iface-modem-time: make sure timezone context is cleaned up properly
If we're going to overwrite the timezone context, make sure everything
is cleaned up, including the signal handler. Otherwise, we may end up
running the signal handler without a context attached:

    (gdb) bt
    #0  network_timezone_state_changed (self=0x6aa1e8) at mm-iface-modem-time.c:266
    #1  0x76a8d418 in g_closure_invoke (closure=0x6c9810, return_value=0x0, return_value@entry=0x1, n_param_values=2, param_values=0x7edb58c0, param_values@entry=0x6cdab8,
        invocation_hint=invocation_hint@entry=0x7edb585c) at gclosure.c:804
    #2  0x76a9e674 in signal_emit_unlocked_R (node=node@entry=0x6794d0, detail=0, detail@entry=391, instance=instance@entry=0x6aa1e8, emission_return=0x6794a8, emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7edb58c0) at gsignal.c:3629
    #3  0x76aa31f4 in g_signal_emit_valist (instance=instance@entry=0x6aa1e8, signal_id=signal_id@entry=1, detail=detail@entry=6767564, var_args=..., var_args@entry=...) at gsignal.c:3385
    #4  0x76aa34ec in g_signal_emit (instance=instance@entry=0x6aa1e8, signal_id=signal_id@entry=1, detail=391) at gsignal.c:3441
    #5  0x76a91698 in g_object_dispatch_properties_changed (object=0x6aa1e8, n_pspecs=1, pspecs=<optimized out>) at gobject.c:1062
    #6  0x76a90e7c in g_object_notify_queue_thaw (object=object@entry=0x6aa1e8, nqueue=nqueue@entry=0x75409418) at gobject.c:296
    #7  0x76a9470c in g_object_set_valist (object=object@entry=0x6aa1e8, first_property_name=first_property_name@entry=0xad566 "iface-modem-state", var_args=..., var_args@entry=...) at gobject.c:2171
    #8  0x76a94b18 in g_object_set (_object=_object@entry=0x6aa1e8, first_property_name=0xad566 "iface-modem-state") at gobject.c:2275
    #9  0x0004b8a4 in __iface_modem_update_state_internal (self=0x6aa1e8, new_state=MM_MODEM_STATE_DISABLED, reason=MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED, failed_reason=MM_MODEM_STATE_FAILED_REASON_NONE)
        at mm-iface-modem.c:1487
    #10 0x0007047c in disabling_context_free (ctx=0x6ba850) at mm-broadband-modem.c:9053
    #11 0x76b4e538 in g_task_finalize (object=0x682488) at gtask.c:636
    #12 0x76a92800 in g_object_unref (_object=0x682488) at gobject.c:3183
    #13 0x00072154 in iface_modem_disable_ready (self=0x6aa1e8, result=0x7011b0, task=0x682488) at mm-broadband-modem.c:9101
    #14 0x76b4e6ec in g_task_return_now (task=0x7011b0) at gtask.c:1107
    #15 0x76b4e720 in complete_in_idle_cb (task=0x7011b0) at gtask.c:1121
    #16 0x7694d144 in g_main_dispatch (context=0x6765a8) at gmain.c:3154
    #17 g_main_context_dispatch (context=context@entry=0x6765a8) at gmain.c:3769
    #18 0x7694d40c in g_main_context_iterate (context=0x6765a8, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840
    #19 0x7694d838 in g_main_loop_run (loop=0x6750d0) at gmain.c:4034
    #20 0x0002bec0 in main (argc=<optimized out>, argv=<optimized out>) at main.c:181
2018-07-10 19:43:04 +00:00
Alexander Couzens
62334b60a2 blacklist: remove OpenMoko Hubs from the blacklist
The problem of full vendor blacklist are hubs.
Because ATTRS{} matches all devices in the tree,
a modem connected to a OpenMoko hub will be blacklisted as well.
2018-07-10 18:26:06 +02:00
Enrico Mioso
f01d88bf91 libmm-glib: reference dup_equipment_identifier instead of dup_plugin
Fix the comment.
2018-06-29 09:34:37 +02:00
Aleksander Morgado
066c9c1e40 libmm-glib,location-gps-raw: plug memleak
==8663== 1 bytes in 1 blocks are definitely lost in loss record 5 of 4,864
    ==8663==    at 0x4C2CEDF: malloc (vg_replace_malloc.c:299)
    ==8663==    by 0x669FAC9: g_malloc (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x66B9AEA: g_strndup (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x66ACE52: g_match_info_fetch (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x4E96DD2: mm_location_gps_raw_add_trace (mm-location-gps-raw.c:208)
    ==8663==    by 0x18721E: mm_iface_modem_location_gps_update (mm-iface-modem-location.c:264)
    ==8663==    by 0x1B9C7F: loc_location_nmea_indication_cb (mm-shared-qmi.c:712)
    ==8663==    by 0x640C9E7: g_cclosure_marshal_VOID__BOXEDv (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x6409C95: ??? (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x64259E8: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x642612F: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x54AAB2D: process_indication (qmi-loc.c:7454)

Reported by: Thomas Weißschuh <thomas@weissschuh.net>
2018-06-28 00:09:27 +02:00
Aleksander Morgado
746cf54b11 broadband-modem-qmi: fix segfault due to NULL task context
ModemManager[18223]: <debug> [1530023432.028473] Modem has 3GPP capabilities, enabling the Modem 3GPP interface...

    Thread 1 "ModemManager" received signal SIGSEGV, Segmentation fault.
    0x0000555555618baa in common_enable_disable_unsolicited_events_signal_strength (task=0x5555558e4440) at mm-broadband-modem-qmi.c:6545
    6545	    if (ctx->enable)
    (gdb) bt
    #0  0x0000555555618baa in common_enable_disable_unsolicited_events_signal_strength (task=0x5555558e4440) at mm-broadband-modem-qmi.c:6545
    #1  0x0000555555618d70 in common_enable_disable_unsolicited_events (self=0x55555597a3f0, enable=1, callback=0x5555555c8c20 <enable_unsolicited_events_ready>, user_data=0x5555559779b0)
        at mm-broadband-modem-qmi.c:6719
    #2  0x0000555555618e5b in modem_3gpp_enable_unsolicited_events (self=0x55555597a3f0, callback=0x5555555c8c20 <enable_unsolicited_events_ready>, user_data=0x5555559779b0) at mm-broadband-modem-qmi.c:6749
    #3  0x00005555555c9095 in interface_enabling_step (task=0x5555559779b0) at mm-iface-modem-3gpp.c:1907
    #4  0x00005555555c8c0a in setup_unsolicited_events_ready (self=0x55555597a3f0, res=0x5555558efad0, task=0x5555559779b0) at mm-iface-modem-3gpp.c:1795
    #5  0x00007ffff681e204 in  () at /usr/lib/libgio-2.0.so.0
    #6  0x00007ffff681e239 in  () at /usr/lib/libgio-2.0.so.0
    #7  0x00007ffff62731d6 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
    #8  0x00007ffff62735b1 in  () at /usr/lib/libglib-2.0.so.0
    #9  0x00007ffff62738e2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
    #10 0x000055555559182c in main (argc=2, argv=0x7fffffffe4a8) at main.c:181

Fixes: baefe53ab9
2018-06-26 16:36:11 +02:00
Brian, Sam
bb9e9a92a3 port-serial: don't close tty file descriptor twice
After the tty is opened, the fd is passed off to a GIOChannel which
manages it. When the serial port is closed with _close_internal(),
g_io_channel_shutdown() is called which then calls g_io_unix_close() which
in turn close()s the fd.
_close_internal() performs a second explicit close() after the
g_io_channel_shutdown() which *in the best case scenario* will fail with
EBADF.
This is a race condition that can result in other file descriptors being
closed.

This change avoids double closing the serial port fd -- the shutdown() call
is removed in favour of the explicit close().
2018-06-22 10:54:01 +02:00
Aleksander Morgado
efd57e8d5b po: add Friulian translation
From: Fabio Tomat <f.t.public@gmail.com>

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/42
2018-06-19 18:02:15 +02:00
Baruch Siach
105e321951 kerneldevice: fix build with musl libc
musl libc does not implement the canonicalize_file_name() GNU extension.
Use the POSIX standard realpath() instead.
2018-06-17 11:48:49 +02:00
Lubomir Rintel
cf3f3ffcd0 service: set User=root so that gio doesn't have to look into /etc/passwd
GVfs' libgvfsdbus.so GIo module, when automatically loaded, attempts to
discover if there's a session D-Bus instance to use. It tries real hard
to get the socket name it would use -- in absence of XDG_RUNTIME_DIR it
decides to make it up with user's home directory. When HOME is unset
too, it just tries to figure it out by looking into /etc/passwd. Which
upsets SELinux that would better not see us looking into it.

We trigger the load of the GIo modules, by using the GFile API to access
the the ports in /dev. They're utterly uesless to us, but there doesn't
seem to be a way to disable their load. Oh well.

For now, let's just ensure HOME is set and the problematic path in glib
is not taken.
2018-06-13 10:32:51 +00:00
Aleksander Morgado
6169d3d14f iface-modem-voice: plug memleak when creating new incoming call
The mm_call_list_add_call() takes a full reference to the call, so we
can unref the original one safely.
2018-06-11 18:09:49 +02:00
Aleksander Morgado
a6101a8532 call-list: coding style fixes 2018-06-11 18:06:38 +02:00
Aleksander Morgado
588d6144a7 doc: fix explanation of MM_CALL_STATE_RINGING_{IN|OUT}
They were reversed; ringing in applies to incoming calls, ringing out
applies to outgoing calls.
2018-06-10 14:47:39 +02:00
Aleksander Morgado
91757f65da introspection: minor indentation fixes in SMS interface 2018-06-09 11:28:09 +02:00
Ben Chan
1990d9e982 modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError
Commit 2a97e39cdd in libmim ("libmbim-glib: add additional cause codes
to MbimNwError") added additional cause codes to MbimNwError. This
patch maps some of those MbimNwError to MMMobileEquipmentError.

This patch requires libmbim >= 1.17.1
2018-06-02 18:25:57 +02:00
Ben Chan
cf86b6ab98 broadband-modem-qmi: replace ensure_qmi_client with GTask implementation
assure_qmi_client() was created to help migrating MMBroadbandModemQmi code
to use GTask. Now that all MMBroadbandModemQmi code has been migrated to
use GTask, this patch removes the old ensure_qmi_client() and rename
assure_qmi_client() as ensure_qmi_client().
2018-06-02 17:57:00 +02:00
Ben Chan
bf4af8b82a broadband-modem-qmi: port modem_cdma_{activate,activate_manual} to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
856d931a7e broadband-modem-qmi: port load_initial_sms_parts to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
3cd9ae6321 broadband-modem-qmi: port messaging_set_default_storage to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
216fb6bbe8 broadband-modem-qmi: port messaging_{enable,disable}_unsolicited_events to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
52d0f9760b broadband-modem-qmi: port location_load_supl_server to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
6f44554b21 broadband-modem-qmi: port location_set_supl_server to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
44c3cceb5e broadband-modem-qmi: port disable_location_gathering to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
84a3ea7661 broadband-modem-qmi: port firmware_change_current to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
65767c1c88 broadband-modem-qmi: port firmware_check_support to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
f933b967be broadband-modem-qmi: port common_enable_disable_oma_unsolicited_events to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
fe46d2c7db broadband-modem-qmi: port common_setup_cleanup_oma_unsolicited_events to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
456a09c655 broadband-modem-qmi: port oma_cancel_session to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan
ce7b3a7bb0 broadband-modem-qmi: port oma_start_client_initiated_session to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
311859d60f broadband-modem-qmi: port oma_accept_network_initiated_session to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
76bdaaba3e broadband-modem-qmi: port oma_load_features to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
f330ffdaa9 broadband-modem-qmi: port oma_setup to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
3455b01b57 broadband-modem-qmi: port modem_cdma_load_activation_state to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
e09e4692dc broadband-modem-qmi: port modem_cdma_run_registration_checks to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
d73f431987 broadband-modem-qmi: port modem_3gpp_{enable,disable}_unsolicited_registration_events to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan
478232dc05 broadband-modem-qmi: port modem_3gpp_run_registration_checks to use GTask 2018-06-02 17:56:59 +02:00