diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2022-01-31 22:42:48 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-01-31 22:48:57 +0100 |
commit | 9c08e54fb9d2f0b9341c2c98291551d8c9917c78 (patch) | |
tree | 4bd01c0b57072bb34e7d7622c17407fb5c40acec /src/mm-shared-qmi.c | |
parent | c7ff014e07ee5bfcfa4ba7e235c1c234ad77245a (diff) |
shared-qmi: filter out modes not currently available
Do not build the mask of "all" modes based only on the supported radio
interfaces, also filter out those modes that would not be available
based on the current capabilities enabled.
Diffstat (limited to 'src/mm-shared-qmi.c')
-rw-r--r-- | src/mm-shared-qmi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c index e0d62dc5..1447a7ce 100644 --- a/src/mm-shared-qmi.c +++ b/src/mm-shared-qmi.c @@ -1703,6 +1703,14 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self, for (i = 0; i < priv->supported_radio_interfaces->len; i++) ctx.all |= mm_modem_mode_from_qmi_radio_interface (g_array_index (priv->supported_radio_interfaces, QmiDmsRadioInterface, i), self); + /* Filter out those unsupported by the current capabilities */ + if (!(priv->current_capabilities & (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO))) + ctx.all &= ~(MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + else if (!(priv->current_capabilities & MM_MODEM_CAPABILITY_LTE)) + ctx.all &= ~MM_MODEM_MODE_4G; + else if (!(priv->current_capabilities & MM_MODEM_CAPABILITY_5GNR)) + ctx.all &= ~MM_MODEM_MODE_5G; + 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; |