Commit Graph

7059 Commits

Author SHA1 Message Date
Thomas Haller
094fea5392 libmm-glib: fix memleak of MMModem's ports
Fixes: 3206e95663
2017-01-04 13:36:31 +01:00
Carlo Lobrano
61dc32a72c telit: wrong port peek in telit_qss_toggle_ready
qss unsolicited handler should be assigned to primary port first,
while secondary port was peeked.
2017-01-04 13:35:36 +01:00
Carlo Lobrano
9a92034cd3 device: fixed crash in SIM hot swap when removing the SIM
mm_device_create_modem needs a valid object_manager instance to create the new
modem, while the one provided before was cleared out by a call to
mm_device_remove_modem few lines before.

Since the newly created modem refers to the same HW device, we can use
the same object_manager also.

https://bugs.freedesktop.org/show_bug.cgi?id=99160
2016-12-20 16:15:37 +01:00
Carlo Lobrano
0bf4db6561 telit: blacklist LE866 flashing device
Moved blacklist code to 77-mm-usb-device-blacklist.rules as per code review
2016-12-12 10:55:04 +01:00
Aleksander Morgado
4197dd2e70 bearer-qmi: signal id may be 0 even if enable == FALSE
E.g. if the connection attempt fails, connect_context_complete_and_free() may
be called before the signals are connected to the QmiClients.

https://bugs.freedesktop.org/show_bug.cgi?id=99047
2016-12-11 12:45:09 +01:00
Aleksander Morgado
905c8a48e9 libqcdm,libwmc: use C99 sized types from stdint.h 2016-11-23 19:27:09 +01:00
Aleksander Morgado
944e34ecdb tests,dbus: append pid to abstract socket name
So that different concurrent runs of this same test don't clash with
each other:

    TEST: test-service-generic... (pid=11124)
      /MM/Service/Generic/enable-disable:                                  Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    ** (plugins/.libs/lt-test-service-generic>:11124): ERROR **: Cannot bind socket: Error binding to address: Address already in use
    cleaning up pid 11144
    FAIL
2016-11-23 11:02:18 +01:00
Aleksander Morgado
20074c5574 tests,dbus: check if we're asked to use an abstract socket 2016-11-23 11:02:18 +01:00
Aleksander Morgado
c1e62794ae introspection: expand list of XMLs to install
And avoid including the wip-* XMLs in the dist tarball.
2016-11-21 20:20:12 +01:00
Aleksander Morgado
3b38ecb01e introspection: avoid white lines within <variablelist>
Looks like gdbus-codegen ends up making paragraphs and that breaks the
XML parsing:

      DOC   Building HTML
    ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml:60: parser error : Opening and ending tag mismatch: variablelist line 59 and para
    </para><para>          <varlistentry><term><literal>action</literal></term>
           ^
    ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml:110: parser error : Opening and ending tag mismatch: para line 110 and variablelist
    </para><para>        </variablelist>
                                        ^
    ../xml/ModemManager-dbus-reference.xml:93: element include: XInclude error : could not load ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml, and no fallback was found
2016-11-21 13:55:49 +01:00
Aleksander Morgado
30c2790aa4 kerneldevice,generic: load virtual devices without default rules
This is so that "make check" doesn't depend on having the rule files
installed in the default udev rules directory, which currently would
break the build:

    TEST: test-service-generic... (pid=2601)
      /MM/Service/Generic/enable-disable:                                  Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'

    ** (/home/aleksander/Development/foss/ModemManager/plugins/.libs/lt-test-service-generic:2601):
    ERROR **: Error setting test profile: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Failed to find primary AT port
    FAIL
    GTester: last random seed: R02S3897abaae9df36f8d2eeb679406ab675
    make[3]: *** [Makefile:3804: test-nonrecursive] Terminated
2016-11-21 13:44:08 +01:00
Aleksander Morgado
51e3d3d837 modem-helpers: improve +CCLK parsing
Added support for 4-digit format years (i.e. YYYY), and also made the
timezone information optional, as per +CSDF in 3GPP TS 27.007.

https://bugs.freedesktop.org/show_bug.cgi?id=95319
2016-11-18 10:25:07 +01:00
Aleksander Morgado
64b4afa960 kernel-device: return G_MAXUINT when get_property_as_int_hex() fails 2016-11-07 19:46:40 +01:00
Aleksander Morgado
820ab01ddf kernel-device: ID_USB_INTERFACE_NUM should be read as an hex string
The original g_udev_device_get_property_as_int() uses strtol() without
an explicit base (i.e. 0) so that the base is autodetected from the
string whenever possible (e.g. if prefixes with '0x' it is treated as a
hexadecimal string).

But, for ID_USB_INTERFACE_NUM, we explicitly require reading the number
as an hex string, even if we don't have any '0x' prefix.

Reported-by: Matthew Stanger <stangerm2@gmail.com>
2016-11-07 19:41:05 +01:00
Aleksander Morgado
4f748144b0 port-probe: don't probe ignored ports
If a port has been flagged as ignored with the ID_MM_PORT_IGNORE udev property,
we shouldn't open and probe the ports in any way, just flag them as ignored. We
still report them in the list of modem ports, but just with "unknown" type and
therefore not using them for anything.
2016-11-07 17:52:57 +01:00
Sam Spilsbury
a0b95db2b9 Makefile: Move to AM_DISTCHECK_CONFIGURE_FLAGS
Since automake 1.11.2 it is recommended that packages
use AM_DISTCHECK_CONFIGURE_FLAGS instead of
DISTCHECK_CONFIGURE_FLAGS as the latter is intended
to be a user variable.

https://bugs.freedesktop.org/show_bug.cgi?id=95826
2016-10-26 17:28:03 +02:00
Daniele Palmas
9583ec98fd broadband-modem-qmi: add QMI_PROTOCOL_ERROR_NOT_SUPPORTED case for pin status checking
Telit LE922A does not like the legacy way for checking pin status, but
instead of returning QMI_PROTOCOL_ERROR_INVALID_QMI_COMMAND, it returns
QMI_PROTOCOL_ERROR_NOT_SUPPORTED, making the modem not to be fully
initialized.

This patch adds QMI_PROTOCOL_ERROR_NOT_SUPPORTED as another error for
which the new pin checking status way is tried.
2016-10-25 15:52:27 +02:00
Aleksander Morgado
2c5af4f0bc core: use a default timeout of 300s for the scan networks operation
This is the value which we actually suggest in the manpage for the mmcli
operation, so just use the same one.

   Scanning for 3GPP networks may really take a long time, so a specific timeout must be given:
       $ mmcli -m 0 --3gpp-scan --timeout=300

       Found 4 networks:
       21404 - Yoigo (umts, available)
       21407 - Movistar (umts, current)
       21401 - vodafone ES (umts, forbidden)
       21403 - Orange (umts, forbidden)

https://bugs.freedesktop.org/show_bug.cgi?id=98235
2016-10-24 13:34:27 +02:00
Lubomir Rintel
ccea14ac47 systemd: tighten the service security a bit
What's left enabled:

* Access to /dev -- obviously
* CAP_SYS_ADMIN -- this is needed by TIOCSSERIAL only. Too bad this also
  allows TIOCSTI, which allows for code injection unless something else
  (SELinux) disallows access to ttys with shells.
  Maybe kernel should use CAP_SYS_TTY_CONFIG for this.
* socket(AF_NETLINK) -- udev & kernel device changes
* socket(AF_UNIX) -- D-Bus
2016-10-24 13:15:15 +02:00
Sławomir Bocheński
da2b0064ee blacklist: ignore Sigma Sport docking stations
These CDC ACM class devices are docking stations for Sigma Sport bike
computers. As they are sensitive to single byte commands, ModemManager
probing mechanism actually caused training data on attached bike
computer to be zeroed.

https://bugs.freedesktop.org/show_bug.cgi?id=96430
2016-10-24 13:07:50 +02:00
Carlo Lobrano
7078587f58 telit: optimized supported and current band code
In place of two slightly different regexes for 2g/3g and 2g/3g/4g modems
we now use only one regex with conditional patterns for both supported
and current Bands detection.

Adding also minor fix in test code
2016-10-20 12:40:04 +02:00
Aleksander Morgado
0bd3ca202b broadband-modem-qmi: don't use PIN2 lock state if unknown 2016-10-19 09:34:54 +02:00
Aleksander Morgado
17a90b8fa6 libmm-glib,call-properties: fix wrong enum returned
https://bugs.freedesktop.org/show_bug.cgi?id=98220
2016-10-13 12:08:21 +02:00
Aleksander Morgado
af90506da4 build: disable GLib deprecation warnings until fully ported to GTask
Otherwise the build log is very very dense...

    ../../src/mm-broadband-modem-qmi.c: In function 'modem_load_own_numbers':
    ../../src/mm-broadband-modem-qmi.c:1406:5: warning: 'g_simple_async_result_new' is deprecated (declared at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:51): Use 'g_task_new' instead [-Wdeprecated-declarations]
         result = g_simple_async_result_new (G_OBJECT (self),
         ^
    ../../src/mm-broadband-modem.c: In function 'signal_quality_qcdm_ready':
    ../../src/mm-broadband-modem-mbim.c: In function 'modem_3gpp_scan_networks_finish':
    ../../src/mm-broadband-modem.c:1986:9: warning: 'g_simple_async_result_take_error' is deprecated (declared at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:116) [-Wdeprecated-declarations]
             g_simple_async_result_take_error (ctx->result, error);
             ^
    ../../src/mm-broadband-modem-mbim.c:2824:5: warning: 'g_simple_async_result_propagate_error' is deprecated (declared at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:119) [-Wdeprecated-declarations]
         if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
         ^
2016-10-13 12:00:26 +02:00
Aleksander Morgado
33e563fe48 ublox: fix VPATH builds and distcheck
https://bugs.freedesktop.org/show_bug.cgi?id=98216
2016-10-13 11:49:44 +02:00
Aleksander Morgado
e3e803998c ublox: add README explaining all details of the plugin 2016-10-12 13:24:10 +02:00
Aleksander Morgado
38bf567536 ublox: longer timeout needed for AT probing
When the device is reset, it needs some time before the newly exposed TTYs are
able to reply to our AT commands. We increase the default timeout of the AT
probing commands in order to cope with that, or we'll end up with TTYs of
'unknown' type that aren't used for anything.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
5a9f093839 modem-helpers: implement less strict APN comparison
u-blox modems will append a string showing the MCC and MNC info to the access
point name listed in AT+CGDCONT? responses. We will try to detect when that
happens, and we just accept the match.

The logic doesn't just look for a string prefix; it also looks for the special
MCC + MNC suffix, which is much more restrictive, to try to avoid false
positives.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
75ad9bf98b broadband-bearer: more detailed logging of why a given CID is chosen 2016-10-12 13:24:09 +02:00
Aleksander Morgado
e64b964e8e ublox: implement connection statistics loading
The implementation uses +UGCNTRD=? to query whether the per-PDP context
statistics are supported by the device, and if they are, +UGCNTRD is used to
query them.

We only process the statistics for the specific CID we're using.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
e6e53467ee ublox: new +UGCNTRD? response parser
The parser returns only the results for the CID being specified as input. This
is so that we can just query the statistics of the CID currently in use by the
bearer.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
1775544dbc base-bearer: allow deactivating stats loading if device says unsupported 2016-10-12 13:24:09 +02:00
Aleksander Morgado
79aebb9ba4 ublox: implement current bands setting
Reuse the logic and context used to update current modes, as we need the same
steps (check current power state, go into low power, config update, and recover
previous power state).
2016-10-12 13:24:09 +02:00
Aleksander Morgado
1c69a847ae ublox: new +UBANDSEL=X command builder 2016-10-12 13:24:09 +02:00
Aleksander Morgado
c165f24514 ublox: implement current bands loading 2016-10-12 13:24:09 +02:00
Aleksander Morgado
09c9ca5749 ublox: new +UBANDSEL? response parser 2016-10-12 13:24:09 +02:00
Aleksander Morgado
4632836d40 ublox: implement supported bands loading 2016-10-12 13:24:09 +02:00
Aleksander Morgado
292914cf65 iface-modem: always sort supported and current bands before exposing them 2016-10-12 13:24:09 +02:00
Aleksander Morgado
ca1b9cb686 ublox: use +UAUTHREQ to setup PDP context authentication 2016-10-12 13:24:08 +02:00
Aleksander Morgado
90943177ed broadband-modem: implement the Signal interface
Provide a generic +CESQ based implementation for the extended Signal interface,
applicable to all AT-based modems.

We explicitly disable this check in MBIM modems.
2016-10-12 13:24:08 +02:00
Aleksander Morgado
7ab3d3e727 modem-helpers: new helper to parse +CESQ response into MMSignal objects 2016-10-12 13:24:08 +02:00
Aleksander Morgado
df6f6d1f37 modem-helpers: new +CESQ response parser 2016-10-12 13:24:08 +02:00
Aleksander Morgado
9b3549e375 api,signal: new RSCP item 2016-10-12 13:24:08 +02:00
Aleksander Morgado
4c02fba819 ublox: implement PIN retry count loading 2016-10-12 13:24:08 +02:00
Aleksander Morgado
29517c99ba ublox: new +UPINCNT response parser 2016-10-12 13:24:08 +02:00
Aleksander Morgado
fe460b2f54 3gpp: update registration state enumeration with CSFB related states
Introduce "sms only" and "CSFB not preferred" home/roaming states to be reported
for the CS context, while already registered on LTE.

Based on 3GPP TS 27.007 v13.5.0.
2016-10-12 13:24:08 +02:00
Aleksander Morgado
a561f6edf0 ublox: use +CEREG if LTE supported 2016-10-12 11:29:52 +02:00
Aleksander Morgado
7cb11f72cd ublox: implement current modes setting and modem power up/down/off/reset
Changing current allowed/preferred modes requires the device to be in low-power
mode, so we will make sure we return an error if any power operation is already
ongoing when a new one is requested.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
9d78f05cbd ublox: new +URAT=X command builder 2016-10-12 11:29:52 +02:00
Aleksander Morgado
5d2e89e712 ublox: implement power state loading 2016-10-12 11:29:52 +02:00