Age | Commit message (Collapse) | Author | Files | Lines |
|
In 1.20.2 the warning for this was turned into an error.
(cherry picked from commit 289d8ad6419895e2e1fba3d78a54a0db65da521d)
|
|
|
|
|
|
|
|
GLib is being upgraded to propagate type information in
g_clear_pointer, e.g. so that the using a wrong free/unref method
triggers a warning during build.
Reported by: Michael Catanzaro <mcatanzaro@gnome.org>
https://gitlab.gnome.org/GNOME/glib/issues/1425#note_269299
(cherry picked from commit 89bb9f6c18243b9e01386683566bd0bf2825566c)
|
|
(cherry picked from commit 29b43a7d0fb413909132011fac4afe91822e7375)
|
|
(cherry picked from commit ad5022a0d51820482cffb0425e755ada7a60ef0a)
|
|
The GUnixInputStream and GUnixOutputStream object created in
create_iostream_with_fd() references the same file descriptor and are
both set to close the file descriptor when the stream is closed. That
leads to the same file descriptor being closed twice, which isn't
desirable. This patch addresses the issue by having the QmiDevice object
to keep track of the file descriptor and close it, which avoids
any potential race condition in the future.
The issue was observed by Eric Caruso <ejcaruso@chromium.org>
(cherry picked from commit a445e35393e66c3d7b8b6c12cbb11546cab733a9)
|
|
(cherry picked from commit 6edb62f1d48f6fce7bfb9e91497810754ae8e965)
|
|
(cherry picked from commit 310894f7e55bfd71072490ec0c5bf621cf775be6)
|
|
Previously the error was printed but the connection attempt
proceeded because NULL is a valid input for
qmi_client_wds_start_network()
(cherry picked from commit 74ead06f95b06c8fb3b9358237d41c6540d3db22)
|
|
validate_firmware_config_carrier() would return FALSE even if we
set --ignore-version-errors, making this option non-functional.
And as we did not set "error" before returning here, we would
die with an assert failure on return.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit a311c0c278fdecc918d65e08602acef9dc1a6e86)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Modems operating in USB3 SuperSpeed mode may change to
USB2 HighSpeed mode while in boot-and-hold. This changes
the USB port name, causing device matching failure.
Fix by accepting matches on both the original USB(3) port and
the "peer" USB(2) port.
With this, a Sierra Wireless EM7455 can be successfully upgraded
while connected to a USB3 port:
[qfu,utils] operating mode set successfully...
[qfu-updater] reset requested successfully...
[qfu-updater] cleaning up QMI device...
[/dev/cdc-wdm0] Releasing 'dms' client with flags 'none'...
[/dev/cdc-wdm0] Unregistered 'dms' client with ID '2'
[qfu-updater] reset requested, now waiting for TTY device...
[/dev/cdc-wdm0] Sent message...
[/dev/cdc-wdm0] Sent message (translated)...
[/dev/cdc-wdm0] Received message...
[qfu-udev] event: remove ttyUSB0
[qfu-udev] event: remove ttyUSB1
[qfu-udev] event: remove 2-6:1.1
[qfu-udev] event: remove ttyUSB2
[qfu-udev] event: remove wwan0
[qfu-udev] event: remove 2-6:1.0
[qfu-udev] event: remove 2-6:1.3
[qfu-udev] event: remove 2-6:1.2
[qfu-udev] event: remove cdc-wdm0
[qfu-udev] event: remove 2-6:1.12
[qfu-udev] event: remove 2-6:1.13
[qfu-udev] event: remove 2-6
[qfu-udev] event: add 1-6
[qfu-udev] event: add 1-6:1.0
[qfu-udev] event: add ttyUSB0
[qfu-udev] peer lookup for ttyUSB0: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-0:1.0/usb1-port6 => /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6
[qfu-udev] waiting device (tty) matched: ttyUSB0
[qfu-updater] TTY device found: /dev/ttyUSB0
[qfu-qdl-device] opening TTY: /dev/ttyUSB0
[qfu-qdl-device] setting terminal in raw mode...
[qfu,dload-message] sent sdp:
[qfu-qdl-device] >> 70:00:00 [3, unframed]
[qfu-qdl-device] >> 7E:70:00:00:14:46:7E [7]
[qfu-qdl-device] << 7E:0D:16:00:00:00:00:88:4D:7E [10]
[qfu-qdl-device] << 0D:16:00:00:00:00 [6, unframed]
..
[qfu-updater] no more files to download
[qfu-updater] QDL reset
[qfu,qdl-message] sent reset-req:
[qfu-qdl-device] >> 2D [1, unframed]
[qfu-qdl-device] >> 7E:2D:9F:0A:7E [5]
[qfu-updater] now waiting for cdc-wdm device...
[qfu-udev] event: remove ttyUSB0
[qfu-udev] event: remove 1-6:1.0
[qfu-udev] event: remove 1-6
[qfu-udev] event: add 2-6
[qfu-udev] event: add 2-6:1.1
[qfu-udev] event: add 2-6:1.2
[qfu-udev] event: add 2-6:1.13
[qfu-udev] event: add 2-6:1.3
[qfu-udev] event: add 2-6:1.12
[qfu-udev] event: add cdc-wdm0
[qfu-udev] waiting device (cdc-wdm) matched: cdc-wdm0
[qfu-updater] cdc-wdm device found: /dev/cdc-wdm0
[qfu-updater] waiting some time (5s) before accessing the cdc-wdm device...
[qfu-udev] event: add 2-6:1.0
[qfu-udev] event: add ttyUSB0
[qfu-udev] event: add ttyUSB2
[qfu-udev] event: add ttyUSB1
[qfu-udev] event: add wwan0
[qfu-updater] creating QMI DMS client after upgrade...
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
Build them once in a single non-inst library.
|
|
It may happen that the lifecycle of a QmiDevice and its allocated
QmiClients is managed in a different place of where the QmiClient
commands are run, which may keep a QmiClient reference of its own.
In this setup, it may happen that the QmiDevice is closed and all
clients released while there are still full QmiClient references
around that the client may try to use. When this happens, the client
operation didn't fail with an error, instead it would just issue a
'QMI_IS_DEVICE (self)' failed warning and go on.
...
[/dev/cdc-wdm0] Releasing 'dms' client with flags 'release-cid'...
[/dev/cdc-wdm0] Unregistered 'dms' client with ID '10'
[/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<< length = 17
<<<<<< data = 01:10:00:00:00:00:00:0C:23:00:05:00:01:02:00:02:0A
[/dev/cdc-wdm0] sent generic request (translated)...
<<<<<< QMUX:
<<<<<< length = 16
<<<<<< flags = 0x00
<<<<<< service = "ctl"
<<<<<< client = 0
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 12
<<<<<< tlv_length = 5
<<<<<< message = "Release CID" (0x0023)
<<<<<< TLV:
<<<<<< type = "Release Info" (0x01)
<<<<<< length = 2
<<<<<< value = 02:0A
<<<<<< translated = [ service = 'dms' cid = '10' ]
qmi_device_command_full: assertion 'QMI_IS_DEVICE (self)' failed
<warn> [062790.772245] checking if connected failed: Transaction timed out
<debug> [062793.774332] Couldn't refresh CDMA registration status: 'QMI operation failed: Transaction timed out'
<debug> [062793.774398] Couldn't refresh signal quality: 'Transaction timed out'
<debug> [062793.774414] Periodic signal checks not rescheduled: disabled
qmi_device_command_full: assertion 'QMI_IS_DEVICE (self)' failed
<warn> [062795.773381] Reloading stats failed: QMI operation failed: Transaction timed out
<warn> [062795.773425] checking if connected failed: Transaction timed out
qmi_device_command_full: assertion 'QMI_IS_DEVICE (self)' failed
qmi_device_command_full: assertion 'QMI_IS_DEVICE (self)' failed
...
We avoid this situation by exposing a new 'client-valid' property that
users may check before running any command.
This same check is now also internally done by all commands so that we
cleanly error out if we detect that the client isn't valid.
|
|
The "LTE Band Preference" TLV is defined as a 64bit mask, and
therefore it can only report up to 64 bands (1-64).
The new 'Extended LTE Band Preference' TLV is defined as a sequence of
four 64-bit masks, allowing up to 256 bands reported.
<<<<<< TLV:
<<<<<< type = "Extended LTE Band Preference" (0x23)
<<<<<< length = 32
<<<<<< value = DF:18:09:3B:A0:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
<<<<<< translated = { [0] = '1787696847071 ' [1] = '0 ' [2] = '0 ' [3] = '0 '}
Based on a patch from Wolfgang Tolkien <wtolkien@cypress.bc.ca>
|
|
The 'LTE Band Capability' TLV (0x10) is a 64-bit mask, and therefore
isn't capable of reporting more than 64 bands (1 to 64).
In order to support LTE bands greater than 64, this new 'extended' TLV
is defined, as an array of uint16 values, one per band.
E.g. this "Get Band Capabilities" response where the modem reports
band 66:
[/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<< length = 98
<<<<<< data = 01:61:00:80:02:01:02:01:00:45:00:55:00:02:04:00:00:00:00:00:01:08:00:00:00:C0:07:00:00:02:00:10:08:00:DF:18:09:3B:A0:01:00:00:11:08:00:00:00:00:00:00:00:00:00:12:2A:00:14:00:01:00:02:00:03:00:04:00:05:00:07:00:08:00:0C:00:0D:00:11:00:14:00:19:00:1A:00:1C:00:1D:00:1E:00:26:00:28:00:29:00:42:00
[/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<< length = 97
<<<<<< flags = 0x80
<<<<<< service = "dms"
<<<<<< client = 1
<<<<<< QMI:
<<<<<< flags = "response"
<<<<<< transaction = 1
<<<<<< tlv_length = 85
<<<<<< message = "Get Band Capabilities" (0x0045)
<<<<<< TLV:
<<<<<< type = "Result" (0x02)
<<<<<< length = 4
<<<<<< value = 00:00:00:00
<<<<<< translated = SUCCESS
<<<<<< TLV:
<<<<<< type = "Band Capability" (0x01)
<<<<<< length = 8
<<<<<< value = 00:00:C0:07:00:00:02:00
<<<<<< translated = wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800, wcdma-1700-us, wcdma-850-us, wcdma-900
<<<<<< TLV:
<<<<<< type = "LTE Band Capability" (0x10)
<<<<<< length = 8
<<<<<< value = DF:18:09:3B:A0:01:00:00
<<<<<< translated = 1, 2, 3, 4, 5, 7, 8, 12, 13, 17, 20, 25, 38, 40, 41
<<<<<< TLV:
<<<<<< type = 0x11
<<<<<< length = 8
<<<<<< value = 00:00:00:00:00:00:00:00
<<<<<< TLV:
<<<<<< type = "Extended LTE Band Capability" (0x12)
<<<<<< length = 42
<<<<<< value = 14:00:01:00:02:00:03:00:04:00:05:00:07:00:08:00:0C:00:0D:00:11:00:14:00:19:00:1A:00:1C:00:1D:00:1E:00:26:00:28:00:29:00:42:00
<<<<<< translated = { [0] = '1 ' [1] = '2 ' [2] = '3 ' [3] = '4 ' [4] = '5 ' [5] = '7 ' [6] = '8 ' [7] = '12 ' [8] = '13 ' [9] = '17 ' [10] = '20 ' [11] = '25 ' [12] = '26 ' [13] = '28 ' [14] = '29 ' [15] = '30 ' [16] = '38 ' [17] = '40 ' [18] = '41 ' [19] = '66 '}
Based on a patch from Wolfgang Tolkien <wtolkien@cypress.bc.ca>
Updated according to suggestions from Carlo Lobrano <c.lobrano@gmail.com>
|
|
|
|
And corresponding '--dms-swi-get-usb-composition' and
'--dms-swi-set-usb-composition=[x]' qmicli actions.
Based on Bjørn Mork's swi_setusbcomp.pl tool:
https://git.mork.no/?p=wwan.git;a=blob_plain;f=scripts/swi_setusbcomp.pl
$ sudo qmicli -d /dev/cdc-wdm2 --dms-swi-get-usb-composition
[/dev/cdc-wdm2] Successfully retrieved USB compositions:
USB composition 6: DM, NMEA, AT, QMI
[*] USB composition 8: DM, NMEA, AT, MBIM
USB composition 9: MBIM
$ sudo qmicli -d /dev/cdc-wdm2 --dms-swi-set-usb-composition=9
[/dev/cdc-wdm2] Successfully set USB composition
You may want to power-cycle the modem now, or just set it offline and reset it:
$> sudo qmicli ... --dms-set-operating-mode=offline
$> sudo qmicli ... --dms-set-operating-mode=reset
$ sudo qmicli -d /dev/cdc-wdm2 --dms-set-operating-mode=offline
[/dev/cdc-wdm2] Operating mode set successfully
$ sudo qmicli -d /dev/cdc-wdm2 --dms-set-operating-mode=reset
[/dev/cdc-wdm2] Operating mode set successfully
(module reboots)
$ sudo qmicli -d /dev/cdc-wdm2 --dms-swi-get-usb-composition
[/dev/cdc-wdm2] Successfully retrieved USB compositions:
USB composition 6: DM, NMEA, AT, QMI
USB composition 8: DM, NMEA, AT, MBIM
[*] USB composition 9: MBIM
|
|
Not an official release, just a way to tag the existence of the
QMI_DEVICE_REMOVED signal in QmiDevice.
|
|
|
|
|
|
Adds a signal for when a HUP is received from the device, and
propagates this to qmi-proxy clients via untracking them when
the device emits it.
|
|
When the input source was created, we were explicitly removing the
original reference once the source was attached to the main context,
which meant that the context was then owner of the source.
If the source callback was called and G_SOURCE_REMOVE executed, the
main context would then be destroying the last reference of the
GSource. Any further check on the GSource from our logic, like the
g_source_destroy() call we were doing would result in an invalid
memory read as reported by valgrind:
==26546== Invalid read of size 8
==26546== at 0x66CE505: g_source_destroy (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x5391CF9: destroy_iostream (qmi-device.c:2403)
==26546== by 0x5391FE3: qmi_device_close_async (qmi-device.c:2463)
==26546== by 0x53920BA: qmi_device_close (qmi-device.c:2474)
==26546== by 0x1F96D2: port_open_step (mm-port-qmi.c:517)
==26546== by 0x1F8F2F: qmi_device_open_first_ready (mm-port-qmi.c:307)
==26546== by 0x6122D52: ??? (in /usr/lib/libgio-2.0.so.0.5200.3)
==26546== by 0x6123775: ??? (in /usr/lib/libgio-2.0.so.0.5200.3)
==26546== by 0x5390F24: internal_proxy_open_ready (qmi-device.c:2007)
==26546== by 0x6122D52: ??? (in /usr/lib/libgio-2.0.so.0.5200.3)
==26546== by 0x6123775: ??? (in /usr/lib/libgio-2.0.so.0.5200.3)
==26546== by 0x53AA1A4: internal_proxy_open_ready (qmi-ctl.c:4095)
==26546== Address 0xf8fb700 is 32 bytes inside a block of size 104 free'd
==26546== at 0x4C2E14B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26546== by 0x66CD988: ??? (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66D09C7: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66D0C87: ??? (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66D0FA1: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x144A3B: main (main.c:180)
==26546== Block was alloc'd at
==26546== at 0x4C2EF35: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26546== by 0x66D6080: g_malloc0 (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66CE3AD: g_source_new (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x610A2A7: g_pollable_source_new (in /usr/lib/libgio-2.0.so.0.5200.3)
==26546== by 0x611C08E: ??? (in /usr/lib/libgio-2.0.so.0.5200.3)
==26546== by 0x539027F: setup_iostream (qmi-device.c:1617)
==26546== by 0x53907D2: create_iostream_with_socket (qmi-device.c:1749)
==26546== by 0x5390405: wait_for_proxy_cb (qmi-device.c:1662)
==26546== by 0x66D1342: ??? (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66D08C4: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66D0C87: ??? (in /usr/lib/libglib-2.0.so.0.5200.3)
==26546== by 0x66D0FA1: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.5200.3)
Avoid this by making sure we always have a valid GSource reference so
that we can can safely call g_source_destroy() on valid memory..
|
|
|
|
Don't generate title names with a '/' or we'll end up creating
directories, which the default gtk-doc rules don't expect.
make[4]: Entering directory '~/libqmi/qmi-1-18/build/docs/reference/libqmi-glib'
make \
top_distdir="../../../libqmi-1.18.1" distdir="../../../libqmi-1.18.1/docs/reference/libqmi-glib" \
dist-hook
make[5]: Entering directory '~/libqmi/qmi-1-18/build/docs/reference/libqmi-glib'
cp: omitting directory ‘./html/libqmi-glib-DMS-Activate-Automatic-request’
cp: omitting directory ‘./html/libqmi-glib-DMS-Activate-Manual-request’
cp: omitting directory ‘./html/libqmi-glib-DMS-Delete-Stored-Image-request’
cp: omitting directory ‘./html/libqmi-glib-DMS-Get-Activation-State-request’
cp: omitting directory ‘./html/libqmi-glib-DMS-Get-Alt-Net-Config-request’
cp: omitting directory ‘./html/libqmi-glib-DMS-Get-Band-Capabilities-request’
...
Fixes 90a3a4085a164ac163be4919afe98f977d0c79fe.
|
|
Fixes d76de5457508ee21d1564a8d24f43ccf6300392f
|
|
|
|
Section titles are used to generate unique ids in the documentation,
so avoid generating the same title if both a request/response and an
indication have the same message name.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Activate-Config.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Activate-Config.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Deactivate-Config.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Deactivate-Config.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Get-Config-Info.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Get-Config-Info.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Get-Selected-Config.
Warning: multiple "IDs" for constraint linkend: libqmi-glib-PDC-Get-Selected-Config.
....
|
|
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 QMI_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.
|
|
|
|
Even when cloning a git checkout, as we have m4/compiler-warnings
under version control.
|
|
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.
|
|
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.
https://bugs.freedesktop.org/show_bug.cgi?id=99944
|
|
If e.g. qmi-proxy is started by ModemManager and we send a Ctrl+C to
it, the signal would be propagated to the qmi-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 qmi-proxy gets its own process group.
|
|
|
|
Commit c96725e7e "libqmi-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.
|
|
qmi-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.
|
|
Reports bogus current TX/RX rates on my Huawei E397 though.
|
|
|
|
|
|
The GetStoredImageResult must exist before getting into the array item
loop, so that we fill the contents of the struct when we find the
images (modem and pri) we were looking for.
This also fixes the build when -Werror=maybe-uninitialized is used:
/var/lib/jenkins/workspace/libqmi/master-without-mbim/source/src/qmicli/qmicli-dms.c:2800:5: error: ‘result’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
g_task_return_pointer (task, result, (GDestroyNotify)get_stored_image_result_free);
^
|
|
The updated code also avoids a potential memory leak of
GetStoredImageContext in get_stored_image_list_stored_images_ready when
the operation fails.
|