Commit Graph

164 Commits

Author SHA1 Message Date
Ben Chan
9ddcf92a18 iface-modem: fix crashes due to removed skeleton
expire_signal_quality() / mm_iface_modem_update_access_technologies()
may be called after the DBus object skeleton is removed in
mm_iface_modem_shutdown() and before their associated timeout source is
removed (in *_context_free) due to destruction of the modem object.

This patch fixes the issue by removing context objects before removing
the DBus skeleton in mm_iface_modem_shutdown().
2012-07-13 08:42:05 +02:00
Aleksander Morgado
83afd3ddc9 iface-modem: new helpers to query supported modes 2012-04-10 18:28:33 +02:00
Aleksander Morgado
b49ddfe930 iface-modem: skip handling the CURRENT_CAPABILITIES property
It is an unnecessary complication, as long as we can keep the helpers in the interface.
2012-04-10 17:47:43 +02:00
Aleksander Morgado
7518772d4b core: fatal errors in iface initializations force the modem into a FAILED state
Modems which end up being found unusable (e.g. no SIM, fatal SIM error, no
capabilities) will be exposed in DBus, but just with the Modem interface and
in a FAILED state which allows no actions.
2012-03-30 13:47:00 +02:00
Aleksander Morgado
f6d8c52bc9 iface-modem: do not try to set new allowed/preferred config if modem already in there 2012-03-26 09:35:09 +02:00
Aleksander Morgado
41a592b535 iface-modem: treat ANY in allowed modes as being equal to the list of supported modes 2012-03-24 19:16:53 +01:00
Aleksander Morgado
29b955afa2 iface-modem: if we are already unlocked, don't try to check it again
We're assuming here we are never getting locked without us knowing it.
2012-03-16 15:37:12 +01:00
Aleksander Morgado
09026ed89a iface-modem: treat serial errors also as fatal when checking unlock status 2012-03-16 14:53:24 +01:00
Aleksander Morgado
e140ff3c5f iface-modem: let initialization and enabling sequences get cancelled 2012-03-16 14:53:24 +01:00
Aleksander Morgado
d27e40ae9a core: new `Initializing' state in the global modem state machine
We need to define a state to be used while the modem is being initialized, so
that we forbid any operation on the modem on already exported interfaces, while
there are interfaces pending to get exported.

This Initializing state will also cover the state between having the SIM
unlocked (which launches re-initialization) and being completely initialized.
2012-03-16 14:53:24 +01:00
Aleksander Morgado
3a22128d9e iface-modem: don't leave locked state until re-initialization is complete 2012-03-16 14:53:24 +01:00
Aleksander Morgado
215c278082 base-modem: new modem-wide cancellable, passed to every state machine 2012-03-16 14:53:23 +01:00
Aleksander Morgado
cc6d4a97fb base-modem: new port getters and peekers
* mm_base_modem_peek_port_* () will return either a port object (no new
reference), or NULL if none available.

You would usually peek() a port if you're going to use it just in the current
method, as there is no way to that reference to get invalid (we're single
threaded).

 * mm_base_modem_get_port_* () will return either NEW references to valid
port objects, or NULL if none available.

And, you would usually get() a port, whenever you want the port object to be
valid even out of the current method, for example when keeping it in the
context of an async operation.

Also, we need to consider that the primary AT port MAY BE NULL when you
peek() or get() it. This is due to the fact that we may be releasing ports
(due to device disconnection) in the middle of async operations.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
2dcff5590e iface-modem: setup loading of own numbers during the initialization phase 2012-03-16 14:53:21 +01:00
Aleksander Morgado
9c5c072bab iface-modem: fix signal name 2012-03-16 14:53:20 +01:00
Aleksander Morgado
cd63df938f libmm-common: `MMSimpleStatus' won't be considered internal any more
Renamed `MMCommonSimpleProperties' to `MMSimpleStatus', and removed the
`MMSimpleStatusProperties' provided in libmm-glib. We'll just use the original
one from libmm-common always.
2012-03-16 14:53:20 +01:00
Aleksander Morgado
d306bb082f libmm-common: `MMBearerProperties' won't be considered internal any more
Renamed `MMCommonBearerProperties' to `MMBearerProperties', and removed the
`MMBearerProperties' provided in libmm-glib. We'll just use the original one
from libmm-common always.
2012-03-16 14:53:19 +01:00
Aleksander Morgado
3ccc78e858 api: `UnlockRetries' will reply a list of per-lock retry counts
Equivalent to `PinRetryCount' in the previous API. We don't have an additional
property for the retry count of the current lock, as it really is duplicating
information.
2012-03-16 14:53:19 +01:00
Aleksander Morgado
64f49c0c72 iface-modem: the Command() method is only allowed when running in debug mode 2012-03-16 14:53:18 +01:00
Aleksander Morgado
12786d21cf core: remove uses of `MMModemStateReason'
Use `MMModemStateChangeReason' instead.
2012-03-16 14:53:17 +01:00
Aleksander Morgado
2240747715 iface-modem: include policy authorization checks 2012-03-16 14:53:15 +01:00
Aleksander Morgado
080d046e64 iface-modem: load allowed/preferred modes during modem enabling 2012-03-16 14:28:15 +01:00
Aleksander Morgado
3595b33648 iface-modem: load current bands during modem enabling 2012-03-16 14:28:13 +01:00
Aleksander Morgado
09d2f062c7 api,dbus: rename AllowedBands' to just Bands'
ModemManager will load:
  1) The list of supported bands. Note that this doesn't mean that any possible
     combination of bands is supported, as modems may support only specific
     combinations, but at least gives a rough idea of what the modem is capable
     of handling.

  2) The list of CURRENT bands. There is no such "Allowed" bands, as we do with
     modes, modems will have a specific set of bands being currently used, which
     will be reported in the `Bands' property.

If the modem allows modifying the list of bands to use, this can be done with
the `SetBands()' method. If the modem doesn't support using a specific
combination of bands, this method will report an error.
2012-03-16 14:28:13 +01:00
Aleksander Morgado
dc1df5bf2f iface-modem-simple: SIM-PIN2 locking does not prevent from connecting 2012-03-15 14:15:06 +01:00
Nathan Williams
3c41ce5d8b api,dbus: new `Command' method in the API to send arbitrary AT commands
BUG=chromium-os:25348
TEST="mmcli -m 0 --command='E0'"
Change-Id: I320587560fde5780f9d5a4998e32364d36a71ed7
2012-03-15 14:15:06 +01:00
Aleksander Morgado
21a722b616 core: don't pass primary port to interface initializations
They will all get it themselves.
2012-03-15 14:15:05 +01:00
Aleksander Morgado
a1dc38360c iface-modem: don't force port closing here, it breaks the open/close count 2012-03-15 14:15:02 +01:00
Aleksander Morgado
214a146a28 iface-modem: simplify disabling sequence
Avoid the _ready() function generator macro, not really needed here.
2012-03-15 14:15:02 +01:00
Aleksander Morgado
cd5e9c27a3 broadband-modem: if locked, don't try to initialize remaining interfaces
Whenever we get unlocked, the modem initialization sequence will be run again.
2012-03-15 14:14:59 +01:00
Aleksander Morgado
8321bd5875 iface-modem: periodically request to update current access technologies 2012-03-15 14:14:56 +01:00
Aleksander Morgado
65455558be iface-modem: s/access_tech/access_technologies 2012-03-15 14:14:56 +01:00
Aleksander Morgado
4aeadbb776 iface-modem: proper fallback state when bearer connection fails 2012-03-15 14:14:55 +01:00
Aleksander Morgado
7e36f04b37 core: use new enums/flags string getters/builders 2012-03-15 14:14:52 +01:00
Aleksander Morgado
f07101943c iface-modem-simple: new connection logic when more than one bearer around
For mixed 3GPP+CDMA modems, we first try to connect the 3GPP bearers, and then
the CDMA ones.
2012-03-15 14:14:49 +01:00
Aleksander Morgado
0b8d0c697d iface-modem: get consolidated state from all subsystems
We don't want, e.g.,  REGISTERED->ENABLED transitions when 3GPP gets
unregistered but we're still registered in CDMA.
2012-03-15 14:14:46 +01:00
Aleksander Morgado
cb2612d0ce iface-modem: fix signal quality context creation 2012-03-15 14:14:44 +01:00
Aleksander Morgado
5edb863ede iface-modem: make old compilers happy 2012-03-15 14:14:44 +01:00
Aleksander Morgado
ee07cc51ea iface-modem: fix checks for single technology capabilities 2012-03-15 14:14:44 +01:00
Aleksander Morgado
8610fd47b3 iface-modem: plug small leak 2012-03-15 14:14:44 +01:00
Aleksander Morgado
ffae95a46b iface-modem: new helpers to check if modem has LTE capabilities 2012-03-15 14:14:43 +01:00
Aleksander Morgado
d5af2286e2 iface-modem-3gpp: indicators and unsolicited events are 3GPP-specific
Moved code from the Modem interface, as this is really 3GPP-specific
2012-03-15 14:14:43 +01:00
Aleksander Morgado
bda0d0c1d4 iface-modem: allow implementations to return no SIM and no error
That would mean that the implementation doesn't want to handle a SIM object
around, maybe because it doesn't support it properly, or because there is
no SIM at all (e.g. CDMA-only modems).
2012-03-15 14:14:42 +01:00
Aleksander Morgado
021ff8a35b iface-modem: open/close secondary AT/QCDM ports during enable/disable 2012-03-15 14:14:42 +01:00
Aleksander Morgado
be7cee24f3 iface-modem: place all tags/quarks handled together 2012-03-15 14:14:42 +01:00
Aleksander Morgado
0f7716887c iface-modem: new methods to check for specific capabilities being supported 2012-03-15 14:14:42 +01:00
Aleksander Morgado
ba5321adf1 iface-modem: let different SIM object creation implementations
We let objects implementing the Modem interface to provide their own SIM
creation method. This allows plugins to subclass MMSim themselves.
2012-03-15 14:14:41 +01:00
Aleksander Morgado
bf69930ede iface-modem: ensure initial allowed modes is a subset of supported modes
Also make loading supported modes a mandatory method that must be provided by
objects implementing the Modem interface.
2012-03-15 14:14:41 +01:00
Aleksander Morgado
6002ad1b70 iface-modem: run checks when trying to set allowed bands
Allowed bands must be a subset of the supported bands.
2012-03-15 14:14:41 +01:00
Aleksander Morgado
1be7c27453 iface-modem: run checks when trying to set allowed modes
Allowed modes being set must be a subset of Supported modes.
Preferred mode being set must be a subset of Allowed modes.
2012-03-15 14:14:41 +01:00