Commit Graph
3072 Commits
Author SHA1 Message Date
Aleksander Morgado 091bf4dbd8 api: support location assistance data
Sometimes SUPL-server based A-GPS is not possible, e.g. if the module
doesn't have Internet connectivity. In such cases, the modem may
support injecting additional "assistance data" that may be downloaded
from the Internet using external means (e.g. WiFi), in order to keep
having a quick time to first fix.

We now support using this location assistance data, with the following
new API elements:

 * A new mask of supported assistance data types is provided in the
   SupportedAssistanceData property.

 * A new list of URLs from where the aassistance data may be
   downloaded is also provided in a new AssistanceDataServers
   property.

 * A new InjectAssistanceData() method is provided, to perform the
   data injection in the module once it's been downloaded to the host
   system.
2018-08-21 13:26:08 +00:00
Aleksander Morgado 0798f32362 shared-qmi: implement LOC-based GPS/A-GPS support 2018-08-21 13:26:08 +00:00
Aleksander Morgado 8bc51d3ed1 shared-qmi: decouple low-level GPS operations from source management logic
Just to make room for the LOC based integration.
2018-08-21 13:26:08 +00:00
Aleksander Morgado fc520eb073 modem-helpers-qmi: new helper to transform QmiLocIndicationStatus into a GError 2018-08-21 13:26:08 +00:00
Aleksander Morgado 9e42a19742 broadband-modem-mbim: support for QMI PDS based GPS location 2018-08-21 13:26:08 +00:00
Aleksander Morgado e93b698c7b port-mbim: when opening QMI over MBIM support, request indications
We do want to receive QMI indications, as they will be needed for
different features (e.g. LOC based GNSS support).
2018-08-21 13:26:08 +00:00
Aleksander Morgado 098897778b shared-qmi: import PDS-based GPS location support 2018-08-21 13:26:08 +00:00
Aleksander Morgado 811a80e5ea shared-qmi: new interface to handle common QMI implementations
This new interface will include implementations that are shared
between the MMBroadbandModemQmi and the MMBroadbandModemMbim.

For now, it just provides a way to implement the common client
allocation methods.
2018-08-21 13:26:08 +00:00
Aleksander Morgado f9cbe045e5 broadband-modem-mbim: use the preallocated DMS client for FCC Auth 2018-08-21 13:26:08 +00:00
Aleksander Morgado 5e6980c7fc broadband-modem-mbim: preallocate QMI clients if QMI over MBIM supported 2018-08-21 13:26:08 +00:00
Aleksander Morgado 8a364c4dfd port-mbim: implement QMI client allocation logic 2018-08-21 13:26:08 +00:00
Aleksander Morgado c0cc694c67 port-mbim: automatically try to open a QMI over MBIM device
Most Qualcomm-based MBIM devices also support QMI over MBIM. We will
try to check in runtime whether the MBIM device supports QMI over
MBIM, and if so, setup a QmiDevice within the MMPortMbim.
2018-08-21 13:26:08 +00:00
Ben Chan 930a5879d4 broadband-modem-mbim: update 'Pco' property in Modem3gpp interface
This patch changes MMBroadbandModemMbim to update the 'Pco' property in
the Modem3gpp interface upon receiving a MBIM_CID_PCO notification.
2018-08-18 13:34:06 -07:00
Ben Chan d46aa0c36a modem-3gpp: add 'Pco' property to Modem3gpp interface
This patch adds a 'Pco' property to the Modem3gpp interface for tracking
PCOs that the modem has received from the network.
2018-08-18 13:34:06 -07:00
Aleksander Morgado b7e5ca62c5 broadband-modem-mbim: explicitly ignore SMS storage initialization
The MBIM protocol hides to the user the concept of SMS storages, so we
should explicitly ignore the initialization step so that it isn't run
with the parent AT-based implementation.
2018-08-14 10:58:08 +02:00
Ben Chan d21dd6cf1f broadband-modem: initialize 'tac' in registration_status_check_ready()
mm-broadband-modem.c:4395:13: error: variable 'tac' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm-broadband-modem.c:4407:75: note: uninitialized use occurs here
    mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid);
                                                                          ^~~
mm-broadband-modem.c:4395:9: note: remove the 'if' if its condition is always true
        if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm-broadband-modem.c:4380:9: error: variable 'tac' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if (cgreg) {
        ^~~~~
mm-broadband-modem.c:4407:75: note: uninitialized use occurs here
    mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid);
                                                                          ^~~
mm-broadband-modem.c:4380:5: note: remove the 'if' if its condition is always false
    if (cgreg) {
    ^~~~~~~~~~~~
mm-broadband-modem.c:4280:15: note: initialize the variable 'tac' to silence this warning
    gulong tac;
              ^
               = 0
2018-08-10 11:06:19 +02:00
Aleksander Morgado b378be0f0d broadband-modem-mbim: fallback to trying AT+CESQ if ATDS signal unsupported 2018-08-10 04:26:12 +00:00
Aleksander Morgado ab9130682c broadband-modem-mbim: implement extended signal support with ATDS 2018-08-10 04:26:12 +00:00
Aleksander Morgado 7a941466c2 broadband-modem-mbim: implement 3GPP location support with ATDS 2018-08-10 04:26:12 +00:00
Aleksander Morgado ff6a82f5b7 broadband-modem: check if modem implements MBIM_CID_USSD 2018-08-10 04:26:12 +00:00
Aleksander Morgado cf500014b6 port-probe: no AT probing on possible QCDM port
Ports flagged as being QCDM will not be probed for AT. QCDM probing
will be performed normally, the udev tags only give hints, we still
need to know whether the TTYs are QCDM-capable or not.
2018-08-10 04:19:13 +00:00
Aleksander Morgado 548b7f8847 base-modem: load AT port type hints when adding port
We keep the pflags input in mm_base_modem_grab_port() so that plugins
can use other methods to gather port type hints (e.g. querying with AT
commands as in Huawei/Telit or looking at sysfs properties as in HSO).

For standard udev tag port type hints, it will be the base modem
looking them up.

Note that there is no longer any need to ignore non-flagged ports for
those modems that require primary/secondary flags. They will be
implicitly ignored when mm_base_modem_organize_ports() decides which
ports to use, as the flagged ones are preferred over the non-flagged
ones.
2018-08-10 04:19:13 +00:00
Aleksander Morgado aff633b1b0 port-probe: no QCDM probing on possible AT port
Ports flagged with one of the common AT port type hints will not be
probed for QCDM.

AT probing will be performed normally, the udev tags only give hints,
we still need to know whether the TTYs are AT-capable or not.
2018-08-10 04:19:13 +00:00
Aleksander Morgado 86f840d97b port-probe: explicitly report GPS port type if port flagged
And remove all custom logic from all plugins that were doing just that.
2018-08-10 04:19:13 +00:00
Aleksander Morgado 9c0a557f91 port-probe: don't do AT or QCDM probing on ports flagged as GPS 2018-08-10 04:19:13 +00:00
Aleksander Morgado 5a2f3cce95 iface-modem-3gpp: fix location update when LAC=0 but TAC given 2018-08-09 10:46:35 +02:00
Aleksander Morgado 7e6b4d7aa9 api,location: give Tracking Area Code field in 3GPP location info
The "location area code" field is given in GSM/UMTS networks
exclusively. LTE networks use the concept of "tracking area code"
instead.

This patch updates the Location interface to Provide separate fields
for LAC and TAC, instead of giving TAC values in the LAC field.
2018-08-08 21:46:28 +02:00
Aleksander Morgado f58a652578 broadband-modem-qmi: fix build using WITH_NEWEST_QMI_COMMANDS 2018-08-08 21:45:51 +02:00
Aleksander Morgado 59a5af9771 iface-modem: reload current bands after setting
Setting bands is a very device-specific operation. Sometimes the
device requires specific band combinations, or sometimes the 'any'
specific logic doesn't apply to all supported bands (e.g. may apply
only to the currently selected modes, as in XMM based devices).

So, don't assume that if the set command succeeds we have set all
expected bands. Instead, do an explicit loading of the current bands
after the set operation, same thing as we do when setting modes.
2018-08-08 18:42:47 +00:00
Aleksander Morgado 518d62e731 helpers-qmi: fix UMTS band 6 and 19 definitions
Also bump required libqmi version, as this change uses flags from the
latest available API.

UMTS B19 is NTT DoCoMo's 800MHz band.
UMTS B6  is NTT DoCoMo's 850MHz band
2018-08-08 18:39:32 +00:00
Aleksander Morgado 8430b05113 broadband-modem: allow Enable() if disabling or initializing
The first step in the Enable() processing is to wait for a final
state, so we can definitely wait for the ongoing disabling or
initializing states to finish before we go on with the enable
operation, there is no need to early fail if the disabling or
initializing intermediate states are detected.
2018-08-08 18:38:05 +00:00
Aleksander Morgado c476612247 base-modem: allow parallel Enable() and Disable() requests
If additional Enable() requests are received while one is already
ongoing, we queue them and will end up completing all with the same
result once the first one finishes.

Same logic also for Disable().

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/8
2018-08-08 18:38:05 +00:00
Ben Chan 30eef126a1 broadband-modem-mbim: subscribe to MBIM_CID_PCO notifications
This patch changes MMBroadbandModem to subscribe to MBIM_CID_PCO
notifications if the modem supports that.
2018-08-08 16:22:40 +02:00
Ben Chan d68078b2ce broadband-modem-mbim: check if modem implements MBIM_CID_PCO
Being a part of a series that adds PCO support for MBIM modems that
implement the MBIM_CID_PCO extension, this patch issues a
MBIM_CID_DEVICE_SERVICES query during the modem initialization to check
if a modem implements MBIM_CID_PCO. If the modem does, ModemManager will
subscribe to MBIM_CID_PCO notifications to get PCO updates.
2018-08-08 16:22:40 +02:00
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 3a4a137de3 broadband-modem-mbim: avoid use of uninitialized variable 2018-07-30 23:30:50 +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 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 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
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
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
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