Commit Graph
4354 Commits
Author SHA1 Message Date
Aleksander Morgado 553666d63a build: use absolute paths when ignoring specific files in subdirs
If paths are not prefixed with '/' they are taken as filename-ignores that apply
to the whole tree.
2015-02-16 16:48:57 +01:00
Aleksander Morgado 8b985af3b6 build: remove obsolete ignored files 2015-02-11 19:58:13 +01:00
Aleksander Morgado f4ec32e633 test: new 'mmtty' utility
The new tester allows to play with the AT-capable TTY using the same code as
ModemManager itself.

    $ sudo ./test/mmtty -d /dev/ttyHS0 --verbose
    opening serial port '/dev/ttyHS0'...
    (ttyHS0) opening serial port...
    (ttyHS0): port attributes not fully set
    (ttyHS0) device open count is 1 (open)
    flashing serial port '/dev/ttyHS0'...
    ready
    > AT+GCAP
    (ttyHS0): --> 'AT+GCAP<LF><CR>'
    (ttyHS0): <-- '<CR><LF>+GCAP: +CGSM,+DS,+ES<CR><LF><CR><LF>OK<CR><LF>'
    +GCAP: +CGSM,+DS,+ES
    > AT+GMI
    (ttyHS0): --> 'AT+GMI<LF><CR>'
    (ttyHS0): <-- '<CR><LF>Option N.V.<CR><LF><CR><LF>OK<CR><LF>'
    Option N.V.
    > ^C

    cancelling the main loop...

    (ttyHS0) device open count is 0 (close)
    (ttyHS0) closing serial port...
    (ttyHS0) serial port closed
    (ttyHS0) forced to close port
2015-02-11 19:58:12 +01:00
Aleksander Morgado 7133d72f69 ports: move serial parsers to the internal libports 2015-02-11 19:39:03 +01:00
Aleksander Morgado b7ed2c6b0e po: added systemd sleep management file to the list of translatable files 2015-02-11 19:38:35 +01:00
Aleksander Morgado 9b2b46e2be broadband-modem-qmi: don't try FCC auth if the first Set Operating Mode succeeds 2015-02-10 18:21:30 +01:00
Aleksander Morgado a83d1c70b1 broadband-modem-qmi: use 'DMS Set FCC Authentication' if online mode fails
Some new devices, like the Dell DW5770, will return an internal error when
trying to bring the power mode to online. We can avoid this by sending the
magic "DMS Set FCC Auth" message before retrying.

Bumping libqmi version to 1.13.4, which is the one that supports this new
message.

https://bugzilla.kernel.org/show_bug.cgi?id=92101
2015-02-07 21:39:15 +01:00
Aleksander Morgado b6f8e5f08d suspend: invalidate and remove modems on suspend, reprobe on resume 2015-02-07 12:57:48 +01:00
Aleksander Morgado 132fbb0a7f suspend: port upower backend to GDBus 2015-02-07 12:57:48 +01:00
Aleksander Morgado a92b6f286b suspend: imported suspend/resume support from NetworkManager
We're going to make this optional during build, not mandatory as was the case
in NM.
2015-02-07 12:57:48 +01:00
Aleksander Morgado c6ba09403a utils: imported singleton setup from NetworkManager 2015-02-07 12:57:48 +01:00
Aleksander Morgado 6fb83b5e02 novatel: remove unused custom AT probe array 2015-02-06 15:38:11 +01:00
Aleksander Morgado 60cd66b4fa helpers: avoid segfault when empty pdp type string is given
https://bugzilla.redhat.com/show_bug.cgi?id=1183250
2015-01-29 21:28:52 +01:00
Aleksander Morgado dc38332224 plugin: avoid segfault when port driver is unknown
Based on a patch from Bastiaan Jacques <bastiaan@bjacques.org>

https://bugzilla.redhat.com/show_bug.cgi?id=1177799
https://bugs.freedesktop.org/show_bug.cgi?id=88864
2015-01-29 12:23:31 +01:00
Dan Williams 086a10ede0 blacklist: ignore PalmOS devices driven by 'visor'
MM probing appears to make 'visor' module die; and anyway
most of the devices driven by 'visor' are not phones, and
of the 3 that are phones they are so old (2002 - 2005 era)
that nobody is likely using them for dialup anymore.

http://www.spinics.net/lists/linux-usb/msg120483.html
2015-01-26 17:05:39 -06:00
Aleksander Morgado f9489a06be mmcli: add command completion 2015-01-25 21:49:01 +01:00
Aleksander Morgado 1e62589cb1 bearer-qmi: even if we request DHCP in the bearer, expose available IPv4 config
Same as we do in IPv6. Note that NM won't use it if DHCP is requested.
2015-01-24 18:05:41 +01:00
Aleksander Morgado 6739227227 nokia: 20s for CSCS=? test command
Nokia N9 via Bluetooth DUN may require up to 20s for the supported charsets
query; so update the timeout in the Nokia plugin.

https://bugs.freedesktop.org/show_bug.cgi?id=87635
https://bugzilla.gnome.org/show_bug.cgi?id=741813
2015-01-16 17:10:32 +01:00
Aleksander Morgado 4a0a10c795 haier: new Haier plugin to handle port type hints in the CE81B
https://bugzilla.gnome.org/show_bug.cgi?id=685011
https://bugs.freedesktop.org/show_bug.cgi?id=85001
2015-01-15 10:28:46 +01:00
Jakub Sitnicki fcfd52df10 core: perform clean-up when terminating due to a Unix signal
Since commit 2d700043ab ("core: use g_unix_signal_add() for more
reliable Unix signal handling") we no longer have to stick to
signal-safe functions in the SIGTERM/SIGINT handler.

Use exit() to terminate so that the clean-up functions are ran and code
coverage data gets written into files.
2015-01-11 19:32:49 +01:00
Jakub Sitnicki 7552030ef9 build: add code coverage support
Build all targets, except for CLI tools (mmcli, uml290), with special
flags needed for collecting code coverage information when the build has
been configured with --enable-code-coverage.

Three new targets are available in the top build directory:

 - `check-code-coverage' runs the test suite and generates a code
   coverage report,

 - `code-coverage-capture' generates a code coverage report from already
   collected data, which can come in handy when one wants to see code
   paths touched by a particular test,

 - `code-coverage-clean' removes the collected coverage data and the
   generated reports.
2015-01-11 19:32:43 +01:00
Jakub Sitnicki ffe2106d4e build: include ax_code_coverage.m4 serial 5
So that we don't require a fairly recent version of
autoconf-archive (v2014.10.15 or newer) to build.
2015-01-11 19:32:38 +01:00
Jakub Sitnicki ebf516c074 build: remove incomplete support for code coverage
Looks like make targets for generating code coverage reports with LCOV
were copied from GLib but corresponding changes to configure.ac were not
made. Clean it up.
2015-01-11 19:32:33 +01:00
Roshan Pius 470b02e8c8 port-probe: Increase AT probe command timeout to 7 seconds for altair.
This patch increases the response timeout for the probe AT commands for
altair modems.

We've been noticing some altair modems taking upto 6 seconds to respond to the
initial probe command after a reset which results in modem-manager
timing out and sending a second probe command. The modem sends a response
after about 6 seconds for the initial probe command which modem-manager
treats as response to second probe command and this results in the
modem-manager and modem going out of sync because the modem's second
probe response is treated as response to the next initialization AT command
sent by modem-manager and so on.

Change-Id: Iad8b0786327b153fd95c8ee4516f352325a42cf7
2015-01-09 21:26:01 +01:00
Aleksander Morgado 2edb00cbcb broadband-modem-qmi: fix memleak when listing SMS
If we get multiple message lists, we need to make sure the previous one is
cleared out before going to the next one.
2015-01-09 12:48:22 +01:00
Aleksander Morgado 46b707f847 mbim: use the new response checker helper method
mbim_message_response_get_result() is available in libmbim-glib 1.11.1.
2014-12-30 12:46:07 +01:00
Aleksander Morgado 35575ccc15 port-qmi: always use QMI proxy
We already require libqmi > 1.7.0 in the build.
2014-12-30 12:43:14 +01:00
Aleksander Morgado 0dd707a279 iface-modem-location: don't print location info to syslog with info level
Use debug level, which has to be explicitly requested by the user.

https://bugs.freedesktop.org/show_bug.cgi?id=87498
2014-12-26 16:36:32 +01:00
Aleksander Morgado 3b2ed15abd port-probe: retry icera probing up to 3 times, with some time in between cmds
Icera-based modems need to return a correct response to the AT%IPSYS? command,
so that they are properly detected as being Icera-based.

Now, some modems, like the Nokia 21M-02, don't seem to return a correct response
to AT%IPSYS just after being plugged in. So, setup a retry mechanism (3 retries,
with 2 seconds between retries) to try to cope with this issue.

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

Logs from the error situation:

[mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'ATE1 E0<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM2): --> 'ATE1 E0<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'ATE1 E0<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- 'E0'
[mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR><CR><LF>ERROR<CR><LF>'
[mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
[mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): Parsing AT got: 'Unknown error'
[mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM0) port is AT-capable
[mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- 'ATE1 E0'
[mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- ' E0'
[mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- '<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><CR><LF>ERROR<CR><LF>'
[mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
[mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): Parsing AT got: 'Unknown error'
[mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM1) port is AT-capable
[mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- '<CR><LF>OK<CR><LF>'
[mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM2) port is AT-capable
[mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'AT%IPSYS?<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT%IPSYS?<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM2): --> 'AT%IPSYS?<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- 'AT%IPSYS?'
[mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR>'
[mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- 'AT%IPSYS?'
[mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><CR><LF>ERROR<CR><LF>'
2014-12-03 23:01:13 +01:00
Aleksander Morgado fd28a4d5cd icera: IPv6 '::' is a placeholder for 'no IPv6', so don't error out if found
Also, allow IPDPADDR returns where only DNS IPv6 is given (i.e. no IPv6 address
to set), and in that case default to DHCP method in the bearer.

https://bugs.freedesktop.org/show_bug.cgi?id=85012
2014-12-03 19:02:00 +01:00
Aleksander Morgado 71a1b64b3b huawei: expect 'modem' and 'pcui' in ^GETPORTMODE responses
Newer huawei modems, like the E3372, use the following ^GETPORTMODE response
format:
  ^GETPORTMODE: TYPE: WCDMA: ,pcui:1,modem:2,ncm:3,mass:4,mass_two:5,

This patch updates the parser that looks for the control TTY (pcui) and data TTY
(modem).

https://bugs.freedesktop.org/show_bug.cgi?id=86658
2014-12-03 19:02:00 +01:00
Tyler b51f701524 bearer: PDP context APN scan should be case insensitive 2014-11-14 12:13:10 +01:00
Aleksander Morgado 692e6d344a tests,port-context: joining thread takes the reference already 2014-11-14 12:13:10 +01:00
Torsten Hilbrich bc410ce03f qmi: retrieve MM_MODEM_3GPP_FACILITY_SIM
This facility cannot be retrieved via 'DMS UIM Get CK Status' and seems
currently unimplemented for mm-broadband-modem-qmi. The SIM enabled
status is however available via 'DMS UIM Get PIN Status'.

Using this message to add the retrieval of PIN status just after the
other facilities were queried.

Succesfully tested with Gobi2000 (05c6:9205), both retrieval of 3gpp
SIM lock status and enabling/disabling the PIN.
2014-11-12 13:13:11 +01:00
Lubomir Rintel d44690489b udev: Don't mark disconnected RFCOMM ttys as candidates
Bluetooth serial devices are weird. They begin life being bound with
RFCOMMCREATEDEV ioctl() and then move around the sysfs tree when they are
connected and disconnected. The connection is estabilished upon the first
open() and torn down upon last close(), their first user virtually being
"owner" of the connection. We don't want to be that process, we're only
interested in actually connected modems. However, currently we have no
knowledge of that and therefore we connect and disconnect multiple times while
probing.

This patch marks unconnected RFCOMM devices as uninteresting to us.
The actual connection and disconnection will be handled by NetworkManager.
2014-11-01 20:07:40 +01:00
Lubomir Rintel f79ec9bf4d manager: Remove devices which are deemed unfit during addition attempt
device_added() might be called in response to a "change" or "move" attempt that
might have changed a candidate device to a non-candidate one.
2014-11-01 20:07:35 +01:00
Lubomir Rintel b8cd5ae838 device: Keep track of devices as they are move across sysfs
For certain devices the name changes with their status. Notably, RFCOMM
devices move from /devices/virtual/ to underneath the HCI that is used
for the connection as the session is estabilished, and return back when
it's torn down.
2014-11-01 20:07:30 +01:00
Aleksander Morgado 98f21ec195 modem-helpers: fix IP4 -> IPV4
Stupid me, introduced a bug when manually writing the previous patch.

:/
2014-10-30 00:08:51 +01:00
Oskar Enoksson 01bd5006f5 modem-helpers: handle "IPV4" pdp type response
My modem (Samsung GI B3740) responded "IPV4" to "CGDCONT=?". This was
not handled in mm-modem-helpers.c. The obvious fix was to return
MM_BEARER_IP_FAMILY_IPV4.
2014-10-29 23:13:22 +01:00
Aleksander Morgado 555ec15a16 mm-broadband-modem-qmi: avoid using NULL pointer coming from an empty GArray 2014-10-29 22:35:52 +01:00
Greg Suarez 3a76c0df57 bearer-mbim: Implement report_connection_status() to set the port as disconnected
When the MBIM modem unexpectedly loses connection the port state never
gets set as disconnected thus when trying to reestablish a new
connection the bearer cannot find a port in the disconnected state.

Signed-off-by: Greg Suarez <gpsuarez2512@gmail.com>
2014-10-29 22:21:18 +01:00
Dan Williams 046d9141c4 blacklist: ignore GW Instek AFG-2225 arbitrary waveform generator 2014-10-28 11:46:51 -05:00
Aleksander Morgado a72b120798 tests,fixture: fix comment 2014-10-17 15:55:12 +02:00
Aleksander Morgado f2fa7a7fbf qcdm: don't retry probing if QCDM unescaping fails
But keep the retries when the frame marker isn't found.

https://bugzilla.gnome.org/show_bug.cgi?id=708861
2014-10-15 18:29:18 +02:00
Dan Williams 41b7e7b048 port-serial: fix forced closing after b28230411
b28230411 moved up the self->priv->forced_close = TRUE, which
caused mm_port_serial_close() to just return without actually
closing the port and cleaning up.

Also, cancel the reopen separately from closing the port since
the two operations are actually independent of each other.
2014-10-07 16:01:54 -05:00
Ben Chan 1e5ec7e1b1 tests: increase timeout for starting ModemManager on test bus
The timeout for starting ModemManager on the test bus was 3s, which is
sufficient under normal conditions. However, when running ModemManager
tests on a build infrastructure under a heavy load, we've observed that
the timeout isn't always sufficient and that becomes the source of false
test failures. This patch increases the timeout to 30s, which shouldn't
introduce any unexpected behavior under normnal conditions while
addressing the timeout issue on heavily loaded systems.
2014-10-05 15:37:47 -05:00
Aleksander Morgado 8718ed53be build: remove --with-newest-qmi-commands configure option
We don't want people to use the logic enabled by this switch, so remove it from
configure to avoid confusions. Developers can still enable the related code by
defining WITH_NEWEST_QMI_COMMANDS via CFLAGS; e.g.:

 $ NOCONFIGURE=1 ./autogen.sh
 $ ./configure CFLAGS="-DWITH_NEWEST_QMI_COMMANDS"
2014-09-15 11:00:57 +02:00
David McCullough 340ff7dce3 broadband-modem-qmi: fix registration state when built with --with-newest-qmi-commands
This patch fixes the registration reporting/checking when ModemManager is
built with --with-newest-qmi-commands.  apply_cs and apply_ps were not
properly initialised and may never be true. Also fixes a CnP error for
mm_ps_registration_state.

Signed-off-by: David McCullough <david.mccullough@accelecon.com>
2014-09-11 11:01:40 +02:00
David McCullough 84db939565 broadband-modem-qmi: fix signal strength when built with --with-newest-qmi-commands
This patch fixes the signal strength values when using ModemManager built
with --with-newest-qmi-commands.

It was never getting a valid signal strength because the default (0) is
always greater than a valid signal strength, and the rssi_max handling
was completely wrong.

Signed-off-by: David McCullough <david.mccullough@accelecon.com>
2014-09-11 11:01:20 +02:00
Aleksander Morgado fd7d0a08f7 broadband-modem-qmi: implement A-GPS enabling/disabling 2014-09-05 12:11:18 +02:00