Commit Graph

4609 Commits

Author SHA1 Message Date
Dan Williams
830b6ebca8 broadband-bearer-icera: deactivate context before authentication
If the modem thinks a PDP context is already active it'll return
583 errors from IPDPCFG and IPDPACT until the context is
deactivated.  Deactivation was previously done after authentication,
but needs to be done before any part of the connect process to
ensure the PDP context is inactive.

The previous approach worked only if the context was being
deactivated already (which can take a bit of time) because it would
be deactivated after a few seconds and the connect could continue.
This approach works for more cases (like a MM crash and restart
while the modem is connected).
2016-05-24 09:35:49 -05:00
Lubomir Rintel
e27f4a6226 mbm: clean up the context on activate_ready
Otherwise the dangling pointer to the context that's being deallocated causes a
crash on spontaneous E2NAP receipt:

  ModemManager[1567]: <info>  [1462468083.031326] [mm-iface-modem.c:1431] __iface_modem_update_state_internal(): Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> registered)
  ModemManager[1567]: <debug> [1462468083.053745] [mm-port-serial-at.c:459] debug_log(): (ttyACM0): <-- '<CR><LF>*E2NAP: 0,36<CR><LF>'
  ModemManager[1567]: <debug> [1462468083.053857] [mbm/mm-broadband-modem-mbm.c:824] e2nap_received(): disconnected

  (ModemManager:1567): GLib-GIO-CRITICAL **: g_simple_async_result_set_error: assertion 'G_IS_SIMPLE_ASYNC_RESULT (simple)' failed

  Program received signal SIGTRAP, Trace/breakpoint trap.
  g_logv (log_domain=0x7ffff7086798 "GLib-GIO", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcda0) at gmessages.c:1046
  1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
  Missing separate debuginfos, use: debuginfo-install libmbim-1.12.4-2.el7.centos.x86_64 libqmi-1.14.2-1.el7.centos.x86_64
  (gdb) bt
  #0  0x00007ffff6a508c3 in g_logv (log_domain=0x7ffff7086798 "GLib-GIO", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcda0) at gmessages.c:1046
  #1  0x00007ffff6a50a3f in g_log (log_domain=log_domain@entry=0x7ffff7086798 "GLib-GIO", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff6abe73d "%s: assertion '%s' failed") at gmessages.c:1079
  #2  0x00007ffff6a50a79 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff7086798 "GLib-GIO", pretty_function=pretty_function@entry=0x7ffff7092ce0 <__FUNCTION__.13394> "g_simple_async_result_set_error", expression=expression@entry=0x7ffff7092a40 "G_IS_SIMPLE_ASYNC_RESULT (simple)") at gmessages.c:1088
  #3  0x00007ffff6ff9d3d in g_simple_async_result_set_error (simple=0x7fffe8006e40, domain=297, code=0, format=0x7ffff175b53f "Call setup failed") at gsimpleasyncresult.c:719
  #4  0x00007ffff17569ea in report_connection_status (bearer=0x7fffe4008a40 [MMBroadbandBearerMbm], status=MM_BEARER_CONNECTION_STATUS_DISCONNECTED) at mbm/mm-broadband-bearer-mbm.c:174
  #5  0x000055555559c9f1 in mm_base_bearer_report_connection_status (self=0x7fffe4008a40 [MMBroadbandBearerMbm], status=MM_BEARER_CONNECTION_STATUS_DISCONNECTED) at mm-base-bearer.c:1118
  #6  0x00007ffff17548ed in bearer_list_report_status_foreach (bearer=0x7fffe4008a40 [MMBroadbandBearerMbm], ctx=0x7fffffffd060) at mbm/mm-broadband-modem-mbm.c:805
  #7  0x00007ffff6a45f18 in g_list_foreach (list=<optimized out>, func=0x7ffff17548c9 <bearer_list_report_status_foreach>, user_data=0x7fffffffd060) at glist.c:994
  #8  0x00005555555a224b in mm_bearer_list_foreach (self=0x5555558e0680 [MMBearerList], func=0x7ffff17548c9 <bearer_list_report_status_foreach>, user_data=0x7fffffffd060) at mm-bearer-list.c:146
  #9  0x00007ffff1754a3d in e2nap_received (port=0x5555558e24c0 [MMPortSerialAt], info=0x555555935730, self=0x555555900330 [MMBroadbandModemMbm]) at mbm/mm-broadband-modem-mbm.c:850
  #10 0x000055555563d9fd in parse_unsolicited (port=0x5555558e24c0 [MMPortSerialAt], response=0x7fffe80054f0) at mm-port-serial-at.c:280
  #11 0x0000555555639915 in parse_response_buffer (self=0x5555558e24c0 [MMPortSerialAt]) at mm-port-serial.c:889
  #12 0x0000555555639f0b in common_input_available (self=0x5555558e24c0 [MMPortSerialAt], condition=G_IO_IN) at mm-port-serial.c:1019
  #13 0x0000555555639fc7 in iochannel_input_available (iochannel=0x555555926df0, condition=G_IO_IN, data=0x5555558e24c0) at mm-port-serial.c:1042
  #14 0x00007ffff6a4979a in g_main_context_dispatch (context=0x5555558a4a00) at gmain.c:3109
  #15 0x00007ffff6a4979a in g_main_context_dispatch (context=context@entry=0x5555558a4a00) at gmain.c:3708
  #16 0x00007ffff6a49ae8 in g_main_context_iterate (context=0x5555558a4a00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3779
  #17 0x00007ffff6a49dba in g_main_loop_run (loop=0x5555558acf10) at gmain.c:3973
  #18 0x000055555558d068 in main (argc=2, argv=0x7fffffffdc38) at main.c:181
  (gdb)

https://bugzilla.redhat.com/show_bug.cgi?id=1333293
https://bugs.freedesktop.org/show_bug.cgi?id=95303
2016-05-10 16:25:05 -05:00
Lubomir Rintel
ff8f030d24 mtk: add D-Link DWM-156 A3 2016-05-04 09:49:43 -05:00
Daniele Palmas
1af8304a8f build: modified Telit and Dell sections
This patch adds section for building Telit common code and modifies
Dell section for using Telit library
2016-05-03 11:44:39 -05:00
Daniele Palmas
ed97ebf6bf dell: add udev rules for 413c/81ba
udev rules for Dell-branded 413c/81ba Telit modem are used for dynamic
port configuration in Telit plugin custom init
2016-05-03 11:44:37 -05:00
Daniele Palmas
4403bb7764 dell: add Telit manufacturer
Dell-branded AT based Telit modems should use Telit plugin functions
2016-05-03 11:44:33 -05:00
Daniele Palmas
850318fd96 telit: code refactoring
This patch moves init and port grabbing functions to a separate file
to allow functions call from Dell plugin
2016-05-03 11:44:30 -05:00
Dan Williams
f5a061efbf bearer-mbim: fine-tune bearer IP method reporting
v4: modems/providers may not return DNS servers and not all modems
support DHCP, so lack of DNS servers should not indicate a bearer
IP method of "DHCP".  IP config daemon/scripts already have to handle
missing DNS anyway.

v6: IPv6 requires SLAAC or DHCPv6 as part of the specification, so for
now we assume modems will support it.  Provide all the info the modem
sent, but if there is any missing information use an IP method of
"DHCP" to indicate that info should be obtained via SLAAC/DHCPv6.  Only
use an IP method of "STATIC" when all basic properties are given by
the modem.
2016-05-03 11:39:19 -05:00
Aleksander Morgado
ccc148fe9b libmm-glib,common-helpers: fix reading boolean from string
The "0" case wasn't being handled properly:
  $ sudo mmcli -m 0 --create-bearer="apn=,allow-roaming=0"
  Error parsing properties string: 'Cannot get boolean from string '0''
2016-04-19 14:02:13 +02:00
Aleksander Morgado
59f57befa4 release: bump version to 1.5.992 (1.6-rc3) 2016-04-18 08:11:45 +02:00
Aleksander Morgado
5286eaca51 NEWS: include QMI network disconnections 2016-04-18 08:11:00 +02:00
Dan Williams
80ce59385f bearer-qmi: listen for Packet Service Status indication and handle disconnection
Hook up to the WDS Packet Service Status indication, listen for
disconnection events, and disconnect the bearer when we get one.
2016-04-15 11:49:03 -05:00
Aleksander Morgado
650f4a2e91 huawei: fix reading IPv4 address in BE systems
Tested by: <than@redhat.com>

https://bugs.freedesktop.org/show_bug.cgi?id=94777
2016-04-13 11:39:24 +02:00
Aleksander Morgado
62805a11f1 port-probe: fix missing task disposals 2016-04-13 09:45:02 +02:00
Aleksander Morgado
276e28fe81 port-probe: make sure stored task pointer is set to NULL before completing
When we were completing tasks in idle, the logic was like this:

 * Schedule task completion in idle
 * self->priv->task = NULL
 * (idle) Task completion callback called

This meant that the self->priv->task was always set to NULL before the
completion callback was called, which is what we wanted as a new task may be
scheduled in the callback itself.

Now, without completing in idle, we were wrongly doing:

 * Task completion callback called
 * self->priv->task = NULL

This commit fixes the logic by making sure self->priv->task = NULL before any
task completion.
2016-04-08 16:38:00 +02:00
Carlo Lobrano
8a38621869 dell: fixed cgmi_retries in dell_custom_init
Initialized "cgmi_retries" variable from CustomInitContext with the
same value as the other retries, moreover the context is now allocated
with g_slice_new0.

Before this changes, when cgmi_retries assumed big values during the
probing of no AT-capable ports, the command AT+CGMI (mm-plugin-dell.c:custom_init_step)
was sent a semi-infinite number of times, blocking the plugin's initialization.
2016-04-06 10:50:35 +02:00
Aleksander Morgado
1f13909d9b build: make '--with-suspend-resume' auto by default
If systemd is found, enable suspend resume support.
2016-04-03 21:54:19 +02:00
Aleksander Morgado
ae2988da93 build: use 'no' to disable suspend/resume support, instead of 'none' 2016-04-03 21:33:56 +02:00
Aleksander Morgado
0e5fdadcd3 build: use 'no' to disable polkit, instead of 'none' 2016-04-03 21:33:50 +02:00
Aleksander Morgado
55408e8b94 device: port probe may be in the ignored list 2016-03-27 21:53:03 +02:00
Aleksander Morgado
f156ec06fb context: use G_OPTION_ARG_FILENAME when a file path is expected 2016-03-27 21:39:11 +02:00
Aleksander Morgado
0f9377686d context: fix --help output
The options that require an argument should explicitly specify so.

Before:
  --log-level=INFO             Log level: one of [ERR, WARN, INFO, DEBUG]
  --log-file                   Path to log file

After:
  --log-level=[LEVEL]          Log level: one of ERR, WARN, INFO, DEBUG
  --log-file=[PATH]            Path to log file
2016-03-27 21:35:55 +02:00
Aleksander Morgado
6ba37aa041 base-modem: remove unused 'mm_base_modem_get_port()' method 2016-03-27 18:52:39 +02:00
Aleksander Morgado
1583452554 base-modem: remove unused 'mm_base_modem_owns_port()' method 2016-03-27 18:52:35 +02:00
Aleksander Morgado
547b9b9d87 base-modem: remove unused 'mm_base_modem_release_port()' method 2016-03-27 18:51:45 +02:00
Tomas Jura
ad03445bf7 serial: do not restore termios on port close 2016-03-26 16:54:17 +01:00
Aleksander Morgado
d6cee7782b release: bump version to 1.5.991 (1.6-rc2) 2016-03-25 11:15:14 +01:00
Brian Norris
34961f20a6 libmm-glib: fix enum conversion warning/error
mm-modem-oma.c:400:51: error: implicit conversion from enumeration type 'MMOmaSessionType' to different enumeration type 'MMOmaFeature'
      [-Werror,-Wenum-conversion]
    g_return_val_if_fail (MM_IS_MODEM_OMA (self), MM_OMA_SESSION_TYPE_UNKNOWN);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmessages.h:382:11: note: expanded from macro 'g_return_val_if_fail'
         return (val);                                                  \
         ~~~~~~  ^~~

This should be MMOmaFeature, not MMOmaSessionType. The end result is the same,
as both are 0.
2016-03-25 11:14:00 +01:00
Aleksander Morgado
2c1230ba7b po: sleep monitor source file was renamed
Reported by: Michael Biebl <biebl@debian.org>
2016-03-23 22:50:34 +01:00
Lubomir Rintel
8fee9a99f0 port-probe: unlink the task from probe before completing it
The task completion may try to enqueue a next probe task and in
mm_port_probe_run() it asserts there's no task linked.

https://bugs.freedesktop.org/show_bug.cgi?id=94664

Fixes: 1939c5ace5
2016-03-22 22:26:16 +01:00
Aleksander Morgado
a0e8505156 build: rename sleep monitor source file, only one implementation available 2016-03-21 23:48:46 +01:00
poma
6197a06931 UPower signaling obsolescence
"Newer upower versions no longer emit that signal since this handled by systemd."
by Michael Biebl <mbiebl@gmail.org>
https://lists.freedesktop.org/archives/devkit-devel/2014-March/001575.html

See also "Plans for UPower 1.0"
by Richard Hughes <hughsient@gmail.com>
https://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html

Signed-off-by: poma <pomidorabelisima@gmail.com>
2016-03-21 23:44:51 +01:00
Lubomir Rintel
342ea24e34 cinterion: drop unused constants
GCC 6 doesn't like this. Unused since f2024b7.
2016-03-21 15:05:52 +01:00
Lubomir Rintel
2a5909af17 wmc: fix a typo in the test
GCC 6 notices an unused constant and errors out.
2016-03-21 15:02:41 +01:00
Aleksander Morgado
6512fde74d build: fix missing MMCLI_LIBS variable 2016-03-21 11:14:25 +01:00
Aleksander Morgado
021e57a283 build: run configure script from builddir rather than srcdir
Based on an equivalent patch from Philip Withnall <philip@tecnocode.co.uk>
for libmbim; see:

    https://bugs.freedesktop.org/show_bug.cgi?id=94639
2016-03-21 10:45:25 +01:00
Aleksander Morgado
07f899a9d3 release: bump version to 1.5.900 (1.6-rc1)
Also bump soname of libmm-glib, as the interface has grown since the last tag.
2016-03-18 12:56:08 +01:00
Aleksander Morgado
0c2f98d2a7 NEWS: update for 1.6.0 2016-03-18 12:49:39 +01:00
Aleksander Morgado
c6dda5e502 build: require libmbim 1.12 and libqmi 1.14
Preparing for the new ModemManager stable release, we now require the latest
stable series of both libmbim and libqmi.
2016-03-18 11:36:52 +01:00
Aleksander Morgado
d7a643b16a libmm-glib,modem-voice: fix unknown methods in documentation
html/MMCallProperties.html:141: warning: no link for: 'mm-modem-voice-create' -> (<code class="function">mm_modem_voice_create()</code>).
    html/MMCallProperties.html:141: warning: no link for: 'mm-modem-voice-create-sync' -> (<code class="function">mm_modem_voice_create_sync()</code>).
    html/MMModemVoice.html:379: warning: no link for: 'mm-modem-voice-delete-finish' -> (<code class="function">mm_modem_voice_delete_finish()</code>).
    html/MMModemVoice.html:380: warning: no link for: 'mm-modem-voice-delete-sync' -> (<code class="function">mm_modem_voice_delete_sync()</code>).
2016-03-16 18:26:33 +01:00
Aleksander Morgado
4055488fd0 libmm-glib,modem-location: fix unknown method in documentation
html/MMModemLocation.html:516: warning: no link for: 'mm-modem-dup-supl-server' -> (<code class="function">mm_modem_dup_supl_server()</code>).
2016-03-16 18:13:18 +01:00
Dan Williams
1ae6a7be8a build: work around automake-1.15 & intltool complaining about translations in build dir
make distcheck runs a build in dist directory subtirs and then runs intltool -m
which in turn complains about translations in a built file:

  The following files contain translations and are currently not in use. Please
  consider adding these to the POTFILES.in file, located in the po/ directory.

    sub/data/org.freedesktop.ModemManager.policy.in

The issue is reported to intltool upstream already:
https://bugs.launchpad.net/intltool/+bug/1117944
2016-03-15 16:17:42 -05:00
Aleksander Morgado
93bf189fa2 build,libmm-glib: built headers shouldn't be included in dist 2016-03-15 19:15:25 +01:00
Aleksander Morgado
eeb9e2bdcc build: end all multiline list variables with $(NULL)
So that appending a new item in the list only inserts one new line (i.e. the
last $(NULL) is the last item always).
2016-03-15 19:15:25 +01:00
Aleksander Morgado
f9c63bfa05 build,plugins: update build rules
We try to combine in common envvars the compiler and linker flags shared by the
different components, and where possible, also re-using the implicit AM_CFLAGS
and AM_LDFLAGS variables that automake provides, and which apply to all objects
being built in the same Makefile.am.

The plugins build rules are also updated so that whenever a plugin has some
testable 'helpers', these are compiled into a noinst library and then the new
library included by both the plugin and the tester program. This avoids multiple
recompilations of the same sources for different objects.
2016-03-15 19:15:25 +01:00
Aleksander Morgado
3b8361eb06 build,core: update build rules
We try to combine in common envvars the compiler and linker flags shared by the
different components, and where possible, also re-using the implicit AM_CFLAGS
and AM_LDFLAGS variables that automake provides, and which apply to all objects
being built in the same Makefile.am.

The internal libmodem-helpers.la library is also renamed to libhelpers.la
2016-03-15 19:15:25 +01:00
Aleksander Morgado
3bac0a17f5 build,libmm-glib: fix gdbus-codegen rules
The rule with multiple targets means that for each of the target the command
specified is run; not that a single run of the command generates all the targets
specified.

So, generate the .c file with the command, and make the .h and the .xml files
a side-effect of the .c generation.
2016-03-15 19:15:25 +01:00
Dan Williams
0a9cbf65ea modem-helpers: fix handling split PDP context ID reporting in CGDCONT=? response
Cinterion PHS8-US devices send split PDP context ID like "(1-17,101-112)" and
that caused the modem-helpers to choke.
2016-03-15 10:34:28 -05:00
Aleksander Morgado
8ac075d768 build: ignore thuraya helpers test 2016-03-13 18:01:16 +01:00
Aleksander Morgado
e00fd54a20 build: bump required gettext version to 0.19.3
Otherwise:
    configure.ac:86: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
    configure.ac:86: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
    configure.ac:86: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
2016-03-13 17:39:20 +01:00