Commit Graph

4836 Commits

Author SHA1 Message Date
Dan Williams
9cb0b22f91 broadband-modem-qmi: fix compile errors with newest QMI commands enabled 2016-02-11 11:09:54 -06:00
Dan Williams
232d4d4aae broadband-bearer: don't send disconnect CGACT on data port for multi-port modems
A Huawei E173 (with FW 11.126.15.00.445) seems to stop responding on the
primary port (ttyUSB2) when the CGACT is resent on the data port (ttyUSB0).
The CGACT-on-data-port was originally added as a fallback attempt to get
single-port modems to disconnect when all other methods failed.

For single-port modems, the primary port is also the data port so this
patch will have no effect.

For multi-port modems, this patch will retry the CGACT on the primary
port which has a higher chance of success because we already know
the primary port is talking to us, while the data port may still
be stuck in PPP mode.
2016-02-11 10:46:17 -06:00
Thomas Sailer
504f422ddd thuraya: add plugin for the Thuraya XT satellite phone modem
Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-11 15:40:45 +01:00
Thomas Sailer
4442173dcf modem-helpers: allow optional whitespace in +CGDCONT response
Add testcase for Thuraya XT.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-11 15:34:25 +01:00
Aleksander Morgado
18c8dd60a7 qmi: just one InvalidCommand error is enough to avoid all DMS UIM commands
The MMBroadbandModemQmi will not create a MMSimQmi until the unlock status has
been checked, and therefore this means that when the SIM object is being created
we already know whether the modem supports DMS UIM commands or not, so avoid
further fallbacks in the SIM object.
2016-02-11 10:52:09 +01:00
Aleksander Morgado
9cbd0c61b0 sim-qmi: implement SIM verify/unblock/change/enable with UIM service
Newer modems like the MC7455 don't implement the "DMS UIM" commands in the
DMS service, and therefore these modems need to use the UIM service directly.

We include a new flag to detect whether any of the DMS UIM commands is flagged
as invalid, and if so, we'll fallback to the UIM specific implementations for
all.

libqmi version bump to 1.13.7, which includes the new required methods.
2016-02-11 10:51:53 +01:00
Aleksander Morgado
7ded4f3c3b broadband-modem-qmi: implement unlock retries loading with UIM service
Newer modems like the MC7455 don't implement the "DMS UIM" commands in the
DMS service, and therefore these modems need to use the UIM service directly.
2016-02-11 10:51:43 +01:00
Tomas Jura
6a675536d6 serial: remove duplicated ECHO & ECHOE 2016-02-11 10:32:22 +01:00
Tomas Jura
0ccbd5d85d mbm: stop echos on gps port 2016-02-11 10:05:33 +01:00
Daniele Palmas
7f173dfd15 plugin: telit: add current mode loading
This patch adds current mode loading in Telit plugin
2016-02-04 11:11:42 -06:00
Daniele Palmas
85e6c5b915 plugin: telit: add supported modes loading
This patch add supported modes loading in Telit plugin.
2016-02-04 11:11:42 -06:00
Aleksander Morgado
aeb6362172 sim-qmi: port to GTask 2016-01-30 18:38:05 -08:00
Aleksander Morgado
b23dace6dd broadband-modem-qmi: plug memleak when listing SMS messages 2016-01-30 16:29:29 -08:00
Aleksander Morgado
8c905383b7 broadband-modem-qmi: locked states also indicate readiness of the SIM card
When the card application is flagged as needing PIN or PUK, then the card can be
considered as being ready.
2016-01-30 16:29:29 -08:00
Aleksander Morgado
3911ea5a0f telit: minor coding style fixes 2016-01-25 13:58:57 +01:00
Carlo Lobrano
70b8ec1a88 telit: add load_supported_bands interface 2016-01-25 12:37:46 +01:00
Carlo Lobrano
81019ca5b5 telit: add udev rule for Telit LE910 V2 modem 2016-01-25 10:16:09 +01:00
Aleksander Morgado
83868c61b1 broadband-modem-qmi: use "UIM Get Card Status" if "DMS UIM" command unavailable
The newer modules like the MC7455 which support multiple SIM cards won't
implement the legacy "DMS UIM" commands.
2016-01-24 17:23:46 +01:00
Aleksander Morgado
cf66d1bcbf bearer-qmi: use static IP if LLP is raw-ip
When using raw-ip we'll default to request static IP setup for now, so that we
don't rely on the DHCP client supporting raw-ip interfaces.
2016-01-24 17:23:46 +01:00
Aleksander Morgado
f8ba106a20 port-qmi: support new Qualcomm chipsets working always in raw-ip
The port opening logic is changed completely.

Before this change, the logic would only try 802.3 setting via CTL when the
QmiDevice was being open.

With this new change, instead, we'll use WDA and the new libqmi APIs to query
the link layer protocol expected by both the device and the kernel. If the LLP
matches in both, we assume we're done; if they differ we'll try to update the
LLP expected by the kernel to the one setup in WDA. This change will allow us
to run with the modem using raw-ip if that is what WDA reports by default.

Also bumped the libqmi version to 1.13.6, which has support for the new required
APIs.
2016-01-24 17:23:18 +01:00
Aleksander Morgado
1bdb1a558a build: require GLib 2.36
We now need it for GTask support.
2016-01-24 15:26:12 +01:00
Aleksander Morgado
97962bb65c port-serial: rework response parsing
Response parsing was being done in different places for AT and QCDM subclasses;
in the case of AT it was being done early, before returning the byte array in
the mm_serial_port_command_finish() response. In the case of QCDM, it was being
done after mm_serial_port_command_finish(), and that was forcing every caller to
cleanup the response buffer once the response was processed.

With the new logic in this patch, the response is always parsed (i.e. looked for
a valid response or an error detected) before mm_serial_port_command_finish()
returns, and actually this method now returns a totally different GByteArray,
not the internal response buffer GByteArray, so there's no longer any need for
the caller to explicitly clean it up. The one doing the cleanup is the parser
method itself in every case.

This change also allows us to return serial port responses in idle, but that's
not changed for now as there's no immediate need.
2016-01-23 11:19:19 +01:00
Aleksander Morgado
ede17bd41c port-serial: remove response buffer when an error is returned
When valid responses were returned to the caller of the serial command, the
caller itself was responsible for removing from the GByteArray the data that
it was successfully processed (all the data in AT, just 1 message in QCDM). But,
the same logic was missing for the case of errors; we were not explicitly
removing the response and therefore in some cases we would see it propagated
into the next command response. It was common to see this issue when the echo
removal was disabled in the serial port, as in Option/HSO modems:

    <debug> (ttyHS3): --> 'AT+CNUM<CR>'
    <debug> (ttyHS3): <-- '<CR><LF>+CME ERROR: 14<CR><LF>'
    <debug> Got failure code 14: SIM busy
    <debug> (ttyHS3) device open count is 1 (close)
    <warn>  couldn't load list of Own Numbers: 'Failed to parse NV MDN command result: -17'
    <debug> (ttyHS3) device open count is 2 (open)
    <debug> (ttyHS3): --> 'AT_OPSYS?<CR>'
    <debug> (ttyHS3): <-- '<CR><LF>_OPSYS: 1,2<CR><LF><CR><LF>OK<CR><LF>'
    <warn>  couldn't load current allowed/preferred modes: 'Couldn't parse OPSYS response: '+CME ERROR: 14
    _OPSYS: 1,2''
2016-01-23 11:05:42 +01:00
Dan Williams
0512a820cd libmm-glib: make C++ happy by not using 'class' 2016-01-20 17:06:33 -06:00
Dan Williams
98c58ca64b bearer-qmi: print IP details at 'info' log level 2016-01-19 17:19:22 -06:00
Aleksander Morgado
3b97d7e3d7 broadband-modem: plug memleaks when processing QCDM responses 2016-01-17 15:34:17 +01:00
Aleksander Morgado
884d7bee1b broadband-modem,time: make sure that error is set when operation fails 2016-01-16 17:59:49 +01:00
Aleksander Morgado
6d45976942 tests,generic: rename basic DBus test 2016-01-16 17:59:49 +01:00
Aleksander Morgado
7136c0b321 tests,port-context: explicitly close the socket that is added to the listener
Since GLib 2.42, the sockets that are added to socket listeners may no longer
be closed automatically when the listener is finalized. In order to avoid that,
we will keep our own socket reference and close/unref it ourselves.

This issue was preventing adding new test cases with the same port names.

    $ ./test-service-generic --verbose
    GTest: random seed: R02S889153ee0f2e59c570f4edff9caa4176
    GTest: run: /MM/Service/Generic/enable-disable
    Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    (MSG: DEBUG: client connection closed)
    (MSG: MESSAGE: Found modem at '/org/freedesktop/ModemManager1/Modem/0')
    ** Message: Found modem at '/org/freedesktop/ModemManager1/Modem/0'
    (MSG: DEBUG: client connection closed)
    GTest: result: OK
    GTest: run: /MM/Service/Generic/cme-error-detected
    Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    (MSG: FATAL-ERROR: Cannot bind socket: Error binding to address: Address already in use)

    ** (/home/aleksander/Development/foss/ModemManager/plugins/.libs/lt-test-service-generic:32043): ERROR **: Cannot bind socket: Error binding to address: Address already in use
2016-01-16 17:59:49 +01:00
Aleksander Morgado
dfd111f291 tests,test-fixture: don't rely on other threads to update dbus properties
We were wrongly using a main loop in the port context thread to manage the
global main context. That was silently making the DBus property notifications
kind of work, as they were being updated via another thread, so here we could
just sleep() and recheck the property values.

Given that having that unrelated thread updating the dbus properties of our
MMManager object is not a good thing, we'll instead totally ignore that and
fully re-create the MMManager in each iteration with the sync() method, which
has its own internal thread.
2016-01-16 17:59:49 +01:00
Aleksander Morgado
87bafa33dc tests,port-context: properly setup per-thread main context
Instead of creating a new main context to be used in the thread, we were using
the global context. So, fix that, and create a totally new pair of main context
and main loop to be used within the thread.
2016-01-16 17:59:49 +01:00
Dan Williams
99ae677789 libqcdm: fix mixed whitespace in test-qcdm.c 2016-01-13 15:31:59 -06:00
Aleksander Morgado
6a60090d68 broadband-modem,voice: fix regex leak 2016-01-12 16:37:28 +01:00
Aleksander Morgado
0ebf6d5da5 mbm: query supported modes to the modem with +CFUN=?
We were trying to load the generic modes supported reported by either *CNTI=2 or
AT+WS46=?, so that then we could filter out the MBM-specific modes unsupported.

But, this may not be ideal, as both these two commands may fail:

    [mm-broadband-modem.c:1612] modem_load_supported_modes(): loading supported modes...
    [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open)
    [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close)
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT*CNTI=2<CR>'
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>'
    [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
    [mm-broadband-modem.c:1546] supported_modes_cnti_ready(): Generic query of supported 3GPP networks with *CNTI failed: 'Unknown error'
    [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open)
    [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close)
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT+WS46=?<CR>'
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>'
    [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
    [mm-broadband-modem.c:1494] supported_modes_ws46_test_ready(): Generic query of supported 3GPP networks with WS46=? failed: 'Unknown error'
    [mm-iface-modem.c:3974] load_supported_modes_ready(): couldn't load Supported Modes: 'Couldn't retrieve supported modes'

Instead, we'll ask the modem for the list of modes supported, and return that
directly.
2016-01-10 17:46:12 +01:00
Aleksander Morgado
138b3dabc2 cli: validate SUPL server before showing it 2015-12-19 14:09:03 +01:00
Aleksander Morgado
9123c7bd93 cli: allow enabling/disabling location signaling via DBus
Not making them '--location-enable|disable-signal' because that's the pattern
used to enable/disable location sources. Instead, use the '--location-set-*'
pattern, as that is what we're already using for the other location setup
update.
2015-12-19 14:07:45 +01:00
Aleksander Morgado
6c35878f12 location: support updating the GPS refresh time
The default setup uses a refresh time of 30s, which means that even if the GPS
location updates are received at a higher frequency, the DBus interface will
still expose at most one update every 30s.

This patch includes a new "SetGpsRefreshTime()" method in the Location
interface, which takes a single 'u' parameter, specifying the refresh rate to
use, in seconds. This method also allows 0 being passed, which will make the
implementation to publish the GPS location updates are soon as ModemManager
detects them.

Along with the new method, a "GpsRefreshTime" read-only property is exposed
to specify the refresh time in effect.

The new method and property will only be applicable if the device has GPS
capabilities.

https://bugs.freedesktop.org/show_bug.cgi?id=89924
2015-12-19 12:22:30 +01:00
Aleksander Morgado
aae96778c5 build: don't redefine test_modem_helpers_telit_LDADD 2015-12-19 11:56:07 +01:00
Aleksander Morgado
0a88ae2d6d telit: use explicit FIRST step name 2015-12-19 11:51:11 +01:00
Aleksander Morgado
46f601edf6 telit: don't talk to the user in a GError 2015-12-19 11:50:22 +01:00
Aleksander Morgado
a74edab57f telit: prefix helper methods with 'mm_telit' 2015-12-19 11:45:32 +01:00
Aleksander Morgado
740e1b5461 telit: fix minor coding style issues 2015-12-19 11:44:00 +01:00
Carlo Lobrano
c4ffe572ae telit: add load_unlock_retries interface 2015-12-19 11:39:48 +01:00
Carlo Lobrano
7978225934 telit: add modem_reset to telit plugin 2015-12-11 09:09:57 +01:00
Aleksander Morgado
ae04c4179f bearer-mbim: implement stats loading 2015-12-07 14:20:54 +01:00
Aleksander Morgado
cb59c6d93e bearer-qmi: implement stats loading
Use the "WDS Get Packet Statistics" method to query for the ongoing number
of bytes transmitted or received. The QMI implementation uses different WDS
clients for IPv4 and IPv6; the stats reported are a combination of the values
retrieved from both WDS clients.
2015-12-07 14:20:54 +01:00
Aleksander Morgado
3bf118d01a base-bearer: setup periodic stats loading
If the bearer implementation supports it, load stats periodically. By default
every 30s for now.
2015-12-07 14:20:54 +01:00
Aleksander Morgado
810e52c6db cli: print stats if bearer reports them 2015-12-07 14:20:54 +01:00
Aleksander Morgado
730123598a libmm-glib: retrieve stats from the bearer
The MMBearer object is updated to provide getter methods to retrieve the new
MMBearerStats object.
2015-12-07 14:20:54 +01:00
Aleksander Morgado
27c6f15873 libmm-glib: new helper object to handle bearer stats
The new MMBearerStats object provides a simple API to interact with the new
dictionary containing the bearer connection stats.
2015-12-07 14:20:54 +01:00