Commit Graph

7059 Commits

Author SHA1 Message Date
Ben Chan
02ce611d5c huawei: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
38bafe021e huawei: port {enable,disable}_location_gathering to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
6ebc07f882 huawei: port location_load_capabilities to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
36d975bd4e huawei: port modem_after_sim_unlock to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
0aae6d3e35 huawei: port modem_time_check_support to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
60129a6fde huawei: port modem_load_signal_quality to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
0c468bb1a4 huawei: port load_sim_identifier to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
1495fb1d1d huawei: port load_power_state to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
046f1b3301 huawei: port load_supported_modes to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
c7ec2c4fbb huawei: port load_current_modes to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
bf03f1e2d7 huawei: port set_current_modes to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
5d9c4d70a1 huawei: port set_current_bands to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan
8b9402da2b huawei: port sysinfo to use GTask 2017-09-08 17:45:28 +02:00
Aleksander Morgado
833243570f wavecom: port modem_after_sim_unlock to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
288ebab106 wavecom: port register_in_network to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
ea3d20e98c wavecom: port set_current_bands to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
dd4ef7dc23 wavecom: port load_current_bands to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
e2b3b87674 wavecom: port load_supported_bands to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
bb5a950102 wavecom: port set_current_modes to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
fc33fe69b4 wavecom: port load_current_modes to use GTask 2017-09-07 19:28:23 +02:00
Aleksander Morgado
02e16d42bc wavecom: port load_supported_modes to GTask 2017-09-07 19:28:23 +02:00
Ben Chan
3342739798 broadband-modem-mbim: preserve unlock retries for PIN1 when appropriate
If PIN1 is disabled and we have tried to enable it with a wrong PIN, a
MBIM modem would have indicated the number of remaining attempts for
PIN1 (unless PUK1 is engaged) in the response to the failed MBIM_CID_PIN
set operation.

However, a MBIM_CID_PIN query may be issued (e.g.  MMBaseSim calls
mm_iface_modem_update_lock_info()) after the MBIM_CID_PIN set operation
to query the number of remaining attempts for a PIN type. Unfortunately,
we can't specify a particular PIN type in a MBIM_CID_PIN query. The
modem may not reply with information about PIN1 if PIN1 is disabled.
When that happens, we would like to preserve our knowledge about the
number of remaining attempts for PIN1.

This patch modifies MMBroadbandModemMbim's load_unlock_retries()
operation to carry over any previously observed information on PIN1 if
the MBIM_CID_PIN query reports something other than PIN1.
2017-09-07 19:07:01 +02:00
Ben Chan
eb9ec1b617 sim-mbim: update unlock retries information after PIN operations
After MMSimMbim performs a MBIM_CID_PIN set operation, it calls
mm_iface_modem_update_lock_info() (through its base class MMBaseSim) to
refresh the unlock retries information, which results in a MBIM_CID_PIN
query. However, a MBIM_CID_PIN query reports only the information of one
PIN type and the PIN type can't be specified, we need to deduce the
number of retries left for a specific PIN type from the response of a
MBIM_CID_PIN set operation for that PIN type. To allow that, this patch
modifies MMSimMbim to update the unlock retries information after a PIN
operation based on the response to the MBIM_CID_PIN set operation.
2017-09-07 19:06:55 +02:00
Ben Chan
d4ff05af5e iface-modem: export update_unlock_retries outside MMIfaceModem
This patch exports the internal function update_unlock_retries() in
MMIfaceModem as mm_iface_modem_update_unlock_retries(), which later
allows us to call it from other classes.
2017-09-07 19:06:50 +02:00
Aleksander Morgado
87341acaa8 build: import gtk-doc support
Remove the need to run `gtkdocize' when building from git; this should
be an operation done by the maintainer when modernizing the gtk-doc
setup (think of e.g. gettextize), no need to do it unconditionally.

This makes it easier for platforms without gtk-doc to build from git.

When trying to build with documentation enabled and gtk-doc isn't
found, we get some nice warnings and errors in the configure report:

    checking for gtk-doc... no
    configure: WARNING:
      You will not be able to create source packages with 'make dist'
      because gtk-doc >= 1.0 is not found.
    checking for gtkdoc-check... no
    checking for gtkdoc-check... no
    checking for gtkdoc-rebase... no
    checking for gtkdoc-mkpdf... no
    checking whether to build gtk-doc documentation... yes
    configure: error:
      You must have gtk-doc >= 1.0 installed to build documentation for
      ModemManager. Please install gtk-doc or disable building the
      documentation by adding '--disable-gtk-doc' to './configure'.

Files generated with gtkdocize (gtk-doc) 1.25.1.
2017-09-07 13:45:57 +02:00
Aleksander Morgado
b66aa51225 po: add Brazilian Portuguese translation
From: Rafael Fontenelle <rafaelff@gnome.org>

https://bugs.freedesktop.org/show_bug.cgi?id=102555
2017-09-07 13:39:06 +02:00
Piotr Drąg
f05a2ed41e po: add Polish translation
https://bugs.freedesktop.org/show_bug.cgi?id=102567
2017-09-07 13:15:00 +02:00
Aleksander Morgado
984625165e i18n: deprecate intltool and use only gettext 0.19.8
Instead of mixing both intltool and gettext, which not always work
correctly together, this patch obsoletes intltool and uses only
gettext, which includes support for translating XML files with ITS
rules.

See migration steps for GNOME projects here:
  https://wiki.gnome.org/MigratingFromIntltoolToGettext

The gettext ITS rules for polkit policy files are imported from the
upstream polkit repository. We don't use the polkit-installed rule
files yet because there is no tagged release that contains those files
yet, so we cannot build-depend on any specific polkit version.
  https://bugs.freedesktop.org/show_bug.cgi?id=96940
2017-09-07 13:04:34 +02:00
Aleksander Morgado
f0bb6ef856 api: add MM_DISABLE_DEPRECATED guards around deprecated symbols
When this symbol is defined, e.g. via CFLAGS, building a program that
uses the ModemManager API will fail if the program references
deprecated symbols.

For now we just use it to keep gtk-doc-scan happy and avoid
unnecessary warnings.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
d135c56f0f huawei: update frequency bands support
Updated to use the non-deprecated MMModemBand values.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
aae7105743 cinterion: update frequency bands support
Updated to use the non-deprecated MMModemBand values.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
44a850f8ad telit: update frequency bands support
Updated to use the non-deprecated MMModemBand values.

Also, use explicit enums for 2G/3G bands when building internal flags,
as relying on UTRAN band 7 (MM_MODEM_BAND_U2600) being greater than
UTRAN bands 8 and 9 is a MM implementation issue.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
4c921cd584 wavecom: update frequency bands support
Updated to use the non-deprecated MMModemBand values.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
2c96b31590 icera: update frequency bands support
Updated to use the non-deprecated MMModemBand values.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
f54779732a novatel-lte: update frequency bands support
Several changes here:
  * Updated to use the non-deprecated MMModemBand values.
  * Added support for GSM 450, GSM 480 and GSM 750.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
55316cabd4 ublox: update frequency bands support
Updated to use the non-deprecated MMModemBand values.
2017-09-07 10:55:17 +02:00
Aleksander Morgado
c41f7215a1 qmi: update frequency bands support
Several changes here:
  * Updated to use the non-deprecated MMModemBand values.
  * Added support for GSM 450, GSM 480 and GSM 750.
  * Added support for UMTS bands 11 and 19.
2017-09-07 10:55:16 +02:00
Aleksander Morgado
ede5fe6ddb api: define additional LTE frequency bands 2017-09-07 10:55:16 +02:00
Aleksander Morgado
84ac581f3f api: consolidate CDMA frequency enumerations
Define new symbols with easier names, just based on the Band Class.
2017-09-07 10:55:14 +02:00
Aleksander Morgado
b407678433 api: define additional UMTS frequency bands 2017-09-07 10:54:52 +02:00
Aleksander Morgado
7fb3aeacd3 api: new MM_BAND_UTRAN_ enumerations for WCDMA bands
Flag as deprecated the old names, and define new ones based on the
defined UTRAN band numbers, equivalent to what was done for LTE bands.
2017-09-07 10:54:52 +02:00
Aleksander Morgado
946149016b api: define additional GSM frequency bands
New definitions for not so common GSM frequency bands.
2017-09-07 10:54:52 +02:00
Aleksander Morgado
eedd4ab445 api: don't use intermediate variables for deprecation warnings
Using an intermediate constant variable breaks compilation with C
compilers, as these variables cannot be used as initializers.

Instead, define a deprecated type and cast all deprecated symbols to
that type. We lose the information about what the new replacement
symbol is, but we don't break compilation.

E.g.:
    test.c: In function ‘main’:
    test.c:8:5: warning: ‘MMModemBandDeprecated’ is deprecated [-Wdeprecated-declarations]
         printf ("band: %d\n", MM_MODEM_BAND_U2100);
         ^~~~~~
2017-09-07 10:54:49 +02:00
Aleksander Morgado
a29610f25d plugin,port-probe: always cast SEND_DELAY value to guint64
Program received signal SIGSEGV, Segmentation fault.
    strchr () at ../sysdeps/arm/armv6/strchr.S:28
    28    ../sysdeps/arm/armv6/strchr.S: No such file or directory.
    (gdb) bt
    #0  strchr () at ../sysdeps/arm/armv6/strchr.S:28
    #1  0x76b121c8 in g_param_spec_pool_lookup () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0
    #2  0x76b0cf44 in g_object_new_valist () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0
    #3  0x76b0d39c in g_object_new () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0
    #4  0x75f75e40 in mm_plugin_create () at ublox/mm-plugin-ublox.c:99
    #5  0x00031550 in load_plugin (path=0xe9b68 "/usr/lib/ModemManager/libmm-plugin-ublox.so") at mm-plugin-manager.c:1521
    #6  load_plugins (error=0x7efffa68, self=0xdc4f0) at mm-plugin-manager.c:1574
    #7  initable_init (initable=<optimized out>, cancellable=<optimized out>, error=0x7efffa68) at mm-plugin-manager.c:1679
    #8  0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #9  0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #10 0x000324d0 in mm_plugin_manager_new (plugin_dir=0xe9c40 "/usr/lib/ModemManager", error=error@entry=0x7efffa68) at mm-plugin-manager.c:1620
    #11 0x0002da08 in initable_init (initable=0xddb40, cancellable=<optimized out>, error=0x7efffa68) at mm-base-manager.c:1113
    #12 0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #13 0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #14 0x0002e81c in mm_base_manager_new (connection=connection@entry=0xe1070, plugin_dir=plugin_dir@entry=0x9efb0 "/usr/lib/ModemManager",
        auto_scan=auto_scan@entry=1, initial_kernel_events=initial_kernel_events@entry=0x0, enable_test=0, error=0x7efffa68, error@entry=0x7efffa60)
        at mm-base-manager.c:957
    #15 0x0002b6ec in bus_acquired_cb (connection=0xe1070, name=<optimized out>, user_data=<optimized out>) at main.c:87
    #16 0x76c26864 in connection_get_cb () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #17 0x76bc76cc in g_task_return_now () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #18 0x76bc7d50 in g_task_return () from
    ~/buildroot/output/staging/lib/libgio-2.0.so.0

See similar bug in GStreamer:
https://bugzilla.gnome.org/show_bug.cgi?id=740191
2017-09-05 20:16:18 +02:00
Aleksander Morgado
52aa393d40 base-sim: wrap in its own GTask the SIM id loading from the subclass
Instead of reusing the caller GTask, use a new GTask to wrap the
execution of the subclass' async method implementation.

Also, rename the _ready() methods implemented in the GObject
initialization flow so that we can use the load_sim_identifier_ready()
function name.
2017-09-04 17:59:59 +02:00
Aleksander Morgado
530ebf9063 telit: reorder code to keep the bottom-top flow for async methods 2017-09-04 17:59:59 +02:00
Aleksander Morgado
ada9934e90 telit: explicitly flag as const the constant string 2017-09-04 17:59:59 +02:00
Aleksander Morgado
f6ae514405 telit: plug memleak when SIM object cannot be acquired
The GTask wasn't being disposed.
2017-09-04 17:59:59 +02:00
Aleksander Morgado
be079381c0 telit: avoid leaking SIM object
We were getting the SIM object for all paths, but only using (and
disposing it) in the AFTER_POWER_UP_STEP_GET_SIM_IDENTIFIER step.

Update the logic to only retrieve, use and dispose the SIM object in
the step that is needed, and therefore avoid leaking it in the
remaining steps.
2017-09-04 17:59:59 +02:00
Carlo Lobrano
76916de313 telit-plugin: handle QSS unsolicited due to power state transitions
When transitioning between power-low and power-on modes, Telit modems
switch the SIM off/on, which leads to the emission of #QSS unsolicited not
related to actual SIM swaps.

To handle this #QSS unsolicited, this patch:

* disables reacting on #QSS unsolicited when modem_power_down is received
* implements modem_after_power_up that:
    - checks whether the SIM has been changed, matching cached SIM
      Identifier with the value in the current SIM. If SIM Identifier,
      is different, sim hot swap ports detected is called.
    - re-enables reacting on #QSS unsolicited
2017-09-04 17:59:59 +02:00