aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-firmware.c
AgeCommit message (Collapse)Author
2023-10-27core: ensure all errors returned in DBus operations are normalizedAleksander Morgado
We want to ensure that all errors reported via DBus operations are normalized to MM-specific errors. We don't want to return QMI or MBIM specific errors, as those are protocol specific and we don't want DBus clients to need to rely on knowing which is the protocol in use by the device.
2022-02-08iface-modem-firmware: expose device id builderDylan Van Assche
Expose the generic device id method as a public API for plugins. Plugins can call this method first and then add their own device ids on top in case the generic ones aren't specific enough like in the case of Quectel modems.
2021-10-23iface-modem-firmware: Initialize context to nullFrederic Martinsons
Without setting memory to NULL it is possible that ctx->list point to an unitialized pointer and trig a segfault when we free it (for example when the firmware list is not supported) Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-16iface-modem-firmware: allow plugins to ignore carrier infoAleksander Morgado
Skip building the firmware version information with carrier config information if the plugin already knows that the firmware upgrade method doesn't implement carrier-specific upgrade paths.
2020-11-16iface-modem-firmware: report generic IDs for both USB and PCI devicesAleksander Morgado
Instead of assuming that all modules supporting firmware upgrade are USB based.
2020-11-09broadband-modem-qmi: peeking QMI port only in QMI modemsAleksander Morgado
Move the logic out of the base modem, and make it applicable only for QMI modems.
2020-11-09broadband-modem-mbim: peeking MBIM port only in MBIM modemsAleksander Morgado
Move the logic out of the base modem, and make it applicable only for MBIM modems.
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-04-08iface-modem-firmware: port to use object loggingAleksander Morgado
2020-01-30iface-modem-firmware: fix warnings with -Wimplicit-fallthroughAleksander Morgado
mm-iface-modem-firmware.c:438:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 438 | ctx->step++; | ~~~~~~~~~^~ mm-iface-modem-firmware.c:440:5: note: here 440 | case INITIALIZATION_STEP_UPDATE_SETTINGS: | ^~~~ ...
2020-01-30iface-modem-firmware: fix warnings with -Wswitch-defaultAleksander Morgado
mm-iface-modem-firmware.c: In function ‘interface_initialization_step’: mm-iface-modem-firmware.c:435:5: error: switch missing default case [-Werror=switch-default] 435 | switch (ctx->step) { | ^~~~~~
2019-09-25iface-modem-firmware: use the explicit Firmware policyAleksander Morgado
The Firmware policy is always 'auth_admin'.
2019-08-02iface-modem-firmware: remove explicit GDestroyNotify cast on g_freeBen Chan
g_free is in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_free is thus not needed.
2019-04-02api,modem: new 'CarrierConfigurationRevision' propertyAleksander Morgado
Which reports the version of the currently active carrier configuration. We also update the firmware 'version' reported in the firmware settings so that carrier-specific upgrades can be performed (e.g. when the firmware stays the same but the MCFG is updated).
2019-04-02firmware: export a device id containing the carrier infoAleksander Morgado
In order to support different per-carrier upgrade paths in fwupd.
2019-01-03api,firmware: expose firmware versionAleksander Morgado
2019-01-03api,firmware: expose device idsAleksander Morgado
2019-01-03iface-modem-firmware: List() and Select() are now optionalAleksander Morgado
Since the Firmware interface now contains more actions and properties apart from List() and Select(), these two actions are now optional. Not all modems implementing the Firmware interface must implement these two methods.
2019-01-03iface-modem-firmware: make the interface always availableAleksander Morgado
We no longer "check for support" of this interface, it will always be available for all modem objects. The only implementation that used this interface was the QMI one, and only for a very small subset of devices (those supporting the "QMI DMS List Stored Images" operation). The logic was changed so that the list of stored images wasn't preloaded during the support check; it will now instead be preloaded during the first call to List().
2019-01-03api,firmware: new UpdateSettings propertyAleksander Morgado
2018-12-17iface-modem-firmware: fix reporting empty firmware listAleksander Morgado
ModemManager[2804]: <warn> [1545055222.508649] No valid firmware images listed. Assuming firmware unsupported. ModemManager[2804]: <debug> [1545055222.508665] firmware list loading failed: unsupported ModemManager[2804]: <debug> [1545055222.508683] Couldn't load firmware image list: firmware list unknown ModemManager[2804]: <debug> [1545055222.508728] Couldn't load current firmware image: current firmware unknown (ModemManager:2804): GLib-CRITICAL **: 15:00:22.508: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff75b39b6 in ?? () from /usr/lib/libglib-2.0.so.0 (gdb) bt #0 0x00007ffff75b39b6 in () at /usr/lib/libglib-2.0.so.0 #1 0x00007ffff75b4363 in g_logv () at /usr/lib/libglib-2.0.so.0 #2 0x00007ffff75b4560 in g_log () at /usr/lib/libglib-2.0.so.0 #3 0x00007ffff758867d in g_variant_builder_end () at /usr/lib/libglib-2.0.so.0 #4 0x00005555555e4d12 in load_current_ready (self=0x55555579c330, res=0x5555557388e0, ctx=0x5555557d6d80) at mm-iface-modem-firmware.c:84 #5 0x00007ffff778f194 in () at /usr/lib/libgio-2.0.so.0 #6 0x00007ffff778f1c9 in () at /usr/lib/libgio-2.0.so.0 #7 0x00007ffff75c4271 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0 #8 0x00007ffff75c5f89 in () at /usr/lib/libglib-2.0.so.0 #9 0x00007ffff75c6f62 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0 #10 0x0000555555597aa0 in main (argc=2, argv=0x7fffffffe488) at main.c:181
2017-10-20broadband-modem-qmi: avoid NULL success return in firmware_load_currentAleksander Morgado
Instead of assuming that NULL is a valid return, make sure we return an error instead. This also makes it sure that if the GTask gets cancelled, the result we set is always a valid GObject, so that the g_object_unref passed as GDestroyNotify can be safely called always. Not a big deal anyway, as the GTask cannot be currently cancelled.
2017-10-20broadband-modem-qmi: avoid NULL success return in firmware_load_listAleksander Morgado
Instead of assuming that NULL is a valid return, make sure we return an error instead.
2017-06-28iface-modem-firmware: port mm_iface_modem_firmware_initialize to use GTaskBen Chan
2017-03-29core: remove explicit GDestroyNotify cast on g_free / g_object_unrefBen Chan
g_free and g_object_unref are in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_free and g_object_unref is thus not needed.
2016-06-01iface-modem-firmware: clarify log message about unsupported firmware interfaceDan Williams
2012-10-11core: make sure objects retrieved with g_object_get() are valid in the ifacesAleksander Morgado
The interfaces usually retrieve objects (e.g. skeletons) from the Modem object using g_object_get(), but we didn't make sure that these objects were actually valid before using them. This should clean up errors happening when the modem gets unplugged and still some actions are ongoing. Should fix https://bugzilla.gnome.org/show_bug.cgi?id=685933
2012-10-05iface-modem-firmware: fix error reporting on firmware changeAleksander Morgado
2012-10-04iface-modem-firmware: new `MMIfaceModemFirmware' interfaceAleksander Morgado