Commit Graph

4336 Commits

Author SHA1 Message Date
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
Aleksander Morgado
abb88a5e0a plugin-manager: allow looking plugins by name 2014-02-13 13:41:36 +01:00
Aleksander Morgado
9641d27518 device: allow creating 'virtual' devices 2014-02-13 13:41:33 +01:00
Aleksander Morgado
b7fa48dd22 device: new 'hotplugged' property 2014-02-13 13:41:31 +01:00
Aleksander Morgado
84ab92d85a port-serial: allow ports based on Unix sockets 2014-02-13 13:41:28 +01:00
Aleksander Morgado
65f87561c5 context: new '--test-enable' to enable the Test interface 2014-02-13 13:41:25 +01:00
Aleksander Morgado
243720414e context: new '--test-no-auto-scan' to avoid automatic scanning for devices 2014-02-13 13:41:23 +01:00
Aleksander Morgado
bf57da537d context: new '--test-session' allows launching the MM daemon in the session bus 2014-02-13 13:41:20 +01:00
Aleksander Morgado
46ff06ff80 service,tests: new DBus service file for tests 2014-02-13 13:41:17 +01:00
Aleksander Morgado
4827e79848 libmm-glib,tests: use gdbus-codegen to generate code for the new Test interface 2014-02-13 13:41:14 +01:00
Aleksander Morgado
1eaa416f22 introspection,tests: add new 'Test' interface 2014-02-13 13:41:12 +01:00
Aleksander Morgado
e684851698 huawei: use shortened version of NDISDUP when possible
Adds support for the Huawei E3276 by sending the shortened form of the
AT^NDISDUP command where possible, as the E3276 fails with an '+CME ERROR:
Incorrect parameters' if encoded_auth is set to 0. This behaviour is slightly
different to the E1820 and K4605 (E372) which will happily establish a
connection with encoded_auth set to 0, 1 or 2.
2014-02-13 13:41:09 +01:00
Aleksander Morgado
b28230411a port-serial: always set the forced_close flag if forced to close 2014-02-13 13:41:06 +01:00
Aleksander Morgado
0d0f5de161 base-modem: allow looking for a subset of the available ports 2014-02-13 13:41:03 +01:00
Aleksander Morgado
2b46f65879 base-modem: allow grabbing non-tty AT ports 2014-02-13 13:41:01 +01:00
Aleksander Morgado
070f4938f3 plugin: allow probing non-tty AT ports 2014-02-13 13:40:58 +01:00
Aleksander Morgado
38ebf7c95b port-serial-at: allow specifying subsystem when creating a 'MMPortSerialAt'
Don't just assume that all AT ports are TTYs.
2014-02-13 13:40:55 +01:00
Aleksander Morgado
9432674087 port-serial: use the GIOChannel also for writing data 2014-02-13 13:40:52 +01:00
Aleksander Morgado
3ef71e4541 port-serial: allow non-tty 'MMPortSerial' objects
Allow having 'MMPortSerial' objects for non-tty devices. This will allow us e.g.
handling /dev/cdc-wdm ports speaking the AT protocol.
2014-02-13 13:40:50 +01:00
Aleksander Morgado
6fc14f6611 port-serial: remove unneeded method 2014-02-13 13:40:47 +01:00
Aleksander Morgado
a2f4fbe373 port-serial-qcdm: commands are never cached
The QCDM port commands are never cached, so remove the option from the command()
method. Will also simplify command caching afterwards as it will be an AT-only
thing.
2014-02-13 13:40:44 +01:00
Aleksander Morgado
5792bcc876 port: remove 'constructor' checking for property validity
A constructor cannot return NULL, specially when there are subclasses, as it
would segfault. Just remove it, as it doesn't really do anything useful.
2014-02-13 13:40:42 +01:00
Aleksander Morgado
ef77e35a7f port: use a 'priv' pointer to handle the private info 2014-02-13 13:40:39 +01:00
Aleksander Morgado
3f8f88499e port-serial: use a 'priv' pointer to handle the private info 2014-02-13 13:40:36 +01:00
Aleksander Morgado
dbe13520ee port-serial-at: use a 'priv' pointer to handle the private info 2014-02-13 13:40:33 +01:00
Aleksander Morgado
e909edcf1f port-serial: use GIO Async API like method for command() 2014-02-13 13:40:30 +01:00