diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-07-15 22:54:18 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2018-09-12 17:25:19 +0000 |
commit | 692d076ba68e09bcad146d78109d4a59e1563918 (patch) | |
tree | b736525a272432333658ad054c94857264f2b1b1 /src/mm-shared-qmi.h | |
parent | 6026c99f2ec99e2721356ee645472d8403676bf6 (diff) |
shared-qmi: implement reworked mode and capabilities management
This commit introduces several improvements and changes in the way
modes and capabilities are managed in QMI capable devices. It is
organized into a single commit, as all changes in all 6 operations
(load current capabilities, load supported capabilities, set current
capabilities, load supported modes, load current modes, set current
modes) are related one to the other (given that the same QMI commands
are used for both capabilities and mode management).
The primary change is related to which capabilities are reported as
supported for a given device. In the previous implementation we
allowed switching between every combination possible for GSM/UMTS+LTE,
CDMA/EVDO+LTE or GSM/UMTS+CDMA/EVDO+LTE devices. E.g. we would allow
"LTE only" and "GSM/UMTS only" capabilities for GSM/UMTS+LTE devices,
even if they would both be managed in exactly the same way. That setup
wasn't ideal, because it meant that switching to a "LTE only"
configuration would require a power cycle, as capability switching
requires a power cycle, even if no change was expected in the exposed
DBus interfaces (which is why we require the power cycle). So, instead
of allowing every possible capability combination, we use capability
switching logic exclusively for configuring GSM/UMTS+CDMA/EVDO devices
(regardless of whether it has LTE or not) to add or remove the
GSM/UMTS and CDMA/EVDO capabilities. E.g. for a GSM/UMTS+CDMA/EVDO+LTE
device we would allow 3 combinatios: "GSM/UMTS+LTE", "CDMA/EVDO+LTE"
and "GSM/UMTS+CDMA/EVDO+LTE".
The "GSM/UMTS+CDMA/EVDO+LTE" is a special case because for this one we
allow switching to "LTE only" capabilities while we forbid switching
to "4G only" mode. As the same commands are used for mode and
capability switching, if we didn't have "LTE only" and we allowed "4G
only" mode instead and rebooted the device, we would end up not being
able to know which other capabilities (GSM/UMTS or CDMA/EVDO or both)
were also enabled.
Now that we have capability switching confined to a very subset of
combinations, we can use the mode switching logic to e.g. allow "4G
only" configurations in all non multimode devices, as well as masks of
allowed modes with one being preferred, which we didn't allow before.
In the previous implementation all mode switching logic was disabled
for LTE capable QMI devices. In the new implementation, we use the
"Acquisition Order Preference" TLV in NAS Set System Selection
Preference to define the full list of mode preferences for all
supported modes.
We also no longer just assume that NAS Technology Preference is always
available and NAS System Selection Preference only after NAS >= 1.1.
This logic is flawed, instead we're going to probe for those features
once when loading current capabilities, and we then just implement the
capabilities/mode switching logic based on that.
Diffstat (limited to 'src/mm-shared-qmi.h')
-rw-r--r-- | src/mm-shared-qmi.h | 67 |
1 files changed, 54 insertions, 13 deletions
diff --git a/src/mm-shared-qmi.h b/src/mm-shared-qmi.h index af660caa..9b3e10c5 100644 --- a/src/mm-shared-qmi.h +++ b/src/mm-shared-qmi.h @@ -62,19 +62,60 @@ gboolean mm_shared_qmi_ensure_client (MMSharedQmi *self, /* Shared QMI device management support */ -void mm_shared_qmi_reset (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_shared_qmi_reset_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error); -void mm_shared_qmi_factory_reset (MMIfaceModem *self, - const gchar *code, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_shared_qmi_factory_reset_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error); +void mm_shared_qmi_load_supported_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_qmi_load_supported_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_current_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemCapability mm_shared_qmi_load_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_set_current_capabilities (MMIfaceModem *self, + MMModemCapability capabilities, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_set_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_qmi_load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error); +void mm_shared_qmi_set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_reset (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_factory_reset (MMIfaceModem *self, + const gchar *code, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_factory_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); /* Shared QMI location support */ |