Commit Graph

5661 Commits

Author SHA1 Message Date
Ben Chan
4a5a0197b5 port-mbim: increase timeout of device open operation
A MBIM device typically delays its response to an 'Open' command when it
has not completed the initialization process. This patch increases the
timeout of the MBIM device open operation from 10s to 30s to handle
situations where the device takes much longer to initialize.
2014-03-04 19:27:19 +01:00
Aleksander Morgado
f3ded99af1 cinterion: implement unlock retries loading 2014-03-03 16:33:51 +01:00
Aleksander Morgado
191168e3ef cinterion: after SIM unlock, query SIM status until ready 2014-03-03 14:33:12 +01:00
Ben Chan
f20724ec3f iface-modem: allow setting power state to OFF when modem is in FAILED state 2014-03-03 11:18:23 +01:00
Aleksander Morgado
17bf3f8578 cinterion: request to force refresh access tech after current bands update 2014-02-28 16:38:05 +01:00
Aleksander Morgado
019d038c17 cinterion: force band preference update to be applied immediately 2014-02-28 16:37:49 +01:00
Aleksander Morgado
f2024b78b2 cinterion: consolidate setting current bands in 2G and 3G devices 2014-02-28 16:37:32 +01:00
Aleksander Morgado
c1e2a3a5bc cinterion: consolidate current bands loading for 2G and 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
0877f68a84 cinterion: consolidate supported bands loading for 2G and 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
65eda92ceb broadband-modem: allow querying current charset
So that plugins can use it.
2014-02-28 16:35:18 +01:00
Aleksander Morgado
87d867c8ae cinterion: add helper to build Cinterion band mask 2014-02-28 16:35:18 +01:00
Aleksander Morgado
e6430acaaa cinterion: add helper to parse AT^SCFG="Radio/Band" response in 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
82067915d1 cinterion: use AT^SCFG=? to parse supported bands in 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
e6cfa57c60 cinterion: request access tech update after allowed mode change 2014-02-28 16:35:18 +01:00
Aleksander Morgado
8a47dce5fb iface-modem-3gpp: request access tech update after registration attempt 2014-02-28 16:35:18 +01:00
Aleksander Morgado
73dad3d899 iface-modem: allow requesting the refresh of the access tech
For periodic updates, we may want to request an explicit re-check at some point,
instead of waiting for the next scheduled update.
2014-02-28 16:35:18 +01:00
Aleksander Morgado
82340cd5f7 cinterion: add support for HSUPA+HSDPA reported access tech 2014-02-28 16:35:17 +01:00
Aleksander Morgado
a9a4a2a337 cinterion: allow recovering automatic mode
When automatic mode (i.e. 2G+3G+none preferred) is selected, we need to
explicitly request it by giving the AT+COPS write command with values (i.e. not
just empty fields).
2014-02-28 16:35:17 +01:00
Aleksander Morgado
177f15f295 cinterion: cache operator id if manual selection attempted
We'll need it afterwards for proper mode switching
2014-02-28 16:34:59 +01:00
Aleksander Morgado
914caf0f3b cinterion: unsupported modes are already filtered out
So no need to try to handle error cases or fallbacks to support them.
2014-02-28 16:34:59 +01:00
Aleksander Morgado
ece4f0f014 cinterion: increase AT command timeout when changing modes 2014-02-28 16:34:59 +01:00
Dan Williams
e3bebc85c4 libmm-glib: deep-copy ports array in ensure_internal_ports() (bgo #724900)
ensure_internal_ports() didn't deep-copy the ports array, which
meant that anything calling mm_modem_port_info_array_free() was
freeing the internal memory owned by MMModem if it retrieved
the array with mm_modem_get_ports().

https://bugzilla.gnome.org/show_bug.cgi?id=724900
2014-02-27 13:06:04 -06:00
Ben Chan
5d88c2ff8f broadband-modem-mbim: handle if unlock retries info is not available
By setting the 'RemainingAttempts' field of a MBIM_CID_PIN response to
0xffffffff, a MBIM modem indicates that it does not support the
information on the number of remaining attempts for pin-related
operations. This patch modifies MMBroadbandModemMbim to handle this case
properly, instead of reporting a very large unlock retries count.
2014-02-27 09:38:37 +01:00
Aleksander Morgado
accb611e1f base-modem: if no AT primary given, try to use data port
The Cinterion PHS8 reports a single AT port to be used as data port, and no
other port as primary. In this case, recover the tty as primary AT port, instead
of failing with an error.
2014-02-26 11:52:50 +01:00
Aleksander Morgado
e3c4dec3d7 wavecom: implement power off
Powering off Wavecom devices is done via the AT^CPOF=1 command. These devices
seem to not only power-off, but also power-cycle when this command is received,
which means that the user needs to make sure to fully cut the power to the
device when the SetPowerState() method replies.
2014-02-20 11:18:22 +01:00
Aleksander Morgado
f9b9f25cd1 cinterion: implement power off
Powering off Cinterion modems is done with the AT^SMSO command. Once this
command is sent to the device, ModemManager still needs to wait to get an
unsolicited ^SHUTDOWN message from the modem, which is when the shutdown
is considered complete.

Newer Cinterion devices, though, don't seem to follow this rule and just
reply OK to AT^SMSO (i.e. no ^SHUTDOWN), but instead, they will remove the
tty ports.
2014-02-20 11:15:32 +01:00
Aleksander Morgado
00a924617c broadband-modem-qmi: implement full power off
The power off command will transition the device to the OFFLINE state. After
this, the modem will not be able to go online again unless it is power-cycled,
either externally (cut power and re-establish power) or through another
transition to QMI_DMES_OPERATING_MODE_RESET (which ModemManager will not
implement for this case).
2014-02-20 11:15:03 +01:00
Aleksander Morgado
fe9f3a6553 cli: new '--set-power-state-off' command 2014-02-20 11:15:03 +01:00
Aleksander Morgado
9239fbcd7a iface-modem: allow transitioning to the OFF power state
There are systems in which the modem power source can be controlled externally,
e.g. to switch it on or off. In these cases, it is sometimes advisable to be
able to tell the modem to cleanly shut off completely before the power is cut.
So, allow transitioning to the OFF power state if the modem supports it, even if
afterwards the modem could be completely unreachable.
2014-02-20 11:15:03 +01:00
Ben Chan
705dd0133d broadband-modem-mbim: handle network initiated disconnect
Observing registration updates via the MBIM_CID_REGISTER_STATE
notification alone is not always sufficient to detect if the modem is
disconnected from the network. In case of a network-initiated
disconnect, it is possible that the modem is disconnected from the
network but remains registered.

This patch modifies MMBroadbandModemMbim to subscribe to the
MBIM_CID_CONNECT notification. Upon receiving a notification of a
deactivated session ID, the corresponding bearer is reported as
disconnected.
2014-02-20 10:27:03 +01:00
Ben Chan
1866aad9d3 bearer: remove unnecessary MM_BEARER() casts 2014-02-20 10:23:36 +01:00
Dan Williams
acc7b4b8b9 Revert "broadband-modem-mbim: update to use mbim_message_device_service_subscribe_list"
This reverts commit 8327db70b9.

libmbim change not committed yet...
2014-02-19 18:59:24 -06:00
Ben Chan
8327db70b9 broadband-modem-mbim: update to use mbim_message_device_service_subscribe_list
libmbim renames 'MBIM_CID_DEVICE_SERVICE_SUBSCRIBER_LIST' to
'MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST' to be consistent with the MBIM
specification. This patch updates MMBroadbandModemMbim accordingly.
2014-02-19 18:52:17 -06:00
Ben Chan
1bd939d4b8 huawei: fix a debug message
This patch simply fixes the following debug message:

from:
  <debug> (Huawei) couldn't turn off unsolicited messages insecondary ports: 'Unknown error'

to:
  <debug> (Huawei) couldn't turn off unsolicited messages in secondary ports: 'Unknown error'
2014-02-19 18:49:30 -06:00
Dan Williams
9e1472d5ec trivial: fix dist of gsm-port.conf 2014-02-17 12:34:05 -06:00
Ben Chan
759f13f693 cli: align printout of bearer IPv6 configuration properties 2014-02-15 18:10:59 +01:00
Ben Chan
ccbd5a2e2d port-serial: fix gsize/gssize type mismatch
This patch fixes the following type mismatch in MMPortSerial::port_serial_process_command():

mm-port-serial.c:612:21: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
        if (written < 0) {
            ~~~~~~~ ^ ~
2014-02-14 09:03:13 +01:00
Ben Chan
d278f381d2 tests: fix array bound checks in process_next_command
This patch fixes the out-of-bounds array accesses in test-port-context.c,
which is detected by AddressSanitizer, by checking the index against the
array length before accessing the array.
2014-02-14 09:03:13 +01:00
Ben Chan
0ce4244517 tests: add missing call to g_type_init()
This patches fixes the following error when testing ModemManager with
glib < 2.36, which still requires g_type_init() to be called:

TEST: test-service-generic... (pid=20166)
  /MM/Service/Generic:
(/work/ModemManager/plugins/.libs/lt-test-service-generic:20166): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()
FAIL
2014-02-14 09:03:13 +01:00
Dan Williams
50de6798b0 broadband-modem: fix double-free of QCDM mode-pref query
Caused by a merge conflict between 81ee0783 and 529e94b0.
2014-02-13 15:55:35 -06:00
Dan Williams
42ad7b758a manager: make Bluetooth rfcomm ports work again
At some point rfcomm serial ports stopped having parents in sysfs,
so checks to get the physical device fail because the rfcomm port
is /sys/devices/virtual/rfcommX and has no parents.  So we have
to fall back on checking the interface name.
2014-02-13 15:18:16 -06:00
Aleksander Morgado
fbb35628d5 po: don't translate test files 2014-02-13 13:42:01 +01:00
Aleksander Morgado
bff2a8d2f2 tests: added support for DBus service tests
We can now run 'simulated' modems against a ModemManager running in its own
session bus.
2014-02-13 13:41:58 +01:00
Aleksander Morgado
ba58aa42f2 base-modem: don't apply auth checks if running in the SESSION bus 2014-02-13 13:41:55 +01:00
Aleksander Morgado
f85e345a9e manager: as soon as we know we're going to stop, clear DBus connection
So that the ObjectManager interface doesn't try to signal about e.g. interface
removals; see:

  https://bugzilla.gnome.org/show_bug.cgi?id=715157.
2014-02-13 13:41:52 +01:00
Aleksander Morgado
247a945950 context: new '--test-plugin-dir' to allow specifying where the plugins are 2014-02-13 13:41:50 +01:00
Aleksander Morgado
ea362ce18e service,tests: run in MM in debug mode in service tests 2014-02-13 13:41:47 +01:00
Aleksander Morgado
6810aff864 manager: allow to remotely setup test profiles with 'virtual' ports 2014-02-13 13:41:44 +01:00
Aleksander Morgado
2d9d15f892 plugin: allow creating 'virtual' modems with 'virtual' ports 2014-02-13 13:41:41 +01:00
Aleksander Morgado
c182a04f64 base-modem: allow grabbing 'virtual' AT ports 2014-02-13 13:41:39 +01:00