1. 08 Jan, 2020 5 commits
  2. 06 Jan, 2020 2 commits
  3. 12 Dec, 2019 2 commits
  4. 11 Dec, 2019 1 commit
    • Aleksander Morgado's avatar
      libqmi-glib,device: check message id before assuming valid response · 4a04bd4f
      Aleksander Morgado authored
      If the transaction id ends up mismatched between device and libqmi due
      to some reason, we may end up assuming a response is of a given type
      when it isn't in reality.
      
      Make sure this does not happen, as this would end up triggering a
      g_return_val_if_fail() check that returns a NULL reply by the parser
      without GError set, and the users of libqmi, like MM here may not
      like that:
      
        ERR daemon ModemManager[4842]: __qmi_message_ctl_set_data_format_response_parse: assertion 'qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_SET_DATA_FORMAT' failed
        ERR daemon ModemManager[4842]: __qmi_message_ctl_allocate_cid_response_parse: assertion 'qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_ALLOCATE_CID' failed
        WARNIN user kernel:[ 687.347162] /tmp/ModemManager.4842.6.1575343251.core core dumped
      
      The internal response_parse() methods used by libqmi should always be
      used when we know that the response matches the expected type.
      
      (cherry picked from commit 69354f53)
      4a04bd4f
  5. 23 Nov, 2019 2 commits
  6. 22 Nov, 2019 1 commit
  7. 12 Nov, 2019 2 commits
  8. 30 Oct, 2019 1 commit
  9. 05 Oct, 2019 2 commits
    • A. Wilcox's avatar
      libqmi-glib: add small error test to test-message · 5a34924a
      A. Wilcox authored
      The previous commit was easier to diagnose with the error condition from
      qmi_message_new_from_data provided.  This change adds g_assert_no_error to
      the test_message_new_request_from_data case so that any future issues can
      be diagnosed quickly.
      
      (cherry picked from commit c7ba1ee1)
      5a34924a
    • A. Wilcox's avatar
      libqmi-glib: fix message creation on BE systems · 93da13a1
      A. Wilcox authored
      Creation of the fake QMUX header wrote the length as a native value, which
      caused the wrong value to be written on big endian systems.
      
      Before, a test run on a ppc64 system gave:
      
      ERROR:test-message.c:296:test_message_new_request_from_data: assertion failed: (self)
        /libqmi-glib/message/new/request:                                    OK
        /libqmi-glib/message/new/request-from-data:                          FAIL
      
      Adding a g_assert_no_error gave the more helpful message:
      
      ERROR:test-message.c:296:test_message_new_request_from_data: assertion failed (error == NULL): QMUX length and buffer length don't match (3072 != 12) (qmi_core_error_quark, 4)
      
      After this commit is applied, all tests pass on a big endian ppc64 system.
      
      (cherry picked from commit d9d1f330)
      93da13a1
  10. 21 Sep, 2019 1 commit
  11. 20 Sep, 2019 4 commits
  12. 18 Sep, 2019 5 commits
    • Aleksander Morgado's avatar
      qmi-codegen,client: use the new qmi_device_command_abortable() method · 01fcdf0b
      Aleksander Morgado authored
      If building client methods for commands that are abortable, make sure
      we use the new qmi_device_command_abortable() method so that there are
      no race conditions between an aborted operation and a successful
      response received before the abortion happened.
      
      This update should fix the race conditions seen in the following
      ModemManager merge request:
        https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/100
      01fcdf0b
    • Aleksander Morgado's avatar
      libqmi-glib,device: new qmi_device_command_abortable() method · 16019862
      Aleksander Morgado authored
      This new method should be used when a command is abortable and we want
      to wait for the abort operation to finish before returning the result
      of the operation.
      
      This logic solves race condition issues when e.g. a response to the
      original request arrives just after we have sent the abort, so the
      abort ends up failing. In this situation we should return the
      successful response to the user and forget about the internal abort
      sequence.
      16019862
    • Aleksander Morgado's avatar
    • Aleksander Morgado's avatar
      qmi-firmware-update: fix floating point exception with MC7455 · 4394c54c
      Aleksander Morgado authored
      If we attempt to run qmi-firmware-update on the MC7455, we first need
      to detect that the device is NOT a sahara device, and in order to do
      that we'll just try to create a QfuSaharaDevice.
      
      During this process, we will try to read from the ttyUSB0 the 'hello'
      message that the device sends to us, but it may happen that the device
      does not send anything at all and we would end up reading 0 bytes. If
      this happens, we should treat it as an indication that this is not a
      sahara device right away. If we don't do this, the protocol runner
      sahara_device_run_protocol_step() method will return STEP_UNKNOWN
      without any error set, which ends up making sahara_device_initialize()
      return FALSE without error, and that will make initable_init() wrongly
      succeed.
      
        [14 Aug 2019, 20:28:08] [Debug] [qfu-sahara-device] opening TTY: /dev/ttyUSB0
        [14 Aug 2019, 20:28:08] [Debug] [qfu-sahara-device] setting terminal in raw mode...
        [14 Aug 2019, 20:28:08] [Debug] [qfu-sahara-device] waiting time for device to boot properly...
        [14 Aug 2019, 20:28:10] [Debug] [qfu-sahara-device] initializing sahara protocol...
        [14 Aug 2019, 20:28:13] [Debug] [qfu-updater] selected file 'SWI9X30C_02.26.01.00.cwe' (64480431 bytes)
        downloading cwe image: SWI9X30C_02.26.01.00.cwe (64.5 MB)...
        Floating point exception (core dumped)
      
        #0  0x0000000000410a8b in qfu_sahara_device_firehose_setup_download (self=0x2110680, image=0x2124dc0, n_blocks=0x7ffc3baf5838,cancellable=0x211c240, error=0x7ffc3baf5860) at qfu-sahara-device.c:573
        #1  0x0000000000407b89 in download_image_firehose (device=0x2110680,#image=0x2124dc0, cancellable=0x211c240, error=0x7ffc3baf5860) at qfu-updater.c:691
        #2  0x00000000004080d9 in run_context_step_download_image (task=0x2125840) at qfu-updater.c:808
        #3  0x0000000000408595 in run_context_step (task=0x2125840) at qfu-updater.c:1490
        #4  0x00000000004077c9 in run_context_step_cb (task=0x2125840) at qfu-updater.c:366
        #5  0x00007fd1e0f0becc in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
        #6  0x00007fd1e0f0c238 in g_main_context_iterate.isra () from /usr/lib/libglib-2.0.so.0
        #7  0x00007fd1e0f0c492 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
        #8  0x00000000004067c8 in operation_update_run (updater=0x211c210, images=0x211b1f0) at qfu-operation-update.c:108
        #9  0x0000000000406862 in qfu_operation_update_download_run (images=0x211b1f0,#device_selection=0x211b820) at qfu-operation-update.c:163
        #10 0x0000000000405f3f in main (argc=1, argv=0x7ffc3baf5bf8) at qfu-main.c:726
      4394c54c
    • Aleksander Morgado's avatar
  13. 17 Sep, 2019 2 commits
  14. 03 Sep, 2019 1 commit
  15. 21 Aug, 2019 2 commits
  16. 01 Aug, 2019 4 commits
  17. 23 Jul, 2019 1 commit
    • Aleksander Morgado's avatar
      qmicli,gas: fix build with -Werror=shadow · a48f7ee2
      Aleksander Morgado authored
        qmicli-gas.c: In function 'print_firmware_listing':
        qmicli-gas.c:132:32: error: declaration of 'index' shadows a global declaration [-Werror=shadow]
        qmicli-gas.c: In function 'get_firmware_list_ready':
        qmicli-gas.c:155:12: error: declaration of 'index' shadows a global declaration [-Werror=shadow]
      a48f7ee2
  18. 19 Jul, 2019 1 commit
  19. 15 Jul, 2019 1 commit
    • Andreas Kling's avatar
      qmi-device: Fix -Wimplicit-fallthrough warnings. · 431aa9e7
      Andreas Kling authored
      qmi-device.c: In function ‘device_open_step’:
      qmi-device.c:1866:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
          ctx->step++;
          ~~~~~~~~~^~
      
      GCC checks for comments annotating intentional fallthrough, but it didn't
      recognize "Fall down", so this patch tweaks it to say "Fall through".
      431aa9e7