diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2022-01-31 22:34:56 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-01-31 22:48:57 +0100 |
commit | c7ff014e07ee5bfcfa4ba7e235c1c234ad77245a (patch) | |
tree | 17a67e1efc623248423177687cd1bde080cb53f4 /src/mm-shared-qmi.c | |
parent | ccf0b7eba2bf2abc2c81e5d68dc5872a15b515c2 (diff) |
modem-helpers-qmi: multimode devices shouldn't always have 4G/5G only modes
In GSM/UMTS+CDMA/EVDO multimode devices, the 4G and 5G mode switching
operations are exclusively limited to the capability selection that
has LTE+5GNR exclusively.
We cannot allow switching to 4G-only, 5G-only or 4G+5G if the current
capabilities have GSM/UMTS or CDMA/EVDO.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/503
Diffstat (limited to 'src/mm-shared-qmi.c')
-rw-r--r-- | src/mm-shared-qmi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c index 088242aa..e0d62dc5 100644 --- a/src/mm-shared-qmi.c +++ b/src/mm-shared-qmi.c @@ -70,6 +70,7 @@ config_info_clear (ConfigInfo *config_info) typedef struct { /* Capabilities & modes helpers */ + gboolean multimode; MMModemCapability current_capabilities; GArray *supported_radio_interfaces; Feature feature_nas_tp; @@ -1023,7 +1024,13 @@ load_current_capabilities_step (GTask *task) case LOAD_CURRENT_CAPABILITIES_STEP_LAST: g_assert (priv->feature_nas_tp != FEATURE_UNKNOWN); g_assert (priv->feature_nas_ssp != FEATURE_UNKNOWN); + + /* At this point we can already know if this is a multimode device or not */ + if ((ctx->capabilities_context.dms_capabilities & MM_MODEM_CAPABILITY_MULTIMODE) == MM_MODEM_CAPABILITY_MULTIMODE) + priv->multimode = ctx->capabilities_context.multimode = TRUE; + priv->current_capabilities = mm_current_capability_from_qmi_current_capabilities_context (&ctx->capabilities_context, self); + g_task_return_int (task, priv->current_capabilities); g_object_unref (task); return; @@ -1126,6 +1133,7 @@ mm_shared_qmi_load_supported_capabilities (MMIfaceModem *self, ctx.nas_tp_supported = (priv->feature_nas_tp == FEATURE_SUPPORTED); ctx.nas_ssp_supported = (priv->feature_nas_ssp == FEATURE_SUPPORTED); + ctx.multimode = priv->multimode; /* Build list of supported combinations */ supported_combinations = mm_supported_capabilities_from_qmi_supported_capabilities_context (&ctx, self); @@ -1698,6 +1706,7 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self, ctx.nas_ssp_supported = (priv->feature_nas_ssp == FEATURE_SUPPORTED); ctx.nas_tp_supported = (priv->feature_nas_tp == FEATURE_SUPPORTED); ctx.current_capabilities = priv->current_capabilities; + ctx.multimode = priv->multimode; combinations = mm_supported_modes_from_qmi_supported_modes_context (&ctx, self); g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref); |