aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-06-28base-modem,at: response processors return a more specific enumAleksander Morgado
Instead of using the FALSE return of the method to indicate either a fatal error (if result_error was set) or the continuation request (if result_error wasn't set), provide a enum that has explicit states for all three possible values (failure, success or continue).
2020-06-28base-modem,at: improve documentation on response processor methodsAleksander Morgado
2020-06-28broadband-modem: run implicit disabling if enabling failsAleksander Morgado
The disabling sequence is updated so that the steps to disable the interfaces never fail. This is done so that the modem is not left in an "inconsistent" enabled state, if e.g. the modem is enabled and one of the disabling steps for the interfaces ends up failing. In this case, it is preferred to say that the modem is disabled, than having it wrongly enabled. The enabling sequence is updated so that if any of the steps to enable the interfaces fail, we end up running an implicit disabling operation to disable all the interfaces. This is to attempt to cleanup whatever we had enabled during the enabling operation, including e.g. the open ports context.
2020-06-24broadband-modem-qmi: fix assertion when disabling unsolicited eventsAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/230
2020-06-23broadband-modem-qmi,bearer-qmi: avoid depending on the client versionAleksander Morgado
The QMI client version is an information provided by the QMI protocol only when QMUX or MBIM backends are used, it won't be available when e.g. QRTR is used. The logic in ModemManager should not rely on this information.
2020-06-22blacklist: add chinese clone of Arduino nanoAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/228
2020-06-17mm-kernel-device: give cmp a total orderEric Caruso
This allows MMKernelDevice::cmp to compare two kernel devices with different object types, which means that subclasses can continue to only handle comparisons with their own type. The order may not be stable across builds.
2020-06-12broadband-modem-qmi: also build 5GS reg state from Serving SystemAleksander Morgado
2020-06-12broadband-modem-qmi: avoid using stale EPS registration stateAleksander Morgado
When the device goes from LTE to UMTS, we must make sure we also always update the EPS registration state as unknown, or the built consolidated state will be wrong. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/225
2020-06-05broadband-modem-qmi: switch USSD state to idle when ussd session is ↵Maxim Anisimov
terminated by network The cellular operator can break the interactive USSD session. In this case, it is necessary to process this situation otherwise --3gpp-ussd-initiate or --3gpp-ussd-respond will give an error. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2020-06-05sms-part-3gpp: fix unicode names in sms decode iconv() operationsMaxim Anisimov
So that the limited iconv() in OpenWRT supports the conversion properly. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2020-06-04filter: setup automatic per-vid checks in the plugin whitelistAleksander Morgado
Until now, the plugin whitelist rule in the filter would only handle those plugins that require specific udev tags, and those that had explicit full vid:pid pairs. This update makes a new implicit automatic whitelist for all devices that match any of the vids managed by the different plugins. Looking at the current list of devices in the blacklist and greylist maintained by ModemManager, there are no devices falling under the list of supported plugin vids that would need to be blacklisted; except for u-blox GPS modules: huawei -> 0x12d1 -> None in blacklist/greylist thuraya -> 0x1a26 -> None in blacklist/greylist telit -> 0x1bc7 -> None in blacklist/greylist dLink -> 0x2001 -> None in blacklist/greylist wavecom -> 0x114f -> None in blacklist/greylist x22x -> 0x1bbb,0x0b3c -> None in blacklist/greylist anydata -> 0x16d5 -> None in blacklist/greylist quectel -> 0x2c7c -> None in blacklist/greylist haier -> 0x201e -> None in blacklist/greylist novatel -> 0x1410 -> None in blacklist/greylist dell -> 0x413c -> None in blacklist/greylist option -> 0x0af0,0x1931 -> None in blacklist/greylist nokia -> 0x0421 -> None in blacklist/greylist cinterion -> 0x1e2d,0x0681 -> None in blacklist/greylist simtech -> 0x1e0e -> None in blacklist/greylist iridium -> 0x1edd -> None in blacklist/greylist pantech -> 0x106c -> None in blacklist/greylist longcheer -> 0x1c9e,0x1bbb -> None in blacklist/greylist linktop -> 0x230d -> None in blacklist/greylist sierra -> 0x1199 -> None in blacklist/greylist ublox -> 0x1546 -------------> GPS chips blacklisted !!!!! foxconn -> 0x0489 -> None in blacklist/greylist broadmobi -> 0x2020 -> None in blacklist/greylist fibocom -> 0x2cb7 -> None in blacklist/greylist tplink -> 0x2357 -> None in blacklist/greylist zte -> 0x19d2 -> None in blacklist/greylist The rules used to blacklist the u-blox GPS chips have already been moved to the u-blox plugin itself, and now they use the broader ID_MM_DEVICE_IGNORE tag that applies in all filter modes.
2020-06-04ublox: fully ignore GPS devices with plugin-installed rulesAleksander Morgado
Instead of setting up the ID_MM_TTY_BLACKLIST tag used in 'legacy' filter mode, tag all known u-blox GPS devices with the broader ID_MM_DEVICE_IGNORE tag that applies under all filter modes. Also, make this rules be installed by the plugin itself, because at the end, it is the u-blox plugin the one attempting to probe all devices with vid 0x1546.
2020-06-01filter: 'strict' is the new defaultAleksander Morgado
The 'strict' filter policy is less invasive, as it will not touch TTYs unless there are clear indications that it may be a modem. Under this mode, the ModemManager-provided blacklist database is not used.
2020-06-01filter: rename 'default' to 'legacy'Aleksander Morgado
The old 'default' policy is renamed to 'legacy', and is considered now deprecated.
2020-06-01shared-qmi: require minimum set of NMEA types before starting GNSS engineAleksander Morgado
2020-06-01broadband-modem-qmi: plug memleak when changing current firmwareAleksander Morgado
==80079== 104 (40 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 4,761 of 5,232 ==80079== at 0x483977F: malloc (vg_replace_malloc.c:309) ==80079== by 0x5025AE9: g_malloc (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x5006223: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x505B0F4: g_array_sized_new (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x2008A3: firmware_change_current (mm-broadband-modem-qmi.c:8426) ==80079== by 0x1AB5F3: select_auth_ready (mm-iface-modem-firmware.c:225) ==80079== by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==80079== by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==80079== by 0x17402E: authorize_ready (mm-base-modem.c:1363) ==80079== by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==80079== by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==80079== by 0x15366D: check_authorization_ready (mm-auth-provider.c:99)
2020-06-01iface-modem-firmware: plug memleak when listing imagesAleksander Morgado
==80079== 1,377 (48 direct, 1,329 indirect) bytes in 1 blocks are definitely lost in loss record 5,200 of 5,232 ==80079== at 0x483977F: malloc (vg_replace_malloc.c:309) ==80079== by 0x5025AE9: g_malloc (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x5006223: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x4FEB59B: ??? (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x4FEE378: g_variant_builder_end (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x48F8314: mm_firmware_properties_get_dictionary (mm-firmware-properties.c:337) ==80079== by 0x1AAF29: load_current_ready (mm-iface-modem-firmware.c:80) ==80079== by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==80079== by 0x4E68688: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==80079== by 0x502B58E: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x502D530: ??? (in /usr/lib/libglib-2.0.so.0.6400.2) ==80079== by 0x502E542: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.6400.2)
2020-05-27iface-modem-voice: fix assertions in call setup/teardown logicAleksander Morgado
2020-05-27blacklist: add USB CEC adaptersAleksander Morgado
These are not being probed when using the STRICT filter, so this blacklist update is relevant only for DEFAULT filter type. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/212
2020-05-26charsets: take_and_convert() methods should support GSM encodingAleksander Morgado
The iconv() operation would fail because we wouldn't give any proper charset string to convert to/from. Use our custom GSM encoding support instead.
2020-05-26charsets,test: extend UCS2->UTF-8 testing for the reverse operationAleksander Morgado
2020-05-26charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8Aleksander Morgado
This would really be an implementation detail, not a real use case. Just don't warn in this case, as in the conversion in the opposite direction.
2020-05-26Revert "charsets: don't warn in unlikely case of needing to convert to HEX ↵Aleksander Morgado
from UTF-8" This reverts commit 6a7dd87f30b2cc1b459abab38a0805aa8ba1bfbc. Reverting because the merge request was set to squash all together....
2020-05-26charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8Giacinto Cifelli
This would really be an implementation detail, not a real use case. Just don't warn in this case, as in the conversion in the opposite direction.
2020-05-25broadband-modem-qmi: only use "Data Service Capabilities" array if content givenAleksander Morgado
See https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/32#note_505065
2020-05-21iface-modem-voice: fix assert() when setting up call pollingAleksander Morgado
If an incoming call is detected during the CLCC polling, the polling timeout will already be set, so don't assert when checking the polling id afterwards, just make sure we don't reset the timeout. https://lists.freedesktop.org/archives/modemmanager-devel/2020-May/007866.html
2020-05-19test-qcdm-serial-port: fix warnings with -Wsign-compareAleksander Morgado
test-qcdm-serial-port.c: In function 'wait_for_child': test-qcdm-serial-port.c:57:52: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (d->child && (now.tv_sec - start.tv_sec > timeout)) { ^
2020-05-19iface-modem-messaging: avoid cast-align errorsAleksander Morgado
We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. mm-iface-modem-messaging.c: In function 'load_supported_storages_ready': mm-iface-modem-messaging.c:1154:53: error: cast increases required alignment of target type [-Werror=cast-align] mem1 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem1->data, ^ mm-iface-modem-messaging.c:1156:53: error: cast increases required alignment of target type [-Werror=cast-align] mem2 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem2->data, ^ mm-iface-modem-messaging.c:1158:53: error: cast increases required alignment of target type [-Werror=cast-align] mem3 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem3->data, ^
2020-05-19iface-modem-location: avoid warnings with -Wsign-compareAleksander Morgado
mm-iface-modem-location.c: In function 'location_gps_update_nmea': mm-iface-modem-location.c:272:61: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] time (NULL) - ctx->location_gps_nmea_last_time >= mm_gdbus_modem_location_get_gps_refresh_rate (skeleton))) { ^~ mm-iface-modem-location.c:282:60: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] time (NULL) - ctx->location_gps_raw_last_time >= mm_gdbus_modem_location_get_gps_refresh_rate (skeleton))) { ^~
2020-05-19iface-modem: avoid cast-align errorsAleksander Morgado
We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. mm-iface-modem.c: In function 'after_set_load_current_bands_ready': mm-iface-modem.c:2358:55: error: cast increases required alignment of target type [-Werror=cast-align] requested_str = mm_common_build_bands_string ((MMModemBand *)requested_bands->data, requested_bands->len); ^ mm-iface-modem.c:2359:55: error: cast increases required alignment of target type [-Werror=cast-align] current_str = mm_common_build_bands_string ((MMModemBand *)current_bands->data, current_bands->len); ^ mm-iface-modem.c: In function 'validate_bands': mm-iface-modem.c:2474:48: error: cast increases required alignment of target type [-Werror=cast-align] (const MMModemBand *)supported_bands_array->data, ^ mm-iface-modem.c: In function 'mm_iface_modem_set_current_bands': mm-iface-modem.c:2535:50: error: cast increases required alignment of target type [-Werror=cast-align] bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array->data, ^
2020-05-19modem-helpers: use GPtrArray to build a GStrvAleksander Morgado
So that we avoid errors when building on ARM due to increasing target type alignment. mm-modem-helpers.c: In function 'mm_3gpp_parse_cnum_exec_response': mm-modem-helpers.c:3206:21: error: cast increases required alignment of target type [-Werror=cast-align] return (array ? (GStrv) g_array_free (array, FALSE) : NULL); ^
2020-05-18AT modem: charset definition in initGiacinto Cifelli
Charset definition moved from enable state machine to init state machine, so that the right current charset is available also during further initialization steps
2020-05-16port-qmi: plug memleak when explicitly releasing clientAleksander Morgado
==43111== 24 bytes in 1 blocks are definitely lost in loss record 1,999 of 5,339 ==43111== at 0x483BB65: calloc (vg_replace_malloc.c:762) ==43111== by 0x50259D1: g_malloc0 (in /usr/lib/libglib-2.0.so.0.6400.2) ==43111== by 0x22AAB8: mm_port_qmi_allocate_client (mm-port-qmi.c:201) ==43111== by 0x2007F0: parent_enabling_started_ready (mm-broadband-modem-qmi.c:9114) ==43111== by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==43111== by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==43111== by 0x1C535E: enabling_flash_done (mm-broadband-modem.c:10318) ==43111== by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==43111== by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2) ==43111== by 0x224F0B: flash_do (mm-port-serial.c:1776) ==43111== by 0x502AC03: ??? (in /usr/lib/libglib-2.0.so.0.6400.2) ==43111== by 0x502B58E: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6400.2) ==43111==
2020-05-10port: use correct enum to string conversion when loggingAleksander Morgado
CC mm-port.lo mm-port.c: In function 'log_object_build_id': mm-port.c:117:60: error: implicit conversion from 'MMPortType' to 'MMModemPortType' [-Werror=enum-conversion] 117 | mm_modem_port_type_get_string (mm_port_get_port_type (self))); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
2020-05-08bearer-qmi: get correct bearer object pointer from taskAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/207
2020-04-22broadband-modem-qmi: GByteArray can be casted to GArray in USSD encodingAleksander Morgado
Reported by: Maxim Anisimov <linaro85@yandex.ru>
2020-04-22broadband-modem-qmi: USSD data in UTF-16 not always givenMaxim Anisimov
E.g. in the Quectel EP06-E only the ASCII/UCS-2 data TLV is given.
2020-04-22broadband-modem-qmi: fix unicode names in USSD iconv() operationsMaxim Anisimov
So that the limited iconv() in OpenWRT supports the conversion properly.
2020-04-20broadband-modem-qmi: 3GPP USSD supportAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/26
2020-04-10base-bearer: log connection attempt failure reasonAleksander Morgado
We were logging it as debug, increase logging level to warning to make sure it's always logged.
2020-04-10base-bearer: log stats on disconnectionAleksander Morgado
2020-04-10base-bearer: don't run disconnection path multiple timesAleksander Morgado
2020-04-10api,bearer: add 'total-rx-bytes', 'total-tx-bytes' and 'total-duration' statsAleksander Morgado
Compiling the amount of bytes transferred and received during all tracked connection attempts, as well as the total duration of all the connections.
2020-04-10api,bearer: add 'attempts' and 'failed-attempts' statisticsAleksander Morgado
When we're reusing over and over the same bearer object, we can provide statistical information about the number of connection attempts that have been done and how many of them failed.
2020-04-10broadband-modem-qmi: since 1.24.6 all strings are valid UTF-8Aleksander Morgado
2020-04-10broadband-modem-qmi: request operator reload explicitlyAleksander Morgado
If the modem switches from one roaming operator to a different roaming operator, the actual operator MCCMNC/description will change even if the registration state keeps on being the same (roaming). Detect that, and trigger operator info reloading explicitly.
2020-04-10broadband-modem-mbim: request operator reload explicitlyAleksander Morgado
If the modem switches from one roaming operator to a different roaming operator, the actual operator MCCMNC/description will change even if the registration state keeps on being the same (roaming). Detect that, and trigger operator info reloading explicitly. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/154
2020-04-09broadband-modem-qmi: explicitly disable autoconnect during enableAleksander Morgado
If the QMI device has autoconnect enabled, it will collide in one way or another with the ModemManager triggered connection sequence, usually because the user-requested settings are different to the autoconnected ones. So, detect whether autoconnect is enabled or not, and if it is, explicitly disable it.
2020-04-09port-qmi: allow users to release clients when no longer neededAleksander Morgado