From bc4cbbe6cfda7b884084d888cf271759816e931f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 8 Mar 2017 12:18:23 +0100 Subject: broadband-modem: fix capabilities in 4G-only devices The +CGSM capability is saying that the modem is a 3GPP modem, but that doesn't necessarily mean it's a GSM/UMTS modem, it could be a LTE-only device. We did add the GSM_UMTS capability when +CGSM was found, so now we'll check if the device only reports 4G-only mode, and remove the capability if so. https://bugs.freedesktop.org/show_bug.cgi?id=100155 --- src/mm-broadband-modem.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index aa84fc7e..302fc3db 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -397,6 +397,21 @@ current_capabilities_ws46_test_ready (MMBaseModem *self, break; } } + + /* The +CGSM capability is saying that the modem is a 3GPP modem, but that + * doesn't necessarily mean it's a GSM/UMTS modem, it could be a LTE-only + * device. We did add the GSM_UMTS capability when +CGSM was found, so now + * we'll check if the device only reports 4G-only mode, and remove the + * capability if so. + * + * Note that we don't change the default +CGSM -> GSM/UMTS logic, we just + * fix it up. + */ + if ((modes->len == 1) && (g_array_index (modes, MMModemMode, 0) == MM_MODEM_MODE_4G)) { + g_assert (ctx->caps & MM_MODEM_CAPABILITY_LTE); + ctx->caps &= ~MM_MODEM_CAPABILITY_GSM_UMTS; + } + g_array_unref (modes); out: -- cgit v1.2.3-70-g09d2