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).
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user