shared-qmi: rename feature check variables

We want the "extended_lte_band_preference" with the "nas_ssp" prefix,
as we're going to add more checks for SSP features.
This commit is contained in:
Aleksander Morgado
2021-03-15 14:58:12 +01:00
parent 830230dccb
commit 67b64eb7ee

View File

@@ -71,9 +71,9 @@ typedef struct {
/* Capabilities & modes helpers */ /* Capabilities & modes helpers */
MMModemCapability current_capabilities; MMModemCapability current_capabilities;
GArray *supported_radio_interfaces; GArray *supported_radio_interfaces;
Feature feature_nas_technology_preference; Feature feature_nas_tp;
Feature feature_nas_system_selection_preference; Feature feature_nas_ssp;
Feature feature_extended_lte_band_preference; Feature feature_nas_ssp_extended_lte_band_preference;
gboolean disable_4g_only_mode; gboolean disable_4g_only_mode;
GArray *supported_bands; GArray *supported_bands;
@@ -141,8 +141,8 @@ get_private (MMSharedQmi *self)
if (!priv) { if (!priv) {
priv = g_slice_new0 (Private); priv = g_slice_new0 (Private);
priv->feature_nas_technology_preference = FEATURE_UNKNOWN; priv->feature_nas_tp = FEATURE_UNKNOWN;
priv->feature_nas_system_selection_preference = FEATURE_UNKNOWN; priv->feature_nas_ssp = FEATURE_UNKNOWN;
priv->config_active_i = -1; priv->config_active_i = -1;
/* Setup parent class' MMIfaceModemLocation */ /* Setup parent class' MMIfaceModemLocation */
@@ -476,7 +476,7 @@ mm_shared_qmi_3gpp_register_in_network (MMIfaceModem3gpp *self,
} }
priv = get_private (MM_SHARED_QMI (self)); priv = get_private (MM_SHARED_QMI (self));
if (priv->feature_nas_system_selection_preference == FEATURE_SUPPORTED) if (priv->feature_nas_ssp == FEATURE_SUPPORTED)
register_in_network_sssp (task, client, cancellable, mcc, mnc); register_in_network_sssp (task, client, cancellable, mcc, mnc);
else else
register_in_network_inr (task, client, cancellable, mcc, mnc); register_in_network_inr (task, client, cancellable, mcc, mnc);
@@ -688,8 +688,8 @@ set_current_capabilities_step (GTask *task)
switch (ctx->step) { switch (ctx->step) {
case SET_CURRENT_CAPABILITIES_STEP_FIRST: case SET_CURRENT_CAPABILITIES_STEP_FIRST:
/* Error out early if both unsupported */ /* Error out early if both unsupported */
if ((priv->feature_nas_system_selection_preference != FEATURE_SUPPORTED) && if ((priv->feature_nas_ssp != FEATURE_SUPPORTED) &&
(priv->feature_nas_technology_preference != FEATURE_SUPPORTED)) { (priv->feature_nas_tp != FEATURE_SUPPORTED)) {
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
"Setting capabilities is not supported by this device"); "Setting capabilities is not supported by this device");
g_object_unref (task); g_object_unref (task);
@@ -699,7 +699,7 @@ set_current_capabilities_step (GTask *task)
/* fall-through */ /* fall-through */
case SET_CURRENT_CAPABILITIES_STEP_NAS_SYSTEM_SELECTION_PREFERENCE: case SET_CURRENT_CAPABILITIES_STEP_NAS_SYSTEM_SELECTION_PREFERENCE:
if (priv->feature_nas_system_selection_preference == FEATURE_SUPPORTED) { if (priv->feature_nas_ssp == FEATURE_SUPPORTED) {
set_current_capabilities_system_selection_preference (task); set_current_capabilities_system_selection_preference (task);
return; return;
} }
@@ -707,7 +707,7 @@ set_current_capabilities_step (GTask *task)
/* fall-through */ /* fall-through */
case SET_CURRENT_CAPABILITIES_STEP_NAS_TECHNOLOGY_PREFERENCE: case SET_CURRENT_CAPABILITIES_STEP_NAS_TECHNOLOGY_PREFERENCE:
if (priv->feature_nas_technology_preference == FEATURE_SUPPORTED) { if (priv->feature_nas_tp == FEATURE_SUPPORTED) {
set_current_capabilities_technology_preference (task); set_current_capabilities_technology_preference (task);
return; return;
} }
@@ -747,8 +747,8 @@ mm_shared_qmi_set_current_capabilities (MMIfaceModem *self,
return; return;
priv = get_private (MM_SHARED_QMI (self)); priv = get_private (MM_SHARED_QMI (self));
g_assert (priv->feature_nas_technology_preference != FEATURE_UNKNOWN); g_assert (priv->feature_nas_tp != FEATURE_UNKNOWN);
g_assert (priv->feature_nas_system_selection_preference != FEATURE_UNKNOWN); g_assert (priv->feature_nas_ssp != FEATURE_UNKNOWN);
ctx = g_slice_new0 (SetCurrentCapabilitiesContext); ctx = g_slice_new0 (SetCurrentCapabilitiesContext);
ctx->client = g_object_ref (client); ctx->client = g_object_ref (client);
@@ -884,18 +884,18 @@ load_current_capabilities_get_technology_preference_ready (QmiClientNas *client,
if (!output) { if (!output) {
mm_obj_dbg (self, "QMI operation failed: %s", error->message); mm_obj_dbg (self, "QMI operation failed: %s", error->message);
g_error_free (error); g_error_free (error);
priv->feature_nas_technology_preference = FEATURE_UNSUPPORTED; priv->feature_nas_tp = FEATURE_UNSUPPORTED;
} else if (!qmi_message_nas_get_technology_preference_output_get_result (output, &error)) { } else if (!qmi_message_nas_get_technology_preference_output_get_result (output, &error)) {
mm_obj_dbg (self, "couldn't get technology preference: %s", error->message); mm_obj_dbg (self, "couldn't get technology preference: %s", error->message);
g_error_free (error); g_error_free (error);
priv->feature_nas_technology_preference = FEATURE_SUPPORTED; priv->feature_nas_tp = FEATURE_SUPPORTED;
} else { } else {
qmi_message_nas_get_technology_preference_output_get_active ( qmi_message_nas_get_technology_preference_output_get_active (
output, output,
&ctx->capabilities_context.nas_tp_mask, &ctx->capabilities_context.nas_tp_mask,
NULL, /* duration */ NULL, /* duration */
NULL); NULL);
priv->feature_nas_technology_preference = FEATURE_SUPPORTED; priv->feature_nas_tp = FEATURE_SUPPORTED;
} }
if (output) if (output)
@@ -924,17 +924,17 @@ load_current_capabilities_get_system_selection_preference_ready (QmiClientNas *c
if (!output) { if (!output) {
mm_obj_dbg (self, "QMI operation failed: %s", error->message); mm_obj_dbg (self, "QMI operation failed: %s", error->message);
g_error_free (error); g_error_free (error);
priv->feature_nas_system_selection_preference = FEATURE_UNSUPPORTED; priv->feature_nas_ssp = FEATURE_UNSUPPORTED;
} else if (!qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { } 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); mm_obj_dbg (self, "couldn't get system selection preference: %s", error->message);
g_error_free (error); g_error_free (error);
priv->feature_nas_system_selection_preference = FEATURE_SUPPORTED; priv->feature_nas_ssp = FEATURE_SUPPORTED;
} else { } else {
qmi_message_nas_get_system_selection_preference_output_get_mode_preference ( qmi_message_nas_get_system_selection_preference_output_get_mode_preference (
output, output,
&ctx->capabilities_context.nas_ssp_mode_preference_mask, &ctx->capabilities_context.nas_ssp_mode_preference_mask,
NULL); NULL);
priv->feature_nas_system_selection_preference = FEATURE_SUPPORTED; priv->feature_nas_ssp = FEATURE_SUPPORTED;
} }
if (output) if (output)
@@ -982,8 +982,8 @@ load_current_capabilities_step (GTask *task)
return; return;
case LOAD_CURRENT_CAPABILITIES_STEP_LAST: case LOAD_CURRENT_CAPABILITIES_STEP_LAST:
g_assert (priv->feature_nas_technology_preference != FEATURE_UNKNOWN); g_assert (priv->feature_nas_tp != FEATURE_UNKNOWN);
g_assert (priv->feature_nas_system_selection_preference != FEATURE_UNKNOWN); g_assert (priv->feature_nas_ssp != FEATURE_UNKNOWN);
priv->current_capabilities = mm_modem_capability_from_qmi_capabilities_context (&ctx->capabilities_context, self); priv->current_capabilities = mm_modem_capability_from_qmi_capabilities_context (&ctx->capabilities_context, self);
g_task_return_int (task, priv->current_capabilities); g_task_return_int (task, priv->current_capabilities);
g_object_unref (task); g_object_unref (task);
@@ -1033,8 +1033,8 @@ mm_shared_qmi_load_current_capabilities (MMIfaceModem *self,
/* Current capabilities is the first thing run, and will only be run once per modem, /* Current capabilities is the first thing run, and will only be run once per modem,
* so we should here check support for the optional features. */ * so we should here check support for the optional features. */
priv = get_private (MM_SHARED_QMI (self)); priv = get_private (MM_SHARED_QMI (self));
g_assert (priv->feature_nas_technology_preference == FEATURE_UNKNOWN); g_assert (priv->feature_nas_tp == FEATURE_UNKNOWN);
g_assert (priv->feature_nas_system_selection_preference == FEATURE_UNKNOWN); g_assert (priv->feature_nas_ssp == FEATURE_UNKNOWN);
ctx = g_slice_new0 (LoadCurrentCapabilitiesContext); ctx = g_slice_new0 (LoadCurrentCapabilitiesContext);
ctx->nas_client = g_object_ref (nas_client); ctx->nas_client = g_object_ref (nas_client);
@@ -1093,7 +1093,7 @@ mm_shared_qmi_load_supported_capabilities (MMIfaceModem *self,
* switching only when switching GSM/UMTS+CDMA/EVDO multimode devices, and only if * switching only when switching GSM/UMTS+CDMA/EVDO multimode devices, and only if
* we have support for the commands doing it. * we have support for the commands doing it.
*/ */
if (priv->feature_nas_technology_preference == FEATURE_SUPPORTED || priv->feature_nas_system_selection_preference == FEATURE_SUPPORTED) { if (priv->feature_nas_tp == FEATURE_SUPPORTED || priv->feature_nas_ssp == FEATURE_SUPPORTED) {
if (mask == (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO)) { if (mask == (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO)) {
/* Multimode GSM/UMTS+CDMA/EVDO device switched to GSM/UMTS only */ /* Multimode GSM/UMTS+CDMA/EVDO device switched to GSM/UMTS only */
single = MM_MODEM_CAPABILITY_GSM_UMTS; single = MM_MODEM_CAPABILITY_GSM_UMTS;
@@ -1339,12 +1339,12 @@ mm_shared_qmi_set_current_modes (MMIfaceModem *self,
priv = get_private (MM_SHARED_QMI (self)); priv = get_private (MM_SHARED_QMI (self));
if (priv->feature_nas_system_selection_preference == FEATURE_SUPPORTED) { if (priv->feature_nas_ssp == FEATURE_SUPPORTED) {
set_current_modes_system_selection_preference (task); set_current_modes_system_selection_preference (task);
return; return;
} }
if (priv->feature_nas_technology_preference == FEATURE_SUPPORTED) { if (priv->feature_nas_tp == FEATURE_SUPPORTED) {
set_current_modes_technology_preference (task); set_current_modes_technology_preference (task);
return; return;
} }
@@ -1582,12 +1582,12 @@ mm_shared_qmi_load_current_modes (MMIfaceModem *self,
priv = get_private (MM_SHARED_QMI (self)); priv = get_private (MM_SHARED_QMI (self));
if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { if (priv->feature_nas_ssp != FEATURE_UNSUPPORTED) {
load_current_modes_system_selection_preference (task); load_current_modes_system_selection_preference (task);
return; return;
} }
if (priv->feature_nas_technology_preference != FEATURE_UNSUPPORTED) { if (priv->feature_nas_tp != FEATURE_UNSUPPORTED) {
load_current_modes_technology_preference (task); load_current_modes_technology_preference (task);
return; return;
} }
@@ -1638,7 +1638,7 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self,
g_array_append_val (all, mode); g_array_append_val (all, mode);
/* If SSP and TP are not supported, ignore supported mode management */ /* If SSP and TP are not supported, ignore supported mode management */
if (priv->feature_nas_system_selection_preference == FEATURE_UNSUPPORTED && priv->feature_nas_technology_preference == FEATURE_UNSUPPORTED) { if (priv->feature_nas_ssp == FEATURE_UNSUPPORTED && priv->feature_nas_tp == FEATURE_UNSUPPORTED) {
g_task_return_pointer (task, all, (GDestroyNotify) g_array_unref); g_task_return_pointer (task, all, (GDestroyNotify) g_array_unref);
g_object_unref (task); g_object_unref (task);
return; return;
@@ -1655,7 +1655,7 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self,
if (MODE4 != MM_MODEM_MODE_NONE) \ if (MODE4 != MM_MODEM_MODE_NONE) \
mode.allowed |= MODE4; \ mode.allowed |= MODE4; \
} \ } \
if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { \ if (priv->feature_nas_ssp != FEATURE_UNSUPPORTED) { \
if (MODE3 != MM_MODEM_MODE_NONE) { \ if (MODE3 != MM_MODEM_MODE_NONE) { \
if (MODE4 != MM_MODEM_MODE_NONE) { \ if (MODE4 != MM_MODEM_MODE_NONE) { \
mode.preferred = MODE4; \ mode.preferred = MODE4; \
@@ -1697,7 +1697,7 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self,
/* 5G related mode combinations are only supported when NAS SSP is supported, /* 5G related mode combinations are only supported when NAS SSP is supported,
* as there is no 5G support in NAS TP. */ * as there is no 5G support in NAS TP. */
if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { if (priv->feature_nas_ssp != FEATURE_UNSUPPORTED) {
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_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE);
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_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_3G, MM_MODEM_MODE_5G, MM_MODEM_MODE_NONE, MM_MODEM_MODE_NONE);
@@ -1866,8 +1866,8 @@ load_bands_get_system_selection_preference_ready (QmiClientNas *client,
NULL)) NULL))
extended_lte_band_preference_size = G_N_ELEMENTS (extended_lte_band_preference); extended_lte_band_preference_size = G_N_ELEMENTS (extended_lte_band_preference);
if (G_UNLIKELY (priv->feature_extended_lte_band_preference == FEATURE_UNKNOWN)) if (G_UNLIKELY (priv->feature_nas_ssp_extended_lte_band_preference == FEATURE_UNKNOWN))
priv->feature_extended_lte_band_preference = extended_lte_band_preference_size ? FEATURE_SUPPORTED : FEATURE_UNSUPPORTED; 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, mm_bands = mm_modem_bands_from_qmi_band_preference (band_preference_mask,
lte_band_preference_mask, lte_band_preference_mask,
@@ -1987,14 +1987,14 @@ mm_shared_qmi_set_current_bands (MMIfaceModem *self,
mm_modem_bands_to_qmi_band_preference (bands_array, mm_modem_bands_to_qmi_band_preference (bands_array,
&qmi_bands, &qmi_bands,
&qmi_lte_bands, &qmi_lte_bands,
priv->feature_extended_lte_band_preference == FEATURE_SUPPORTED ? extended_qmi_lte_bands : NULL, priv->feature_nas_ssp_extended_lte_band_preference == FEATURE_SUPPORTED ? extended_qmi_lte_bands : NULL,
G_N_ELEMENTS (extended_qmi_lte_bands), G_N_ELEMENTS (extended_qmi_lte_bands),
self); self);
input = qmi_message_nas_set_system_selection_preference_input_new (); input = qmi_message_nas_set_system_selection_preference_input_new ();
qmi_message_nas_set_system_selection_preference_input_set_band_preference (input, qmi_bands, NULL); qmi_message_nas_set_system_selection_preference_input_set_band_preference (input, qmi_bands, NULL);
if (mm_iface_modem_is_3gpp_lte (self)) { if (mm_iface_modem_is_3gpp_lte (self)) {
if (priv->feature_extended_lte_band_preference == FEATURE_SUPPORTED) if (priv->feature_nas_ssp_extended_lte_band_preference == FEATURE_SUPPORTED)
qmi_message_nas_set_system_selection_preference_input_set_extended_lte_band_preference ( qmi_message_nas_set_system_selection_preference_input_set_extended_lte_band_preference (
input, input,
extended_qmi_lte_bands[0], extended_qmi_lte_bands[0],