diff options
-rw-r--r-- | src/mm-modem-helpers-qmi.c | 65 | ||||
-rw-r--r-- | src/mm-modem-helpers-qmi.h | 8 | ||||
-rw-r--r-- | src/mm-shared-qmi.c | 9 | ||||
-rw-r--r-- | src/tests/test-modem-helpers-qmi.c | 51 |
4 files changed, 101 insertions, 32 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c index 5d5ddc7b..d95fd507 100644 --- a/src/mm-modem-helpers-qmi.c +++ b/src/mm-modem-helpers-qmi.c @@ -26,8 +26,6 @@ #include "mm-enums-types.h" #include "mm-log-object.h" -#define MULTIMODE (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO) - /*****************************************************************************/ MMModemCapability @@ -1844,7 +1842,7 @@ mm_current_capability_from_qmi_current_capabilities_context (MMQmiCurrentCapabil g_autofree gchar *tmp_str = NULL; /* If not a multimode device, we're done */ - if ((ctx->dms_capabilities & MULTIMODE) != MULTIMODE) + if (!ctx->multimode) tmp = ctx->dms_capabilities; else { /* We have a multimode CDMA/EVDO+GSM/UMTS device, check SSP and TP */ @@ -1865,7 +1863,7 @@ mm_current_capability_from_qmi_current_capabilities_context (MMQmiCurrentCapabil if (tmp == MM_MODEM_CAPABILITY_NONE) tmp = ctx->dms_capabilities; else - tmp = (tmp & MULTIMODE) | (MULTIMODE ^ ctx->dms_capabilities); + tmp = (tmp & MM_MODEM_CAPABILITY_MULTIMODE) | (MM_MODEM_CAPABILITY_MULTIMODE ^ ctx->dms_capabilities); } /* Log about the logic applied */ @@ -1902,15 +1900,14 @@ mm_supported_capabilities_from_qmi_supported_capabilities_context (MMQmiSupporte * switching only when switching GSM/UMTS+CDMA/EVDO multimode devices, and only if * we have support for the commands doing it. */ - if ((ctx->nas_tp_supported || ctx->nas_ssp_supported) && - ((ctx->dms_capabilities & MULTIMODE) == MULTIMODE)) { + if ((ctx->nas_tp_supported || ctx->nas_ssp_supported) && ctx->multimode) { MMModemCapability single; /* Multimode GSM/UMTS+CDMA/EVDO+(LTE/5GNR) device switched to GSM/UMTS+(LTE/5GNR) device */ - single = MM_MODEM_CAPABILITY_GSM_UMTS | (MULTIMODE ^ ctx->dms_capabilities); + single = MM_MODEM_CAPABILITY_GSM_UMTS | (MM_MODEM_CAPABILITY_MULTIMODE ^ ctx->dms_capabilities); g_array_append_val (supported_combinations, single); /* Multimode GSM/UMTS+CDMA/EVDO+(LTE/5GNR) device switched to CDMA/EVDO+(LTE/5GNR) device */ - single = MM_MODEM_CAPABILITY_CDMA_EVDO | (MULTIMODE ^ ctx->dms_capabilities); + single = MM_MODEM_CAPABILITY_CDMA_EVDO | (MM_MODEM_CAPABILITY_MULTIMODE ^ ctx->dms_capabilities); g_array_append_val (supported_combinations, single); /* * Multimode GSM/UMTS+CDMA/EVDO+(LTE/5GNR) device switched to (LTE/5GNR) device @@ -1918,7 +1915,7 @@ mm_supported_capabilities_from_qmi_supported_capabilities_context (MMQmiSupporte * This case is required because we use the same methods and operations to * switch capabilities and modes. */ - if ((single = (MULTIMODE ^ ctx->dms_capabilities))) + if ((single = (MM_MODEM_CAPABILITY_MULTIMODE ^ ctx->dms_capabilities))) g_array_append_val (supported_combinations, single); } @@ -1984,40 +1981,44 @@ mm_supported_modes_from_qmi_supported_modes_context (MMQmiSupportedModesContext } \ } while (0) - if ((ctx->current_capabilities & MULTIMODE)) { - /* 2G-only, 3G-only */ - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - } - - if (!(ctx->current_capabilities & MULTIMODE)) { + /* 2G-only, 3G-only */ + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + + /* + * This case is required because we use the same methods and operations to + * switch capabilities and modes. For the LTE capability there is a direct + * related 4G mode, and so we cannot select a '4G only' mode in this device + * because we wouldn't be able to know the full list of current capabilities + * if the device was rebooted, as we would only see LTE capability. So, + * handle this special case so that the LTE/4G-only mode can exclusively be + * selected as capability switching in this kind of devices. + */ + if (!ctx->multimode || !(ctx->current_capabilities & MM_MODEM_CAPABILITY_MULTIMODE)) { /* 4G-only */ ADD_MODE_PREFERENCE (MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); } - if ((ctx->current_capabilities & MULTIMODE)) { - /* 2G, 3G, 4G combinations */ - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE); - } + /* 2G, 3G, 4G combinations */ + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE); /* 5G related mode combinations are only supported when NAS SSP is supported, * as there is no 5G support in NAS TP. */ if (ctx->nas_ssp_supported) { - if (!(ctx->current_capabilities & MULTIMODE)) { + /* Same reasoning as for the special 4G-only case above */ + if (!ctx->multimode || !(ctx->current_capabilities & MM_MODEM_CAPABILITY_MULTIMODE)) { ADD_MODE_PREFERENCE (MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); ADD_MODE_PREFERENCE (MM_MODEM_MODE_4G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); } - if ((ctx->current_capabilities & MULTIMODE)) { - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_4G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE); - ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_5G); - } + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_4G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE); + ADD_MODE_PREFERENCE (MM_MODEM_MODE_2G, MM_MODEM_MODE_3G, MM_MODEM_MODE_4G, MM_MODEM_MODE_5G); } /* Filter out unsupported modes */ diff --git a/src/mm-modem-helpers-qmi.h b/src/mm-modem-helpers-qmi.h index fecefc6d..e4eb9c7e 100644 --- a/src/mm-modem-helpers-qmi.h +++ b/src/mm-modem-helpers-qmi.h @@ -24,6 +24,8 @@ #include "mm-port.h" +#define MM_MODEM_CAPABILITY_MULTIMODE (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO) + /*****************************************************************************/ /* QMI/DMS to MM translations */ @@ -160,6 +162,8 @@ gboolean mm_error_from_qmi_loc_indication_status (QmiLocIndicationStatus statu /* Utility to gather current capabilities from various sources */ typedef struct { + /* Whether this is a multimode device or not */ + gboolean multimode; /* NAS System Selection Preference */ QmiNasRatModePreference nas_ssp_mode_preference_mask; /* NAS Technology Preference */ @@ -175,6 +179,8 @@ MMModemCapability mm_current_capability_from_qmi_current_capabilities_context (M /* Utility to build list of supported capabilities from various sources */ typedef struct { + /* Whether this is a multimode device or not */ + gboolean multimode; /* NAS System Selection Preference */ gboolean nas_ssp_supported; /* NAS Technology Preference */ @@ -190,6 +196,8 @@ GArray *mm_supported_capabilities_from_qmi_supported_capabilities_context (MMQmi /* Utility to build list of supported modes from various sources */ typedef struct { + /* Whether this is a multimode device or not */ + gboolean multimode; /* NAS System Selection Preference */ gboolean nas_ssp_supported; /* NAS Technology Preference */ 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); diff --git a/src/tests/test-modem-helpers-qmi.c b/src/tests/test-modem-helpers-qmi.c index 6513445f..781f9d4f 100644 --- a/src/tests/test-modem-helpers-qmi.c +++ b/src/tests/test-modem-helpers-qmi.c @@ -99,6 +99,8 @@ test_current_capabilities_uml290 (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = TRUE; + /* QCDM -> CDMA/EVDO */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1X | QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1XEVDO); @@ -144,6 +146,7 @@ test_supported_capabilities_uml290 (void) MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_LTE, }; + ctx.multimode = TRUE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = FALSE; ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS | @@ -174,6 +177,7 @@ test_supported_modes_uml290_cdma_evdo_gsm_umts_lte (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, .preferred = MM_MODEM_MODE_2G }, }; + ctx.multimode = TRUE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = FALSE; @@ -205,6 +209,7 @@ test_supported_modes_uml290_cdma_evdo_lte (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, .preferred = MM_MODEM_MODE_2G }, }; + ctx.multimode = TRUE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = FALSE; @@ -235,6 +240,7 @@ test_supported_modes_uml290_gsm_umts_lte (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, .preferred = MM_MODEM_MODE_2G }, }; + ctx.multimode = TRUE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = FALSE; @@ -255,6 +261,7 @@ test_supported_modes_uml290_lte (void) { .allowed = MM_MODEM_MODE_4G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = TRUE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = FALSE; @@ -280,6 +287,7 @@ test_current_capabilities_adu960s (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = TRUE; ctx.nas_ssp_mode_preference_mask = 0; /* Unsupported */ ctx.nas_tp_mask = 0; /* Unsupported */ ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS | @@ -299,6 +307,7 @@ test_supported_capabilities_adu960s (void) MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_LTE, }; + ctx.multimode = TRUE; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = FALSE; ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS | @@ -318,6 +327,7 @@ test_supported_modes_adu960s (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = TRUE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = FALSE; @@ -343,6 +353,7 @@ test_current_capabilities_gobi1k_gsm (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; ctx.nas_ssp_mode_preference_mask = 0; /* Unsupported */ ctx.nas_tp_mask = QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO; ctx.dms_capabilities = MM_MODEM_CAPABILITY_GSM_UMTS; @@ -357,6 +368,7 @@ test_supported_capabilities_gobi1k_gsm (void) MM_MODEM_CAPABILITY_GSM_UMTS, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_GSM_UMTS; @@ -376,6 +388,7 @@ test_supported_modes_gobi1k_gsm (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; @@ -400,6 +413,7 @@ test_current_capabilities_gobi1k_cdma (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; ctx.nas_ssp_mode_preference_mask = 0; /* Unsupported */ ctx.nas_tp_mask = QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO; ctx.dms_capabilities = MM_MODEM_CAPABILITY_CDMA_EVDO; @@ -414,6 +428,7 @@ test_supported_capabilities_gobi1k_cdma (void) MM_MODEM_CAPABILITY_CDMA_EVDO, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_CDMA_EVDO; @@ -433,6 +448,7 @@ test_supported_modes_gobi1k_cdma (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; @@ -459,6 +475,8 @@ test_current_capabilities_gobi2k_gsm (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QCDM -> Automatic */ ctx.nas_ssp_mode_preference_mask = 0; /* Unsupported */ ctx.nas_tp_mask = QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO; @@ -486,6 +504,7 @@ test_supported_capabilities_gobi2k_gsm (void) MM_MODEM_CAPABILITY_GSM_UMTS, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_GSM_UMTS; @@ -505,6 +524,7 @@ test_supported_modes_gobi2k_gsm (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; @@ -531,6 +551,8 @@ test_current_capabilities_gobi2k_cdma (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QCDM -> Automatic */ ctx.nas_ssp_mode_preference_mask = 0; /* Unsupported */ ctx.nas_tp_mask = QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO; @@ -558,6 +580,7 @@ test_supported_capabilities_gobi2k_cdma (void) MM_MODEM_CAPABILITY_CDMA_EVDO, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_CDMA_EVDO; @@ -577,6 +600,7 @@ test_supported_modes_gobi2k_cdma (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G; ctx.nas_ssp_supported = FALSE; ctx.nas_tp_supported = TRUE; @@ -605,6 +629,8 @@ test_current_capabilities_gobi3k_gsm (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QCDM -> Automatic */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1X | QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1XEVDO | @@ -635,6 +661,7 @@ test_supported_capabilities_gobi3k_gsm (void) MM_MODEM_CAPABILITY_GSM_UMTS, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_GSM_UMTS; @@ -655,6 +682,7 @@ test_supported_modes_gobi3k_gsm (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, .preferred = MM_MODEM_MODE_2G }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; @@ -683,6 +711,8 @@ test_current_capabilities_gobi3k_cdma (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QCDM -> Automatic */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1X | QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1XEVDO | @@ -713,6 +743,7 @@ test_supported_capabilities_gobi3k_cdma (void) MM_MODEM_CAPABILITY_CDMA_EVDO, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_CDMA_EVDO; @@ -733,6 +764,7 @@ test_supported_modes_gobi3k_cdma (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, .preferred = MM_MODEM_MODE_2G }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; @@ -769,6 +801,8 @@ test_current_capabilities_generic_nr5g_multimode (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = TRUE; + /* QMI -> Automatic */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1X | QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1XEVDO | @@ -870,6 +904,7 @@ test_supported_capabilities_generic_nr5g_multimode (void) MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_LTE | MM_MODEM_CAPABILITY_5GNR, }; + ctx.multimode = TRUE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS | @@ -927,6 +962,7 @@ test_supported_modes_generic_nr5g_multimode (void) { .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G | MM_MODEM_MODE_5G, .preferred = MM_MODEM_MODE_2G }, }; + ctx.multimode = TRUE; ctx.all = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G | MM_MODEM_MODE_5G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; @@ -945,6 +981,7 @@ test_current_capabilities_generic_nr5g_only (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; ctx.nas_ssp_mode_preference_mask = QMI_NAS_RAT_MODE_PREFERENCE_5GNR; ctx.nas_tp_mask = QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO; ctx.dms_capabilities = MM_MODEM_CAPABILITY_5GNR; @@ -959,6 +996,7 @@ test_supported_capabilities_generic_nr5g_only (void) MM_MODEM_CAPABILITY_5GNR, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = MM_MODEM_CAPABILITY_5GNR; @@ -976,6 +1014,7 @@ test_supported_modes_generic_nr5g_only (void) { .allowed = MM_MODEM_MODE_5G, .preferred = MM_MODEM_MODE_NONE }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_5G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; @@ -991,6 +1030,8 @@ test_current_capabilities_generic_nr5g_lte (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QMI -> Automatic */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_LTE | QMI_NAS_RAT_MODE_PREFERENCE_5GNR); @@ -1028,6 +1069,7 @@ test_supported_capabilities_generic_nr5g_lte (void) MM_MODEM_CAPABILITY_LTE | MM_MODEM_CAPABILITY_5GNR, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = (MM_MODEM_CAPABILITY_LTE | @@ -1049,6 +1091,7 @@ test_supported_modes_generic_nr5g_lte (void) { .allowed = MM_MODEM_MODE_4G | MM_MODEM_MODE_5G, .preferred = MM_MODEM_MODE_4G }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_4G | MM_MODEM_MODE_5G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; @@ -1065,6 +1108,8 @@ test_current_capabilities_generic_nr5g_lte_umts (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QMI -> Automatic */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_UMTS | QMI_NAS_RAT_MODE_PREFERENCE_LTE | @@ -1120,6 +1165,7 @@ test_supported_capabilities_generic_nr5g_lte_umts (void) MM_MODEM_CAPABILITY_GSM_UMTS |MM_MODEM_CAPABILITY_LTE | MM_MODEM_CAPABILITY_5GNR, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS | @@ -1158,6 +1204,7 @@ test_supported_modes_generic_nr5g_lte_umts (void) { .allowed = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G | MM_MODEM_MODE_5G, .preferred = MM_MODEM_MODE_3G }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G | MM_MODEM_MODE_5G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; @@ -1175,6 +1222,8 @@ test_current_capabilities_generic_nr5g_lte_evdo (void) { MMQmiCurrentCapabilitiesContext ctx; + ctx.multimode = FALSE; + /* QMI -> Automatic */ ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_CDMA_1XEVDO | QMI_NAS_RAT_MODE_PREFERENCE_LTE | @@ -1230,6 +1279,7 @@ test_supported_capabilities_generic_nr5g_lte_evdo (void) MM_MODEM_CAPABILITY_CDMA_EVDO |MM_MODEM_CAPABILITY_LTE | MM_MODEM_CAPABILITY_5GNR, }; + ctx.multimode = FALSE; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; ctx.dms_capabilities = (MM_MODEM_CAPABILITY_CDMA_EVDO | @@ -1268,6 +1318,7 @@ test_supported_modes_generic_nr5g_lte_evdo (void) { .allowed = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G | MM_MODEM_MODE_5G, .preferred = MM_MODEM_MODE_3G }, }; + ctx.multimode = FALSE; ctx.all = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G | MM_MODEM_MODE_5G; ctx.nas_ssp_supported = TRUE; ctx.nas_tp_supported = TRUE; |