Commit Graph

7059 Commits

Author SHA1 Message Date
Dan Williams
a9b69d210d huawei: use AT^DHCP response if available for NDISDUP-capable devices
For non-QMI/non-MBIM Huawei devices that use HiSense chipsets,
the recommended way to create the connection is to use NDISDUP
and either DHCP on the net interface, or the ^DHCP command.
There are some reports of devices that connect successfully, but
don't respond to DHCP requests on the interface.  Try to get
IP addressing info from the device via ^DHCP and fall back to
telling clients to use actual DHCP if that fails.

https://bugzilla.redhat.com/show_bug.cgi?id=1254886
2016-03-13 13:25:19 +01:00
Aleksander Morgado
91d343520f huawei: ignore ^LTERSRP unsolicited message
Based on a previous patch from Dan Williams <dcbw@redhat.com>
2016-03-13 13:21:05 +01:00
Aleksander Morgado
1939c5ace5 port-probe: simplify task completion
We no longer need to complete in idle, because the limitation imposed by the
serial port methods no longer exists.
2016-03-11 15:03:07 +01:00
Aleksander Morgado
d9596587e2 port-serial: allow completions not in idle
Port serial command completions may be performed in several different places:
  * When a cached response is set during command sending.
  * When errors happen during command sending.
  * When we process a response (i.e. common_input_available())
  * When we process a timeout (i.e. port_serial_timed_out())
  * When cancelled (i.e. port_serial_response_wait_cancelled())

We're currently safe with the previous logic only because the users of the
serial port explicitly complete operations in idle, which means that whenever
we're processing in a internal callback (e.g. during response or timeout
processing) the serial port object is valid for as long as the callback runs.

But, if we ever end up using the serial port with a not-in-idle completion,
it may happen that if the command is completed within a internal signal callback
the serial port object may get fully closed and unref-ed before exiting the
callback.

We could force a valid port reference to exist as long as the internal signal
is scheduled, but then we may lose the ability to automatically close the port
during a full unref(), as the internal signals are set as long as the port is
open.

So, to cope with this possibility of not-in-idle completion, we instead force
references to be valid whenever we see that a command completion may happen,
which is basically whenever port_serial_got_response() is called; but we only
do that if we're going to use the port object after that, otherwise, we ignore
the problem.

In addition to the problems with the references, we also update the
common_input_available() method so that the source isn't kept if the last
response buffer processing ended up closing the port.
2016-03-11 15:03:03 +01:00
Carlo Lobrano
1322201a43 telit: implemented set current bands 2016-03-10 16:10:18 +01:00
Aleksander Morgado
93056fe3f2 plugin-manager: allow early cancel of port tasks when they haven't been run yet 2016-03-09 23:59:46 +01:00
Aleksander Morgado
c605b0bc46 port-probe: allow cancellation 2016-03-09 23:59:46 +01:00
Aleksander Morgado
d3bf07e7a8 plugin: allow cancellation of the port probe operation 2016-03-09 23:59:46 +01:00
Aleksander Morgado
fd4fdbf21b plugin-manager: refactor device/port support checks and allow cancellations 2016-03-09 23:59:46 +01:00
Aleksander Morgado
be9b5e0141 plugin-manager: improve logging when loading plugins 2016-03-09 23:59:46 +01:00
Carlo Lobrano
be317e8b80 broadband-modem: fix +CPMS empty parameter support
* Add new async virtual method init_current_storages to
  MMIfaceModemMessaging
* Add logic of init_current_storages to MMBroadbandModem
* Add step "INIT_CURRENT_STORAGES" in MMIfaceModemMessaging
  initialization in order to load and store current SMS
  storages for mem1 and mem2.
* Add usage of current sms storage value for mem1 in place
  of an empty string parameter when the command AT+CPMS
  is used.

https://bugs.freedesktop.org/show_bug.cgi?id=93135
2016-03-09 14:43:08 +01:00
Aleksander Morgado
7c2d5b1aa3 helpers: fix check for pid when creating device identifier
https://bugs.freedesktop.org/show_bug.cgi?id=94364
2016-03-02 17:09:33 +01:00
Daniele Palmas
c8a26e472e telit: add current modes setting
This patch adds current modes setting in Telit plugin
2016-02-24 11:22:14 +01:00
Michael Farrell
6e7ff47109 proxmark3 is not a modem, blacklist it.
ModemManager locks the proxmark3 when it is connected. As it is not a modem,
ModemManager shouldn't be talking to it.

At present, the recommended action in the proxmark3 documentation is to
purge ModemManager to fix this issue.

Note that this vendor uses an unregistered USB device ID, so it is
instead matched by the manufacturer string.

References:
- http://store.ryscc.com/blogs/news/45802433
- http://www.proxmark.org/forum/viewtopic.php?id=1759
2016-02-20 16:30:01 +01:00
Aleksander Morgado
7652486433 build: ignore telit unit test 2016-02-20 16:26:19 +01:00
Carlo Lobrano
beeabdea2f telit: add load_current_bands interface 2016-02-15 14:22:48 +01:00
Michael Biebl
c533e56e1e tests: white space / indentation fixes
Fixes problems with GCC 6

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811583
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94149
2016-02-15 14:16:25 +01:00
Aleksander Morgado
a08708c10d huawei: avoid trying to disable parent voice unsolicited events
Which actually segfaults, as MMBroadbandModem doesn't implement the
disable_unsolicited_events() method in the voice interface.
2016-02-15 13:38:54 +01:00
Aleksander Morgado
5d8b26eeeb huawei: ignore ^ECCLIST unsolicited messages
These messages list the emergency numbers reported by the network, we don't use
them yet.

E.g.:

  ^ECCLIST: 112,911\r\n
2016-02-15 13:25:42 +01:00
Thomas Sailer
eeb23637bd thuraya: filter by vendor ID instead of vendor string
Probe the Thuraya XT modem by USB vendor ID; there are no RS232 versions
to my knowledge.

One of my computers exhibiting the probing issue (VID/PID of the PCI
host controller instead of the USB device) fixed itself after a reboot.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-13 18:03:28 +01:00
Aleksander Morgado
cffba7e0ee modem-helpers: regex creation should never fail
We should really consider errors if we expect that the regex string may not
compile; but in this case the pattern is fixed, so should never happen.
2016-02-13 14:33:12 +01:00
Thomas Sailer
95876c6f57 helpers: move +CRSM parsing to mm_3gpp_parse_crsm_response
Also added test cases.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-13 14:27:51 +01:00
Thomas Sailer
a33615d6cb helpers: allow optional quotes in +CREG: <stat>,"<lac>","<ci>"
GSM 07.07 CREG=2 unsolicited pattern.

Added testcase for Thuraya XT.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-13 14:24:54 +01:00
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