From 8432650b2a5da5b42dea1d0fcb604d0e4f9c6e5d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 12 Mar 2013 17:46:57 +0100 Subject: broadband-modem-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). --- src/mm-broadband-modem-qmi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index 4a316c55..676bca95 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -286,8 +286,17 @@ load_current_capabilities_get_capabilities_ready (QmiClientDms *client, */ if (ctx->capabilities == MM_MODEM_CAPABILITY_NONE) ctx->capabilities = mask; - else + else { ctx->capabilities &= mask; + + /* 4G is a special case here. We may not get 4G reported by TP/SSP + * because the current configuration is e.g. 2g-only, but still we can + * afterwards change to 4G allowed mode with either TP/SSP. So, if + * the modem reports LTE as capabilities, make sure we add it to the + * current capabilities, even if not currently allowed */ + if (mask & MM_MODEM_CAPABILITY_LTE) + ctx->capabilities |= MM_MODEM_CAPABILITY_LTE; + } } if (output) -- cgit v1.2.3