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
This commit is contained in:
Aleksander Morgado
2022-01-31 22:48:57 +01:00
parent ccf0b7eba2
commit c7ff014e07
4 changed files with 100 additions and 31 deletions
+9
View File
@@ -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);