Commit Graph
2519 Commits
Author SHA1 Message Date
Aleksander Morgado 1a213e3b62 udev: remove ENV{DEVTYPE}!="usb_device" rules
They're actually a subcase of SUBSYSTEM!="usb", which we apply just before.
2016-08-06 10:41:52 +02:00
Dan Williams f33ea91ccf base-call: formatting cleanups 2016-08-02 16:27:56 -05:00
Dan Williams 5350b9f568 broadband-modem/libqcdm: add signal strength from QCDM EVDO Pilot Sets log messages
When a CDMA-only modem is registered with the EVDO network, its not possible to
read signal strength in the following cases:

1) while a data connection is active on single-AT-port modems, because the AT
port is used for PPP and not available for AT+CSQ, AT+CIND or vendor-specific
signal strength commands

2) when the modem reports only CDMA 1x signal strength with AT+CSQ

Now that we have a reasonable interpretation of RSSI from the QCDM
EVDO Pilot Sets V2 log messgae, use that when other means of getting
signal strength aren't available.
2016-07-27 10:44:43 -05:00
Lubomir Rintel 30f60de7d3 blacklist: include some more Arduinos
All "2a03  dog hunter AG" devices seem to be Arduinos.

https://bugzilla.redhat.com/show_bug.cgi?id=1261040
2016-07-27 09:33:22 +02:00
Carlo Lobrano 43d97a4623 iface-modem: inverted steps in update_lock_info_context_step
Inverted steps UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES and
UPDATE_LOCK_INFO_CONTEXT_STEP_AFTER_UNLOCK.

Soon after the unlock, the SIM can be busy and
loading unlock retries might fail.

When implemented, let run "after unlock" logic before any other step in
update lock info, when SIM is not locked this change does not have any
effect since "after unlock" is not executed.
2016-07-26 14:07:37 +02:00
Aleksander Morgado 7b4bd888f0 build: updated copyright years up to 2016 2016-07-26 13:07:49 +02:00
Aleksander Morgado f137268ce1 iface-modem: fix checking for single capabilities
The mm_iface_modem_is_*_only() checks were validating that all the other
capabilities except for the ones being queried were unset, but the check wasn't
explicitly checking that the actual capabilities being queried were set.

This was making the check fail when capabilities == MM_MODEM_CAPABILITY_NONE.

Reported-by: Matthew Stanger <stangerm2@gmail.com>
2016-07-20 08:02:49 +02:00
Aleksander Morgado ddbc219568 bearer-qmi: decide IP method during connection attempt
Deciding the IP method to use based on the underlying QMI port LLP should not be
done when the bearer object is created, because the QMI port in use may not
actually be open or have been opened at that time. During the connection attempt
we do make sure the QMI port is open, so we should check the LLP to use just
after that step.
2016-07-15 19:31:45 +02:00
Aleksander Morgado 46b17908ce broadband-modem-qmi: fix dhcp/static IP setting when kernel data format updated
When the logic decided that we had to update the kernel data format to match the
one configured in the WWAN network interface, we were not flagging the port LLP
with the correct value, what resulted in NetworkManager trying to use dhclient
on the raw-ip interface:

    dhclient[3257]: Unsupported device type 65534 for "wwan1"
    dhclient[3257]:
    dhclient[3257]: If you think you have received this message due to a bug rather
    dhclient[3257]: than a configuration issue please read the section on submitting
    dhclient[3257]: bugs on either our web page at www.isc.org or in the README file
    dhclient[3257]: before submitting a bug.  These pages explain the proper
    dhclient[3257]: process and the information we find helpful for debugging..
    dhclient[3257]:
    dhclient[3257]: exiting.

Fix the internal LLP flag, so that Static IP addressing is requested for all raw-ip
based interfaces.
2016-07-14 14:59:28 +02:00
Dan Williams 48f0210739 bearer-mbim: use the context IP type MM asked to be activated instead of modem response
MM never passes MBIM_CONTEXT_IP_TYPE_DEFAULT which would require paying
attention to the ip_type in the reply to figure out what type the modem
activated.  Instead, MM always specifies the ip_type it wants to activate,
and some modems (K5160) return a different type in the response.  The modem
is required to activate the type MM asks for or return an error, so if
the activation was successful we can safely assume the modem activated
the ip_type we want, and we can ignore the ip_type in the response.
2016-07-11 11:02:53 -05:00
Aleksander Morgado f5cd7476f4 broadband-modem-mbim: try to use FCC Auth through QMI-over-MBIM if power up fails 2016-07-07 19:51:28 +02:00
Dan Williams 8080be8209 broadband-bearer-mbim: log context IP type when connecting 2016-06-15 14:16:52 -05:00
Dan Williams 182cf1fa89 iface-modem-firmware: clarify log message about unsupported firmware interface 2016-06-01 12:12:47 -05:00
Dan Williams f232afffe9 broadband-modem: document why firmware/OMA interfaces are left enabled in FAILURE state 2016-06-01 11:34:13 -05:00
Ting-Yuan Huang 969189d42c plugin-manager: protect mm_plugin_{major,minor}_version
This patch makes declarations bind to definitions within the same module
to prevent the potential ambiguity if referenced directly.

AddressSanitizer think they violated one definition rule, although
those symbols are accessed by address through their modules and do
not depend on the order of the libararies loaded.
2016-05-28 13:59:54 +02: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
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 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
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
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
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 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
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 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
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
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 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 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