aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmi-firmware-update
Commit message (Collapse)AuthorAgeFilesLines
* build: mm-runtime-check is an optional feature not an optional packageAleksander Morgado2017-02-233-5/+5
|
* qmi-firmware-update: new optional runtime check to see if MM runningAleksander Morgado2017-02-233-1/+94
| | | | | Enabled by default, may be disabled using --without-mm-runtime-check during configure.
* qmi-firmware-update: fix multiline command backslashes in --help-examplesAleksander Morgado2017-02-141-3/+3
|
* qmi-firmware-update: fix 9x20 typo in --help-examples outputAleksander Morgado2017-02-141-2/+2
|
* qmi-firmware-update: fix build when udev support includedAleksander Morgado2017-02-131-0/+2
|
* qmi-firmware-update: allow building without udevAleksander Morgado2017-02-1310-104/+276
| | | | | | 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: improve examplesAleksander Morgado2017-02-131-66/+103
| | | | Added example of how to manually update 9x15 and 9x30 devices.
* 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)
* qmi-firmware-update: explicitly async-close QmiDevice before exitingAleksander Morgado2017-02-101-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After an update operation, before exiting, we MUST close the QmiDevice using the asynchronous method, so that we wait for the inner 'MBIM close' message (when QMI over MBIM is being used). We don't want to leave the 'MBIM close done' message unread, as that seems to interfere with the next 'MBIM open' sequence. This sequence is incorrect: qmi-firmware-update ... --> mbim close (exit without reading response) qmi-firmware-update --> mbim open (seq 1) <-- mbim close done --> mbim open (seq 2) --> mbim open (seq 3) --> mbim open (seq 4) ... (times out) This sequence is correct: qmi-firmware-update ... --> mbim close <-- mbim close done (exit) qmi-firmware-update --> mbim open (seq 1) <-- mbim open done ...
* build: update copyright yearsAleksander Morgado2017-02-1026-26/+26
|
* qmi-firmware-update: avoid using deprecated qmi_device_close()Aleksander Morgado2017-02-092-3/+3
|
* qmi-firmware-update: support automatic mode (QMI/MBIM) detection by defaultAleksander Morgado2017-02-0810-60/+58
| | | | | | | | The default, if nothing specified, is the 'auto mode', which can also be explicitly selected with --device-open-auto. The user may also select an explicit mode with --device-open-mbim or --device-open-qmi.
* glib: remove invocations of g_type_init()Ben Chan2017-02-032-3/+0
| | | | | | | g_type_init() has been deprecated (and also marked with the attribute 'deprecated') since glib 2.36 as the type system is automatically initialized. Since the minimum version of glib required by libqmi is 2.36, calling g_type_init() isn't necessarily in the libqmi code.
* qmi-firmware-update: start wait sequence before QmiDevice closeAleksander Morgado2017-02-011-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [01 feb 2017, 23:14:53] [Debug] [qfu-updater] reset requested successfully... [01 feb 2017, 23:14:53] [Debug] [qfu-updater] cleaning up QMI device... [01 feb 2017, 23:14:53] [Debug] [/dev/cdc-wdm2] Releasing 'dms' client with flags 'none'... [01 feb 2017, 23:14:53] [Debug] [/dev/cdc-wdm2] Unregistered 'dms' client with ID '2' [01 feb 2017, 23:14:53] [Debug] [/dev/cdc-wdm2] Sent message... <<<<<< RAW: <<<<<< length = 12 <<<<<< data = 02:00:00:00:0C:00:00:00:0B:00:00:00 [01 feb 2017, 23:14:53] [Debug] [/dev/cdc-wdm2] Sent message (translated)... <<<<<< Header: <<<<<< length = 12 <<<<<< type = close (0x00000002) <<<<<< transaction = 11 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove ttyUSB0 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove ttyUSB1 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove wwan0 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove 2-1.4:1.0 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove 2-1.4:1.3 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove cdc-wdm2 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove 2-1.4:1.13 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove 2-1.4:1.12 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: remove 2-1.4 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add 2-1.4 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add 2-1.4:1.0 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add 2-1.4:1.3 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add 2-1.4:1.12 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add 2-1.4:1.13 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add cdc-wdm2 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add ttyUSB0 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add wwan0 [01 feb 2017, 23:15:13] [Debug] [qfu-udev] event: add ttyUSB1 [01 feb 2017, 23:15:13] [Debug] [qfu-updater] now waiting for cdc-wdm device... error: error waiting for cdc-wdm: waiting for device at '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4' timed out
* 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: no gudev header needed in helpers headerAleksander Morgado2017-02-011-1/+0
|
* qmi-firmware-update: plug several memleaksAleksander Morgado2017-02-013-0/+4
|
* qmi-firmware-update: use 'SWI Get Current Firmware' before and afterAleksander Morgado2017-01-294-6/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that we get the current running firmware details, e.g.: original firmware revision was: SWI9X15C_05.05.58.01 r27044 carmd-fwbuild1 2015/03/05 00:02:40 original running firmware details: Model: MC7354 Boot version: SWI9X15C_05.05.58.01 r27044 carmd-fwbuild1 2015/03/05 00:02:40 AMSS version: SWI9X15C_05.05.58.01 r27044 carmd-fwbuild1 2015/03/05 00:02:40 SKU ID: 1102016 Package ID: 1102016_9903211_SWI9X15C_05.05.16.02_00_Generic_005.004_000 Carrier ID: 5 original firmware preference details: image 'modem': unique id '005.029_001', build id '05.05.58.01_VZW' image 'pri': unique id '005.029_001', build id '05.05.58.01_VZW' new firmware revision is: SWI9X15C_05.05.63.01 r28860 CARMD-EV-FRMWR1 2015/07/02 11:04:50 new running firmware details: Model: MC7354 Boot version: SWI9X15C_05.05.63.01 r28860 CARMD-EV-FRMWR1 2015/07/02 11:04:50 AMSS version: SWI9X15C_05.05.63.01 r28860 CARMD-EV-FRMWR1 2015/07/02 11:04:50 SKU ID: 1102016 Package ID: 1102016_9903211_SWI9X15C_05.05.16.02_00_Generic_005.004_000 Carrier ID: 11 new firmware preference details: image 'modem': unique id '005.037_000', build id '05.05.63.01_SPRINT' image 'pri': unique id '005.037_000', build id '05.05.63.01_SPRINT' NOTE: this device supports firmware preference management with qmicli operations: --dms-get-firmware-preference --dms-set-firmware-preference
* qmi-firware-update: image size 0 is invalidAleksander Morgado2017-01-201-0/+6
|
* qmi-firmware-update: avoid logging when we don't detect sub-imagesAleksander Morgado2017-01-201-6/+2
|
* qmi-firmware-update: new generic monitor to debug all udev eventsAleksander Morgado2017-01-203-3/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: fix CRC checkingChristophe Ronco2017-01-171-1/+1
| | | | CRC is not well checked if there is an escape char in input buffer.
* qmi-firmware-update: fix seg fault in case of error in hdlc_unframeChristophe Ronco2017-01-171-1/+1
|
* qmi-firmware-update: new --modem-storage-index optionAleksander Morgado2017-01-168-1/+62
|
* qmi-firmware-update: new --override-download optionAleksander Morgado2017-01-165-1/+20
| | | | | | | | | | | | | | The Set Firmware Preference command may return an empty list of images to be downloaded. If that happens and we just power cycle, we won't get into QDL download mode, the module will just apply the new firmware selection preference. With the new --override-download option, we tell the module that even if we already have the images, we want to perform the download. This option doesn't apply to older SWI9200 devices as these don't have any firmware preference setting. The option is implicit for these devices, though, the download always happens.
* qmi-firmware-update: rename --force to --ignore-version-errorsAleksander Morgado2017-01-165-24/+24
| | | | The --force name is too generic, and we may want to have other similar flags.
* qmi-firmware-update: QmiDevice open flags are genericAleksander Morgado2017-01-161-8/+8
| | | | | These are no longer update-action specific, as they also apply e.g. when doing a reset.
* 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: print firmware preference before/after updateAleksander Morgado2017-01-164-58/+114
|
* qmi-firmware-update: if no download needed, still run resetAleksander Morgado2017-01-161-4/+10
| | | | | | | When selecting firmware preference we may be told that no firmware image needs to be downloaded, because it is already there. BUT, we still need to run the module power cycle so that on the next boot the new firmware preference is applied.
* qmi-firmware-update: allow skipping new firmware validationAleksander Morgado2017-01-168-10/+44
| | | | And increase amount of retries.
* qmi-firmware-update: use SYNC flag when opening deviceAleksander Morgado2017-01-161-1/+1
| | | | So that we reset any existing client ids.
* qmi-firmware-update: try to use DMS 0x0050 for boot and hold as wellAleksander Morgado2017-01-161-5/+88
| | | | | This is what more generic Qualcomm software (E.g. Novatel E396) does to get into QDL download mode.
* qmi-firmware-update: offline+reset based power cycle as helperAleksander Morgado2017-01-163-63/+151
|
* qmi-firmware-update: small fix in udev event managementChristophe Ronco2017-01-161-0/+2
|
* qmi-firmware-update: fix compilation inside yoctoChristophe Ronco2017-01-161-3/+3
| | | | | In Yocto, build is done outside source directory. Without this patch, generated enum files are empty.
* qmi-firmware-update: by default no warning messages, only errorsAleksander Morgado2017-01-162-2/+1
|
* qmi-firmware-update: retry reloading device info several timesAleksander Morgado2017-01-161-4/+20
| | | | | The device may need some extra time to properly boot after the cdc-wdm device is exposed by the kernel, so setup several retries to do so.
* qmi-firmware-update: improve stdout progress reportingAleksander Morgado2017-01-161-15/+47
|
* qmi-firmware-update: new option to enable verbose logging file outputAleksander Morgado2017-01-164-36/+79
| | | | | | So that we can run the operation in stdout with standard logging level but storing in an external file the verbose logs in case they have to be analyzed later on, e.g. if the update failed.
* qmi-firmware-update: load and print device capabilities after updateAleksander Morgado2017-01-161-5/+88
|
* qmi-firmware-update: load capabilities of the modem earlyAleksander Morgado2017-01-164-61/+201
| | | | Only for the update operation, though.
* qmi-firmware-update: warn about last chunk ack step taking longAleksander Morgado2017-01-161-1/+4
|
* qmi-firmware-update: don't release CID if reset operation successfulAleksander Morgado2017-01-162-34/+21
|
* qmi-firmware-update: prefer DMS 0x003e for boot & hold resetAleksander Morgado2017-01-166-49/+188
|
* qmi-firmware-update: make QMI client allocation a common utilAleksander Morgado2017-01-165-130/+222
|
* qmi-firmware-update: new 'device selection' objectAleksander Morgado2017-01-1613-347/+587
| | | | | This new object contains the logic to select which device needs to be used as target of the firmware upgrade.
* qmi-firmware-update: fix help of --vid-pidAleksander Morgado2017-01-161-1/+1
|
* qmi-firmware-update: use progress only for n_chunks-1Aleksander Morgado2017-01-161-4/+10
| | | | | | | | So that we don't get stuck e.g. at 98% on the last chunk waiting for it to be ack-ed, which may take a very long time. Instead, use progress for all chunks except for the last one and in the last one just say a generic "finalizing download...".