diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-03-08 12:18:23 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-03-24 21:29:59 +0100 |
commit | bc4cbbe6cfda7b884084d888cf271759816e931f (patch) | |
tree | 78c35a77faee3f6e3b2381ce37499ca7d2cd5d68 | |
parent | 16009114397a75d6e511942a6bd9fc74ea8a0d3f (diff) |
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
-rw-r--r-- | src/mm-broadband-modem.c | 15 |
1 files changed, 15 insertions, 0 deletions
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: |