aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-03-13 15:42:14 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-04-11 09:17:13 +0200
commit31215aba327a9151638ccc5ac37666e6efca3bb2 (patch)
tree546f80c71e4a1cd30dc888ba6e6d48fd639190e0 /src
parent162d96b11680bbdf819a3f8e1c058184abb7b792 (diff)
modem-helpers-qmi: explicitly add LTE as current cap if modem caps report it
For loading current capabilities we use a mix of "Technology Preference" (TP), "System Selection Preference" (SSP) and DMS-reported capabilities. But, as we also use TP and SSP for allowed modes, it may be the case that we end up leaving 4G out of the allowed modes, which afterwards will make the modem not report LTE as current capabilitiy, as TP/SSP don't include LTE. So, just assume LTE is a current capability if DMS-reported capabilities include it. We can really do this because LTE is the only 4G technology, the same logic wouldn't apply correctly for 2G or 3G (due to having different techs for 3GPP and 3GPP2).
Diffstat (limited to 'src')
-rw-r--r--src/mm-modem-helpers-qmi.c5
-rw-r--r--src/tests/test-modem-helpers-qmi.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c
index 3331de6a..efe3686d 100644
--- a/src/mm-modem-helpers-qmi.c
+++ b/src/mm-modem-helpers-qmi.c
@@ -1187,6 +1187,11 @@ mm_modem_capability_from_qmi_capabilities_context (MMQmiCapabilitiesContext *ctx
else
tmp &= ctx->dms_capabilities;
+ /* Modems which have 'LTE' capability reported by DMS will always have it
+ * reported in 'current capabilities', even if it may not be currently
+ * allowed (i.e. not selected in 'allowed-modes') */
+ if (ctx->dms_capabilities & MM_MODEM_CAPABILITY_LTE)
+ tmp |= MM_MODEM_CAPABILITY_LTE;
/* Log about the logic applied */
nas_ssp_mode_preference_str = qmi_nas_rat_mode_preference_build_string_from_mask (ctx->nas_ssp_mode_preference_mask);
diff --git a/src/tests/test-modem-helpers-qmi.c b/src/tests/test-modem-helpers-qmi.c
index 19e41882..178591f6 100644
--- a/src/tests/test-modem-helpers-qmi.c
+++ b/src/tests/test-modem-helpers-qmi.c
@@ -70,7 +70,9 @@ test_uml290 (void)
ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS |
MM_MODEM_CAPABILITY_CDMA_EVDO |
MM_MODEM_CAPABILITY_LTE);
- test_capabilities_expected (&ctx, MM_MODEM_CAPABILITY_CDMA_EVDO);
+ test_capabilities_expected (&ctx,
+ (MM_MODEM_CAPABILITY_CDMA_EVDO |
+ MM_MODEM_CAPABILITY_LTE));
/* QCDM -> GSM/UMTS */
ctx.nas_ssp_mode_preference_mask = (QMI_NAS_RAT_MODE_PREFERENCE_GSM |
@@ -81,7 +83,9 @@ test_uml290 (void)
ctx.dms_capabilities = (MM_MODEM_CAPABILITY_GSM_UMTS |
MM_MODEM_CAPABILITY_CDMA_EVDO |
MM_MODEM_CAPABILITY_LTE);
- test_capabilities_expected (&ctx, MM_MODEM_CAPABILITY_GSM_UMTS);
+ test_capabilities_expected (&ctx,
+ (MM_MODEM_CAPABILITY_GSM_UMTS |
+ MM_MODEM_CAPABILITY_LTE));
/* QCDM -> Automatic */
ctx.nas_ssp_mode_preference_mask = 0;