Commit Graph

5661 Commits

Author SHA1 Message Date
Ben Chan
f9a0b945bc iface-modem: allow initial signal check after the modem is re-enabled
Commit 708b00ae3 "modem: allow periodic signal check to be disabled"
added a "iface-modem-periodic-signal-check-disabled" property in
MMIfaceModem/MMBroadbandModem to indicate if the periodic signal check
should be disabled. If the property is set to TRUE, the
signal_quality_polling_supported field of SignalCheckContext is set to
FALSE, which is sticky across modem disable/enable operations. However,
that is undesirable as we would like to issue an initial signal check to
refresh the signal quality value after the modem is re-enabled from a
state when the RF may have been previously turned off.
2018-04-25 10:34:35 +02:00
Ben Chan
5e5160c46a broadband-modem-mbim: implement initial signal quality loading
ModemManager currently relies on unsolicited MBIM_CID_SIGNAL_STATE
notifications to obtain signal quality updates, and it doesn't query the
initial signal quality. It's been observed that some MBIM modems issue a
MBIM_CID_SIGNAL_STATE notification only when there is a notable change
in RSSI. The signal quality may remain at 0 for quite some time. It's
more noticeable when simply restarting ModemManager after the modem has
been initialized and enabled once.

We could simply enable periodic signal check on an MBIM modem, but
that's less ideal as it may unnecessarily wake the modem up from USB
selective suspend (unless we use a much longer polling period).

To address the issue, this patch adds the implementation of
load_signal_quality to MMBroadbandModemMbim so that the signal quality
is initially polled via a solicited MBIM_CID_SIGNAL_STATE query. To
avoid the periodic signal check, we set the
MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED property to TRUE for
MMBroadbandModemMbim.
2018-04-24 18:22:03 +02:00
Ben Chan
708b00ae3b modem: allow periodic signal check to be disabled
ModemManager decides to disable periodic signal check if either
load_signal_quality is not implemented or load_signal_quality returns an
unsupported error. However, in some cases, we want to use
load_signal_quality to query the initial signal quality but rely on
unsolicited signal quality updates from the modem afterwards without
periodically polling for signal quality. To support that, this patch
introduces a property in MMIfaceModem/MMBroadbandModem to indicate if
the periodic signal check should be disabled.
2018-04-24 18:21:58 +02:00
Lubomir Rintel
b39dd2ec05 all: drop unused variables
Keeps build with GCC 8 happy.

mm-base-call.c:758:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-call.c:822:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-sms.c:908:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-sms-list.c:331:25: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
mm-iface-modem-messaging.c:1210:21: warning: variable 'storage_ctx' set but not used [-Wunused-but-set-variable]
huawei/mm-plugin-huawei.c:183:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:161:24: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:159:24: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
icera/mm-modem-helpers-icera.c:218:25: warning: variable 'first_free' set but not used [-Wunused-but-set-variable]
novatel/mm-common-novatel.c:50:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
2018-04-24 18:11:15 +02:00
Iain Lane
5072db3418 m4/compiler_warnings.m4: Let -Werror be disabled
It's annoying for distributors to build with -Werror, since it means
that compiler upgrades can break the build. Let's let them disable it,
but keep it enabled by default.
2018-04-24 18:08:29 +02:00
Aleksander Morgado
7e94928301 ublox: fix 'any' mode building
The 'any' mode refers to the mode which includes most access
technologies and where none of them is preferred.

Fix the logic so that all combinations with one technology preferred
over the others are ignored, instead of the other way around.

Fixes assertion with the 4G-only LARA R204.

    ModemManager[424]: <debug> [-192499452.090358] (ttyACM0): --> 'AT+URAT=?<CR>'
    ModemManager[424]: <debug> [-192499452.092150] (ttyACM0): <-- '<CR><LF>+URAT: (3)<CR><LF><CR><LF>OK<CR><LF>'
    **
    ERROR:ublox/mm-modem-helpers-ublox.c:817:mm_ublox_get_modem_mode_any: assertion failed: (any != MM_MODEM_MODE_NONE)

Reported-by: Matthew Starr <mstarr@hedonline.com>
2018-04-03 15:58:49 +02:00
Aleksander Morgado
c9dee2b960 build: bump version to 1.7.991 (1.8-rc2) 2018-03-27 13:27:27 +02:00
Aleksander Morgado
b451a838a4 docs: add missing reference to mm_modem_3gpp_get_eps_ue_mode_operation() 2018-03-13 13:33:28 +01:00
Aleksander Morgado
bcb0175f62 docs: always rebuild libmm-glib types
So that we don't forget to add new types here manually...
(e.g. MMBearerStats)
2018-03-13 13:29:54 +01:00
Aleksander Morgado
c147dfc267 libmm-glib: use ModemManager prefix to refer to the introspected types 2018-03-13 13:07:10 +01:00
Aleksander Morgado
5dff6ce594 libmm-glib,modem: fix introspection annotation for bearer list 2018-03-13 12:53:37 +01:00
Aleksander Morgado
eb6b4cac8a libmm-glib: add several missing headers 2018-03-13 12:53:18 +01:00
Aleksander Morgado
1481dd58e2 libmm-glib,bearer-properties: minor documentation typo fix 2018-03-13 12:41:47 +01:00
Aleksander Morgado
9535f4c474 libmm-glib,bearer: cleanup stats related mutex and object 2018-03-13 12:25:43 +01:00
Aleksander Morgado
3a7d4b1200 ublox: ignore ttyACM0 in the TOBY-L4
We used ttyACM0 as secondary port until now, just because we had an
extra AT capable TTY around in addition to the main control ttyACM2
port.

Turns out, using this ttyACM0 may actually break the connection setup
in the wwan interface in a bad way (e.g. not allowing DHCP setup).

The suggestion from u-blox and Intel is to fully ignore ttyACM0; and
given that we no longer need any primary/secondary port logic, we just
remove all the associated udev tags.
2018-03-09 18:42:51 +01:00
Aleksander Morgado
c9a78e12b7 po: add Indonesian translation
From: Andika Triwidada <andika@gmail.com>

https://bugs.freedesktop.org/show_bug.cgi?id=105337
2018-03-04 17:00:50 +01:00
Aleksander Morgado
dc678bfef2 base-manager: additional indentation for the block covered by ref/unref 2018-02-23 12:43:22 +01:00
Eric Caruso
402559bb62 mm-base-manager: ref MMDevice before releasing port
Releasing the port on the device looks benign but because it emits
a signal, it could call device_context_port_released and unref the
MMDevice in port_context_unref. This means the MMDevice might be
disposed before we get to the g_object_ref and the subsequent call
to g_hash_table_remove will try to hash a null string, which makes
MM crash.
2018-02-23 12:33:37 +01:00
Eric Caruso
d416ea491d mm-base-manager: remove element from hastable by key, not value
The hashtable is keyed on the UID of the MMDevice, and its hash
function is g_str_hash. We shouldn't be passing a GObject into
g_hash_table_remove because calling g_str_hash on an MMDevice is
wrong.
2018-02-21 12:41:20 +01:00
Alfonso Sánchez-Beato
10cb61f399 broadband-modem-qmi: update EPS registration state for LTE qmi modems
MM was not updating the EPS registration status for qmi modems. This
led to LTE-only modems never having 'registered' status. This was
happening for Quectel EC21-V modem.
2018-02-13 10:07:25 -06:00
Dan Williams
dce0752743 iface-modem-3gpp: don't force auto registration if already registered
In mm_iface_modem_3gpp_register_in_network() when deciding whether to
force automatic registration or not, check whether the modem is already
registered in a network.  Just checking whether we have a valid operator
code is not sufficient, as some modems (ublox Toby R2xx) don't always
return an operator name/code even when registered.
2018-02-08 11:54:32 -06:00
Aleksander Morgado
1817746f51 broadband-modem: fix reloading of detailed signal quality status
We should not cache the AT command response otherwise we will never
re-run the same command again. The cache is needed only for AT test
commands (e.g. AT+CESQ=?).
2018-02-06 14:01:04 +01:00
Aleksander Morgado
357b186134 ublox: ignore +PBREADY URCs
We don't want them to get in the way of our initialization phase:

    /org/freedesktop/ModemManager1/Modem/0 (device id 'c49ed59c4a411e923307330d3e1d82582cbfac37')
     -------------------------
     Hardware | manufacturer: 'u-blox'
              | model: 'unknown'
              | revision: 'TOBY-L4906
              | +PBREADY
              | 40.19_ENG0003'
              | H/W revision: 'unknown'
              | supported: 'gsm-umts, lte'
              | current: 'gsm-umts, lte'
2018-02-06 13:40:21 +01:00
Ben Chan
b0b405858f broadband-modem: remove unused GError field in SetupRegistrationChecksContext 2018-02-06 11:26:33 +01:00
Aleksander Morgado
0f377f943e API: don't depend on GLib in ModemManager headers
We should only depend on GLib on the libmm-glib headers. Otherwise,
packages using just the core headers (e.g. ModemManagerQt) would also
need to build-depend on GLib and we don't want to enforce that.

    cd ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src && ~/buildroot/output/host/usr/bin/arm-cortexa9_neon-linux-gnueabihf-g++  .... -fPIC -o CMakeFiles/KF5ModemManagerQt_static.dir/bearer.cpp.o -c ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/bearer.cpp
    In file included from ~/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ModemManager/ModemManager.h:41:0,
                     from ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/generictypes.h:27,
                     from ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/generictypes.cpp:23:
    ~/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ModemManager/ModemManager-compat.h:23:18: fatal error: glib.h: No such file or directory
    compilation terminated.
2018-02-05 20:23:49 +01:00
Ben Chan
636c245cd3 bearer-mbim: check if IP session is activated before deactivating it
It may be undesirable to issue a MBIM_CID_CONNECT
(MBIMActivationCommandDeactivate) command to deactivate an IP session
when the session isn't activated. For instance, it's been observed on
Huawei ME936 that it takes more than 30s for the modem to deactivate a
not-yet-activated session. This patch modifies MMBearerMbim to query if
a session is activated before trying to deactivate the session during a
connection attempt.
2018-02-02 09:32:53 -06:00
Ben Chan
785dfd3edd bearer-mbim: increase timeout for deactivating IP session to 60s
Since commit 0c7f3380a ("bearer-mbim: ensure session is disconnected
before trying to connect"), MMBearerMbim always issues a
MBIM_CID_CONNECT (MBIMActivationCommandDeactivate) command before a
MBIM_CID_CONNECT (MBIMActivationCommandActivate) command during a
connection attempt. That is to ensure that an IP session is actually
deactivated before we try to activate a new IP session.

Unfortunately, it's been observed on Huawei ME936 that it takes more
than 30s for the modem to respond to a MBIM_CID_CONNECT
(MBIMActivationCommandDeactivate) command when trying to deactivate a
session that hasn't been activated.

When the signal is weak, it's also possible that a modem takes more than
30s to deactivate an IP session during a disconnection attempt.

This patch increases the timeout for deactivating an IP session from 30s
to 60s in both connection and disconnection attempt.
2018-02-02 09:32:51 -06:00
Ben Chan
3de58d4137 bearer-mbim: remove a unnecessary MbimMessage variable 2018-02-02 09:32:49 -06:00
Ben Chan
456e1e0d0c huawei: handle optional 0x prefix on hex numbers in ^DHCP response
On Huawei ME936, the hex numbers in the response to AT^DHCP contain the 0x prefix, e.g.

  AT^DHCP?

  ^DHCP: 0xda7d0e0a,0xff000000,0xdb7d0e0a,0xdb7d0e0a,0x01261aac,0x00000000,100000000,50000000

This patch updates mm_huawei_parse_dhcp_response() to handle the
optional 0x prefix.
2018-01-27 12:13:18 -06:00
Ville Skyttä
90b89bb9f4 *: Spelling fixes 2018-01-25 09:52:12 +01:00
Aleksander Morgado
223b754fcc build: bump version to 1.7.990 (1.8-rc1) 2018-01-21 22:56:53 +01:00
Aleksander Morgado
54dec45243 NEWS: update for 1.8.0 2018-01-21 22:49:08 +01:00
Aleksander Morgado
b473db334e introspection: add reference to the MM_ID_PHYSDEV_UID udev tag in Device property 2018-01-21 08:36:49 +01:00
Aleksander Morgado
22ffd3f3aa broadband-modem: implement support for the +CEMODE command
The +CEMODE command is defined in 3GPP TS 27.007 (e.g. in section
10.1.28 in v11.0.0). This command allows querying or updating the
current UE mode, as well as checking the supported modes.

We implement support for loading the current mode and updating it. It
is assumed that the device does any additional operation needed by the
setting update, e.g. un-registering from CS when selecting an EPS-only
mode.
2018-01-20 15:41:07 +01:00
Aleksander Morgado
d4aaa436d9 modem-3gpp: allow loading and changing EPS UE mode of operation
The UE modes of operation for LTE are defined in 3GPP TS 24.301 (e.g.
section 4.3 in v10.3.0):
  * PS mode 1: EPS only, 'voice centric'
  * PS mode 2: EPS only, 'data centric'
  * CS/PS mode 1: EPS and non-EPS, 'voice centric'
  * CS/PS mode 2: EPS and non-EPS, 'data centric'

The mode specifies, among other things, how the UE should behave w.r.t
CS fallback depending on the capabilities reported by the network.
2018-01-20 15:41:07 +01:00
Aleksander Morgado
c5c9ab279d build: require libmbim 1.16.0 2018-01-20 15:39:26 +01:00
Aleksander Morgado
fbd1780e60 build: require libqmi 1.20.0 2018-01-20 15:39:26 +01:00
Aleksander Morgado
c4ea37fa02 filter: cdc-acm protocols 1 through 6 are all AT-capable
As per USB-IF "Class definitions for Communication Devices 1.2" docs.

Reported-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-01-18 16:32:32 +01:00
Ben Chan
c9e85b6716 iface-modem-3gpp: ignore initial registration check result when appropriate
When a modem is being enabled, an initial registration check is
scheduled to determine the current registration state and access
technology. The initial registration check is performed asynchronously
and may not complete before the modem state is transitioned to
'enabled'. When the modem is disabled shortly afterwards, the
registration state is transitioned to 'unknown' and the modem state is
transitioned to 'disabled'. But the completion of the initial
registration check after that can transition the registration state and
modem state to a wrong state. This patch addresses the issue by ignoring
a registration state update if the modem isn't already enabled or being
enabled.
2018-01-12 12:24:13 +01:00
Aleksander Morgado
d8c7251687 telit: use parent logic to load unlock retries
The generic broadband modem provides a common method to load unlock
retries based on CSIM queries. We modify the Telit plugin to use the
generic method but keeping the CSIM locking/unlocking logic in place.
2018-01-06 18:51:53 +01:00
Aleksander Morgado
30ea91e353 ublox: wait for READY URCs during port probing
The AT control TTYs in the u-blox modems may take some time to be
usable. In order to handle this issue, we configured some longer
timeouts during AT probing, but that may not be always enough.

The u-blox TTYs will report readiness via a "+AT: READY" URC, which
we can use during custom initialization to decide right away that the
port is AT. We use up to 20s as that is close to the worst case seen
during experimentation, happening after the module undergoes a full
NVM reset. If the timeout is reached without receiving the URC, we
still run standard AT probing afterwards. This new logic just tries
to make it sure we don't do any probing before the module is ready to
accept it.

If the module hasn't been hotplugged (i.e. it was already there when
ModemManager started) we do a quick first AT probing and if that fails
we run the "+AT: READY" URC wait as if it was hotplugged.
2018-01-04 10:09:24 +01:00
Colin Helliwell
c97b9d99e3 broadband-modem: implement generic unlock retries loading 2018-01-01 18:42:28 +01:00
Colin Helliwell
8f26848ef0 helpers: move generic load_unlock_retries from Telit plugin
As a precursor to a generic load_unlock_retries method, move the
CSIM Response parser from the Telit plugin into the core code.
2018-01-01 18:37:10 +01:00
Aleksander Morgado
850107acbf bearer-qmi: fix logic if error setting up WDS event report indications
If we get an error when setting up the WDS event report indications,
make sure we run connect_context_step() after having set the next step
as CONNECT_STEP_LAST.
2017-12-21 14:43:08 +01:00
Aleksander Morgado
c2b956aefc blacklist: Pycom uses Microchip's vid, so blacklist also by pid
The Microchip VID is added to the USB serial adapters greylist
instead, as it is very generic.

https://bugs.freedesktop.org/show_bug.cgi?id=104320
2017-12-18 22:55:36 +01:00
Aleksander Morgado
838b82b71b blacklist: include all Pycom devices
https://bugs.freedesktop.org/show_bug.cgi?id=104320
2017-12-18 15:34:48 +01:00
Aleksander Morgado
8f6e5bfefa sms-part-3gpp: improve warnings when decoding fails 2017-12-18 11:47:44 +01:00
Aleksander Morgado
332cf9dc01 libhelpers: include MMSmsEncoding in helper enums generation 2017-12-18 10:33:46 +01:00
Ben Chan
e8bac6cb92 sms-part-3gpp: decode Unicode SMS with non-BMP code points
Depsite 3GPP TS 23.038 specifies that Unicode SMS messages are encoded in
UCS-2, UTF-16 encoding is commonly used instead on many modern platforms to
allow encoding code points that fall outside the Basic Multilingual Plane
(BMP), such as Emoji. Most of the UCS-2 code points are identical to their
equivalent UTF-16 code points.  In UTF-16, non-BMP code points are encoded in a
pair of surrogate code points (i.e. a high surrogate in 0xD800..0xDBFF,
followed by a low surrogate in 0xDC00..0xDFFF). An isolated surrogate code
point has no general interpretation in UTF-16, but could be a valid (though
unmapped) code point in UCS-2.

This patch modifies the 3GPP SMS decoding to first try UTF-16BE and then fall
back to UCS-2BE on failure. If both fail, an empty string is returned
instead of a NULL pointer.
2017-12-18 10:21:29 +01:00
Eric Caruso
c44b928206 mm-iface-modem: add check_for_sim_swap method and enable steps
When in low-power mode, some modems will not dispatch unsolicited
notifications, such as for SIM hot swapping. There is code in
MMBroadbandModemTelit to handle this by checking the SIM identifier
during modem power up against the identifier cached in the SIM
D-Bus object. If they're different, the SIM has likely been
swapped while we were powered down.

We can move this code out to MMBroadbandModem because it doesn't
actually rely on any Telit-specific details, and invoke it from
MMIfaceModem via a new method.
2017-12-18 10:16:18 +01:00