diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-15 15:19:38 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-15 17:57:32 +0100 |
commit | ef55409b39daec4d95c801d31dddf3495f4d622c (patch) | |
tree | d81ecaffe9dafc203da02b5511778bd18a92b3e9 | |
parent | 1a3c3b9e0d684d15737e5070ae213d38f473fa2e (diff) | |
download | ModemManager-ef55409b39daec4d95c801d31dddf3495f4d622c.tar.gz |
shared-qmi: process all feature checks in SSP response together
Loading capabilities is the very first step of the state machines, and
so we can rely on the "NAS Get SSP" method performed there to process
all feature checks of the SSP response.
(cherry picked from commit bb5bc9c8c560a24ef2951bdb9e1da18dedd7c5b0)
-rw-r--r-- | src/mm-shared-qmi.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c index 526d80cbd..8117b04e9 100644 --- a/src/mm-shared-qmi.c +++ b/src/mm-shared-qmi.c @@ -906,21 +906,28 @@ load_current_capabilities_get_system_selection_preference_ready (QmiClientNas *c ctx = g_task_get_task_data (task); priv = get_private (MM_SHARED_QMI (self)); + priv->feature_nas_ssp = FEATURE_UNSUPPORTED; + priv->feature_nas_ssp_extended_lte_band_preference = FEATURE_UNSUPPORTED; + output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); if (!output) { mm_obj_dbg (self, "QMI operation failed: %s", error->message); g_error_free (error); - priv->feature_nas_ssp = FEATURE_UNSUPPORTED; } else if (!qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { mm_obj_dbg (self, "couldn't get system selection preference: %s", error->message); g_error_free (error); - priv->feature_nas_ssp = FEATURE_UNSUPPORTED; } else { + GArray *acquisition_order_preference_array = NULL; + + /* SSP is supported, perform feature checks */ + priv->feature_nas_ssp = FEATURE_SUPPORTED; + if (qmi_message_nas_get_system_selection_preference_output_get_extended_lte_band_preference (output, NULL, NULL, NULL, NULL, NULL)) + priv->feature_nas_ssp_extended_lte_band_preference = FEATURE_SUPPORTED; + qmi_message_nas_get_system_selection_preference_output_get_mode_preference ( output, &ctx->capabilities_context.nas_ssp_mode_preference_mask, NULL); - priv->feature_nas_ssp = FEATURE_SUPPORTED; } if (output) @@ -1445,6 +1452,7 @@ load_current_modes_system_selection_preference_ready (QmiClientNas *client, GTask *task) { MMSharedQmi *self; + Private *priv; LoadCurrentModesResult *result = NULL; QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; GError *error = NULL; @@ -1452,6 +1460,7 @@ load_current_modes_system_selection_preference_ready (QmiClientNas *client, MMModemMode allowed; self = g_task_get_source_object (task); + priv = get_private (self); output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); if (!output || !qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { @@ -1843,7 +1852,8 @@ load_bands_get_system_selection_preference_ready (QmiClientNas *client, <e_band_preference_mask, NULL); - if (qmi_message_nas_get_system_selection_preference_output_get_extended_lte_band_preference ( + if ((priv->feature_nas_ssp_extended_lte_band_preference == FEATURE_SUPPORTED) && + qmi_message_nas_get_system_selection_preference_output_get_extended_lte_band_preference ( output, &extended_lte_band_preference[0], &extended_lte_band_preference[1], @@ -1852,9 +1862,6 @@ load_bands_get_system_selection_preference_ready (QmiClientNas *client, NULL)) extended_lte_band_preference_size = G_N_ELEMENTS (extended_lte_band_preference); - if (G_UNLIKELY (priv->feature_nas_ssp_extended_lte_band_preference == FEATURE_UNKNOWN)) - priv->feature_nas_ssp_extended_lte_band_preference = extended_lte_band_preference_size ? FEATURE_SUPPORTED : FEATURE_UNSUPPORTED; - mm_bands = mm_modem_bands_from_qmi_band_preference (band_preference_mask, lte_band_preference_mask, extended_lte_band_preference_size ? extended_lte_band_preference : NULL, |