Skip to content
Snippets Groups Projects
  1. Jan 10, 2018
  2. Oct 08, 2017
  3. Sep 14, 2017
    • Aleksander Morgado's avatar
      build: add missing gtk-doc.m4 · 0cd2280b
      Aleksander Morgado authored
      Fixes: 9ef87239
      0cd2280b
    • Aleksander Morgado's avatar
      7becf366
    • Aleksander Morgado's avatar
      doc,atds: avoid redefining MbimAtdsProvider documentation · e50f84f3
      Aleksander Morgado authored
      MbimAtdsProvider is a struct and is already documented in the ATDS
      service doc.
      e50f84f3
    • Aleksander Morgado's avatar
      libmbim-glib,uuid: also document internal enum value · 6ec653bc
      Aleksander Morgado authored
      Just to make gtk-doc happy really.
      6ec653bc
    • Aleksander Morgado's avatar
      build: the m4 directory always exists · 040f3b43
      Aleksander Morgado authored
      Even when cloning a git checkout, as we have m4/compiler-warnings
      under version control.
      040f3b43
    • Aleksander Morgado's avatar
      build: import gtk-doc support · 9ef87239
      Aleksander Morgado authored
      Remove the need to run `gtkdocize' when building from git; this should
      be an operation done by the maintainer when modernizing the gtk-doc
      setup (think of e.g. gettextize), no need to do it unconditionally.
      
      This makes it easier for platforms without gtk-doc to build from git.
      
      When trying to build with documentation enabled and gtk-doc isn't
      found, we get some nice warnings and errors in the configure report:
      
          checking for gtk-doc... no
          configure: WARNING:
            You will not be able to create source packages with 'make dist'
            because gtk-doc >= 1.0 is not found.
          checking for gtkdoc-check... no
          checking for gtkdoc-check... no
          checking for gtkdoc-rebase... no
          checking for gtkdoc-mkpdf... no
          checking whether to build gtk-doc documentation... yes
          configure: error:
            You must have gtk-doc >= 1.0 installed to build documentation for
            ModemManager. Please install gtk-doc or disable building the
            documentation by adding '--disable-gtk-doc' to './configure'.
      
      Files generated with gtkdocize (gtk-doc) 1.26.1.
      9ef87239
    • Aleksander Morgado's avatar
      api: don't use intermediate variables for deprecation warnings · 4f0f3f85
      Aleksander Morgado authored
      Using an intermediate constant variable breaks compilation with C
      compilers, as these variables cannot be used as initializers.
      
      Instead, define a deprecated type and cast all deprecated symbols to
      that type. We lose the information about what the new replacement
      symbol is, but we don't break compilation.
      
      Also, add MBIM_DISABLE_DEPRECATED guards around deprecated symbols. So
      that when this symbol is defined, e.g. via CFLAGS, building a program
      that uses the libmbim API will fail if the program references
      deprecated symbols. For now we just use it to keep gtk-doc-scan happy
      and avoid unnecessary warnings.
      
      Equivalent to ModemManager commits eedd4ab4457 and f0bb6ef856.
      4f0f3f85
  4. Sep 12, 2017
    • Aleksander Morgado's avatar
      device: detect already open MBIM channel on EM7345 · 7626a078
      Aleksander Morgado authored
      If we try to 'MBIM open' the channel with a Sierra Wireless EM7345
      (FIH7160_V1.1_MODEM_01.1349.12) and the channel is already open in the
      device (e.g. mbim-proxy crashed and we try to reopen, or just running
      consecutive mbimcli commands with --no-close), the device returns a
      'MBIM close done' message for every 'MBIM open' request we send.
      
      We update the logic to try to detect this case, and if we do, we
      launch an explicit 'MBIM close' operation before retrying the 'MBIM
      open' again.
      
      E.g. this is the flow when trying to run mbimcli command while the
      MBIM channel is already open in the device side:
      
          $ mbimcli -d /dev/cdc-wdm1 --query-device-caps --no-close --verbose
          [06 ago 2017, 16:58:21] [Debug] opening device...
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Queried max control message size: 512
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Sent message...
          <<<<<< RAW:
          <<<<<<   length = 16
          <<<<<<   data   = 01:00:00:00:10:00:00:00:01:00:00:00:00:02:00:00
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Sent message (translated)...
          <<<<<< Header:
          <<<<<<   length      = 16
          <<<<<<   type        = open (0x00000001)
          <<<<<<   transaction = 1
          <<<<<< Contents:
          <<<<<<   max_control_transfer = 512
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Received message...
          >>>>>> RAW:
          >>>>>>   length = 16
          >>>>>>   data   = 02:00:00:80:10:00:00:00:02:00:00:00:00:00:00:00
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] No transaction matched in received message
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Received unexpected message (translated)...
          >>>>>> Header:
          >>>>>>   length      = 16
          >>>>>>   type        = close-done (0x80000002)
          >>>>>>   transaction = 2
          >>>>>> Contents:
          >>>>>>   status error = 'None' (0x00000000)
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Sent message...
          <<<<<< RAW:
          <<<<<<   length = 12
          <<<<<<   data   = 02:00:00:00:0C:00:00:00:02:00:00:00
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Sent message (translated)...
          <<<<<< Header:
          <<<<<<   length      = 12
          <<<<<<   type        = close (0x00000002)
          <<<<<<   transaction = 2
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Received message...
          >>>>>> RAW:
          >>>>>>   length = 16
          >>>>>>   data   = 02:00:00:80:10:00:00:00:02:00:00:00:00:00:00:00
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Sent message...
          <<<<<< RAW:
          <<<<<<   length = 16
          <<<<<<   data   = 01:00:00:00:10:00:00:00:03:00:00:00:00:02:00:00
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Sent message (translated)...
          <<<<<< Header:
          <<<<<<   length      = 16
          <<<<<<   type        = open (0x00000001)
          <<<<<<   transaction = 3
          <<<<<< Contents:
          <<<<<<   max_control_transfer = 512
      
          [06 ago 2017, 16:58:21] [Debug] [/dev/cdc-wdm1] Received message...
          >>>>>> RAW:
          >>>>>>   length = 16
          >>>>>>   data   = 01:00:00:80:10:00:00:00:03:00:00:00:00:00:00:00
      
          [06 ago 2017, 16:58:21] [Debug] MBIM Device at '/dev/cdc-wdm1' ready
      7626a078
    • Aleksander Morgado's avatar
      device: open timeout check in main state machine · 9aef2e77
      Aleksander Morgado authored
      Lets check if the operation timed out on the main state machine,
      instead of when the open command response is processed. This will
      allow us to queue up new steps sending/receiving messages and have
      a single place to check the timeout for all of them.
      9aef2e77
  5. Sep 11, 2017
    • Aleksander Morgado's avatar
      mbim-device: prefer realpath() to canonicalize_file_name() · 417b0b80
      Aleksander Morgado authored
      Usually the canonicalize_file_name() GNU extension is preferred to the
      POSIX realpath(), as it covers some of the limitations the latter has.
      But this extension isn't available in lots of platforms or in other
      c library implementations (e.g. musl), so just default to the POSIX
      method to improve portability.
      
      Note that the check for canonicalize_file_name() availability during
      configure isn't as trivial as adding a new AC_CHECK_FUNCS(), and
      importing a gnulib module seems overkill just for this one liner.
      417b0b80
  6. Aug 08, 2017
    • Aleksander Morgado's avatar
      device: avoid signals sent to the mbim-proxy process · 5bb673fe
      Aleksander Morgado authored
      If e.g. mbim-proxy is started by ModemManager and we send a Ctrl+C to
      it, the signal would be propagated to the mbim-proxy process and we
      would kill it right away, while leaving ModemManager still around
      wondering why the socket to the proxy got a HUP.
      
      Avoid this, by making sure the mbim-proxy gets its own process group.
      5bb673fe
    • Ben Chan's avatar
      mbimcli: new '--query-pin-list' action · cd65ee93
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      This patch adds a new '--query-pin-list' action to mbimcli for querying
      the list of PINs supported by a MBIM device and additional details for
      each PIN type.
      cd65ee93
  7. Aug 03, 2017
    • Aleksander Morgado's avatar
      mbim-proxy: avoid double-free of 'opening device info' struct · 2fbfb74c
      Aleksander Morgado authored
      When the device is gone while an open() operation is ongoing, we're
      completing and freeing the 'opening device info' struct, but we didn't
      remove it from the private info, so when device_open_ready() happened,
      we were trying to complete and free it again.
      
      Avoid this issue by making sure no already-freed structs are kept in
      the private info, and also allowing device_open_ready() to get called
      without a valid pending 'opening device info'.
      
          [30 Jul 2017, 15:24:33] [Debug] [/dev/cdc-wdm0] Sent message (translated)...
          <<<<<< Header:
          <<<<<<   length      = 16
          <<<<<<   type        = open (0x00000001)
          <<<<<<   transaction = 1
          <<<<<< Contents:
          <<<<<<   max_control_transfer = 4096
      
          [30 Jul 2017, 15:24:38] [Debug] [/dev/cdc-wdm0] Sent message...
          <<<<<< RAW:
          <<<<<<   length = 16
          <<<<<<   data   = 01:00:00:00:10:00:00:00:02:00:00:00:00:10:00:00
      
          [30 Jul 2017, 15:24:38] [Debug] [/dev/cdc-wdm0] Sent message (translated)...
          <<<<<< Header:
          <<<<<<   length      = 16
          <<<<<<   type        = open (0x00000001)
          <<<<<<   transaction = 2
          <<<<<< Contents:
          <<<<<<   max_control_transfer = 4096
      
          [30 Jul 2017, 15:24:42] [Debug] [/dev/cdc-wdm0] unexpected port hangup!
          [30 Jul 2017, 15:24:42] [Debug] Client (7) connection closed...
          [30 Jul 2017, 15:24:42] -Warning ** error opening device: Device is gone
          [30 Jul 2017, 15:24:43] [Debug] open operation timed out: closed
          ==24404== Invalid read of size 8
          ==24404==    at 0x4E4A673: peek_opening_device_info (in /usr/lib/libmbim-glib.so.4.2.0)
          ==24404==    by 0x4E4BD7B: device_open_ready (in /usr/lib/libmbim-glib.so.4.2.0)
          ==24404==    by 0x50CAF61: g_simple_async_result_complete (in /usr/lib/libgio-2.0.so.0.3707.0)
          ==24404==    by 0x50CB028: complete_in_idle_cb (in /usr/lib/libgio-2.0.so.0.3707.0)
          ==24404==    by 0x5602EEA: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x5603207: g_main_context_iterate.isra.13 (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x56035D1: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x4010F8: main (in /usr/lib/mbim-proxy)
          ==24404==  Address 0x6d3bfe0 is 0 bytes inside a block of size 16 free'd
          ==24404==    at 0x4C2A0C0: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==24404==    by 0x4E4AC21: untrack_device (in /usr/lib/libmbim-glib.so.4.2.0)
          ==24404==    by 0x5395392: _g_closure_invoke_va (in /usr/lib/libgobject-2.0.so.0.3707.0)
          ==24404==    by 0x53A805D: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.3707.0)
          ==24404==    by 0x53A8A51: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.3707.0)
          ==24404==    by 0x4E49424: data_available (in /usr/lib/libmbim-glib.so.4.2.0)
          ==24404==    by 0x5602EEA: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x5603207: g_main_context_iterate.isra.13 (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x56035D1: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x4010F8: main (in /usr/lib/mbim-proxy)
          ==24404==  Block was alloc'd at
          ==24404==    at 0x4C2B3D0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==24404==    by 0x5607B00: g_malloc (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x5617E12: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x5618385: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x4E4B1A9: internal_open (in /usr/lib/libmbim-glib.so.4.2.0)
          ==24404==    by 0x4E4BAC5: device_new_ready (in /usr/lib/libmbim-glib.so.4.2.0)
          ==24404==    by 0x50CAF61: g_simple_async_result_complete (in /usr/lib/libgio-2.0.so.0.3707.0)
          ==24404==    by 0x50CB028: complete_in_idle_cb (in /usr/lib/libgio-2.0.so.0.3707.0)
          ==24404==    by 0x5602EEA: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x5603207: g_main_context_iterate.isra.13 (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x56035D1: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.3707.0)
          ==24404==    by 0x4010F8: main (in /usr/lib/mbim-proxy)
          ==24404==
      2fbfb74c
    • Ben Chan's avatar
      mbimcli: make output more consistent in capitalization · c689c770
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      c689c770
    • Ben Chan's avatar
      build: add other source files that affect the output of --help-all · f2f87bf2
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      f2f87bf2
  8. Jul 29, 2017
  9. Jul 28, 2017
  10. Jul 27, 2017
  11. Jul 26, 2017
  12. Jul 18, 2017
    • Aleksander Morgado's avatar
      mbim-device: plug memleak · 242e7f73
      Aleksander Morgado authored
          ==21554== 64 bytes in 1 blocks are definitely lost in loss record 2,960 of 4,396
          ==21554==    at 0x4C2E10F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==21554==    by 0x644E0CF: g_realloc (in /usr/lib/libglib-2.0.so.0.5200.2)
          ==21554==    by 0x6469C06: ??? (in /usr/lib/libglib-2.0.so.0.5200.2)
          ==21554==    by 0x6469F94: g_string_insert_len (in /usr/lib/libglib-2.0.so.0.5200.2)
          ==21554==    by 0x64345E1: ??? (in /usr/lib/libglib-2.0.so.0.5200.2)
          ==21554==    by 0x643585A: g_build_path (in /usr/lib/libglib-2.0.so.0.5200.2)
          ==21554==    by 0x57C25E2: get_descriptors_filepath (mbim-device.c:837)
          ==21554==    by 0x57C267A: read_max_control_transfer (mbim-device.c:921)
          ==21554==    by 0x57C2F89: create_iochannel_with_socket (mbim-device.c:1161)
          ==21554==    by 0x57C2C06: wait_for_proxy_cb (mbim-device.c:1073)
          ==21554==    by 0x6449332: ??? (in /usr/lib/libglib-2.0.so.0.5200.2)
          ==21554==    by 0x64488B4: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.5200.2)
      242e7f73
  13. Jun 28, 2017
    • Ben Chan's avatar
      libmbim-glib: make gtk-doc work again on deprecated enumerators · 47c8b0b7
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      Commit e5b6807d "libmbim-glib: fix G_DEPRECATED_FOR annotations"
      replaced macro defintions with `static const int' definitions for those
      deprecated enumerators. However, gtk-doc doesn't seem to document
      `static const int' defintions. This patch works around the issue by
      adding a macro defintion on top of a `static const int' defintion.
      47c8b0b7
    • Dan Williams's avatar
    • Dan Williams's avatar
      atds: add AT&T Device Service implementation · 1f861355
      Dan Williams authored
      See https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=epan/dissectors/packet-mbim.c
      
      ATDS/Operators seems to be the same as BasicConnect/VisibleProviders except that
      CellularClass has been replaced with a "Provider PLMN Mode".
      
      ATDS/RegisterState seems to be exactly the same as BasicConnect/RegisterState if
      the Wireshark dissector is to be believed.
      
      Doesn't implement ATDS/SetProjectionTables yet.
      1f861355
    • Ben Chan's avatar
      libmbim-glib: fix G_DEPRECATED_FOR annotations · e5b6807d
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      mbim-compat.h defines a few deprecated enumerators as an alias to their
      equivalence using macros and annotates those macros with
      G_DEPRECATED_FOR, which may be expanded to
      `__attribute__((deprecated))'.
      
      Neither gcc nor clang supports `__attribute__((deprecated))' on macros.
      Thus, a G_DEPRECATED_FOR annotation before a macro definition is
      actually associated with the next identifier found after the macro
      definition, which is incorrect.
      
      Alternatively, the G_DEPRECATED_FOR annotation can be used on the
      deprecated enumerators. But only gcc 6 or above supports enumerator
      attributes.
      
      To address the issue, this patch defines the deprecated enumerators as
      `static const int' values, which can then be annotated with
      G_DEPRECATED_FOR.
      e5b6807d
  14. Jun 27, 2017
    • Ben Chan's avatar
      libmbim-glib: add MBIM_READY_INFO_FLAG_NONE to MbimReadyInfoFlag · 895d9847
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      According to MBIM spec Rev 1.0 Errata-1 Table 10-17, a value 0 of the
      ReadyInfo field in MBIM_SUBSCRIBER_READY_INFO refers to
      MBIMReadyInfoFlagsNone and indicates that the device is in normal mode.
      
      This patch adds MBIM_READY_INFO_FLAG_NONE (0) to the MbimReadyInfoFlag
      enum, such that `mbimcli --query-subscriber-ready-info` shows 'Ready
      info' as 'none' instead of 'unknown' when the ReadyInfo field is 0.
      895d9847
    • Ben Chan's avatar
      glib: remove invocations of g_type_init() · b6e03a03
      Ben Chan authored and Aleksander Morgado's avatar Aleksander Morgado committed
      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 libmbim is
      2.36, calling g_type_init() isn't necessarily in the libmbim code.
      b6e03a03
  15. Jun 23, 2017
Loading