aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmi-firmware-update/qfu-udev-helpers.c
Commit message (Collapse)AuthorAgeFilesLines
* qmi-firmware-update: remove explicit GDestroyNotify cast on g_free / ↵Ben Chan2017-03-291-1/+1
| | | | | | | | g_object_unref 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.
* qmi-firmware-update: fix build when udev support includedAleksander Morgado2017-02-131-0/+2
|
* qmi-firmware-update: allow building without udevAleksander Morgado2017-02-131-4/+11
| | | | | | We allow running FW updates even when udev isn't available in the system. In this case, though, only the manual operations will be supported (i.e. --reset and --update-qdl).
* qmi-firmware-update: plug memleakAleksander Morgado2017-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==14200== 308 (208 direct, 100 indirect) bytes in 1 blocks are definitely lost in loss record 1,163 of 1,191 ==14200== at 0x4C2AB8D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==14200== by 0x5D34B98: g_malloc (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5D4D0D2: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5D4D6FD: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5AC62B3: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5AA81FA: ??? (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5AA9C0C: g_object_newv (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5AAA3C3: g_object_new (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5789694: g_task_new (in /usr/lib/libgio-2.0.so.0.5000.2) ==14200== by 0x40D2E1: qfu_udev_helper_wait_for_device (qfu-udev-helpers.c:580) ==14200== by 0x40753D: qfu_device_selection_wait_for_tty (qfu-device-selection.c:211) ==14200== by 0x40A380: run_context_step_wait_for_tty (qfu-updater.c:798) ==14200== ==14200== 308 (208 direct, 100 indirect) bytes in 1 blocks are definitely lost in loss record 1,164 of 1,191 ==14200== at 0x4C2AB8D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==14200== by 0x5D34B98: g_malloc (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5D4D0D2: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5D4D6FD: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5AC62B3: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5AA81FA: ??? (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5AA9C0C: g_object_newv (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5AAA3C3: g_object_new (in /usr/lib/libgobject-2.0.so.0.5000.2) ==14200== by 0x5789694: g_task_new (in /usr/lib/libgio-2.0.so.0.5000.2) ==14200== by 0x40D2E1: qfu_udev_helper_wait_for_device (qfu-udev-helpers.c:580) ==14200== by 0x4074DD: qfu_device_selection_wait_for_cdc_wdm (qfu-device-selection.c:195) ==14200== by 0x409977: run_context_step_wait_for_cdc_wdm (qfu-updater.c:579)
* qmi-firmware-update: plug memleakAleksander Morgado2017-02-101-1/+1
| | | | | | | | | | | | ==14200== 52 bytes in 1 blocks are definitely lost in loss record 792 of 1,191 ==14200== at 0x4C2AB8D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==14200== by 0x5D34B98: g_malloc (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x5D4EC3E: g_strdup (in /usr/lib/libglib-2.0.so.0.5000.2) ==14200== by 0x40C16D: udev_helper_get_udev_device_details (qfu-udev-helpers.c:94) ==14200== by 0x40C72C: udev_helper_find_by_device_info_in_subsystem (qfu-udev-helpers.c:263) ==14200== by 0x40C978: qfu_udev_helper_find_by_device_info (qfu-udev-helpers.c:314) ==14200== by 0x4076A9: qfu_device_selection_new (qfu-device-selection.c:264) ==14200== by 0x406A99: main (qfu-main.c:559)
* build: update copyright yearsAleksander Morgado2017-02-101-1/+1
|
* qmi-firmware-update: GUdevDevice shouldn't outlive the GUdevClientAleksander Morgado2017-02-011-53/+43
| | | | | | | | | | | Make sure all GUdevDevice objects created during the helper methods aren't unref-ed after the GUdevClient that created them. This is because the udev context is owned by the GUdevClient but also used (without any full reference) by all udev_devices (i.e. GUdevDevices) created from that same context. Quite easy to reproduce when using libudev < 218.
* qmi-firmware-update: new generic monitor to debug all udev eventsAleksander Morgado2017-01-201-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | As soon as we know the sysfs path of the device to use, we'll setup a generic udev monitor for all tty, net and usb devices so that we get notified of all their additions or removals. E.g. when going from normal mode to QDL download mode: [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove ttyUSB0 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove ttyUSB1 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove 4-1.4:1.0 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove wwan0 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove 4-1.4:1.2 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove ttyUSB2 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove 4-1.4:1.3 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove cdc-wdm2 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove 4-1.4:1.8 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove wwan1 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove cdc-wdm3 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove 4-1.4:1.10 [20 ene 2017, 12:49:26] [Debug] [qfu-udev] event: remove 4-1.4 [20 ene 2017, 12:49:27] [Debug] [qfu-udev] event: add 4-1.4 [20 ene 2017, 12:49:27] [Debug] [qfu-udev] event: add 4-1.4:1.0 [20 ene 2017, 12:49:27] [Debug] [qfu-udev] event: add ttyUSB0 [20 ene 2017, 12:49:27] [Debug] [qfu-udev] waiting device (tty) matched: ttyUSB0 [20 ene 2017, 12:49:27] [Debug] [qfu-updater] TTY device found: /dev/ttyUSB0
* qmi-firmware-update: waiting for power cycle up to 120sAleksander Morgado2017-01-161-1/+1
| | | | | The MC7455 may need around 70s for a complete reboot when selecting a firmware preference for already stored images.
* qmi-firmware-update: small fix in udev event managementChristophe Ronco2017-01-161-0/+2
|
* qmi-firmware-update: new 'device selection' objectAleksander Morgado2017-01-161-0/+28
| | | | | This new object contains the logic to select which device needs to be used as target of the firmware upgrade.
* qmi-firmware-update: allow specifying devices by vid:pid or bus:devAleksander Morgado2017-01-161-127/+374
|
* qmi-firmware-update: improve logging on udev eventsAleksander Morgado2017-01-161-3/+9
|
* qmi-firmware-update: fix expected drivers in cdc-wdm portsAleksander Morgado2017-01-161-1/+1
|
* qmi-firmware-update: device power cycle may take longer than 15sAleksander Morgado2017-01-161-1/+1
|
* qmi-firmware-update: wait for cdc-wdm device after image downloadAleksander Morgado2017-01-161-59/+120
|
* qmi-firmware-update: wait for TTY after resetAleksander Morgado2017-01-161-0/+157
|
* qmi-firmware-update: new QfuUpdater with the core upgrade logicAleksander Morgado2017-01-161-0/+110
Initially, load sysfs path and setup state machine.