aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-03-13 15:42:14 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-03-13 15:42:14 +0100
commitb88e85380254aecc709de7e65dfc678143517896 (patch)
tree9399498fbdc56e304bb26bdd37c8481d1edcb5d4
parentec7c8cc55aac77ce5cba087429c316bba790a780 (diff)
modem-helpers-qmi: explicitly add LTE as current cap if modem caps report italeksander/current-capabilities
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).
-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 af076734..044497a4 100644
--- a/src/mm-modem-helpers-qmi.c
+++ b/src/mm-modem-helpers-qmi.c
@@ -1160,6 +1160,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;