aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-10-27libqmi-glib,proxy: fix segfault when trying to use already disposed clientsAleksander Morgado1-79/+159
If the client which originated the request exits (e.g. HUP received in its socket) before the actual response from the QmiDevice arrives, we'll end up trying to access the Client info (as kept in request->client) even if it has already been freed. Fix that, by making the Client a ref-counted object, and passing around full references of the Client where needed, e.g.: * In the async callbacks where Client is passed as data. * Inside each Request. Doing this we make sure each operation has a totally valid Client until the operation finishes, even if the client gets disconnected in between. ==311== Invalid read of size 8 ==311== at 0x4E9381C: track_cid (qmi-proxy.c:443) ==311== by 0x4E93A45: device_command_ready (qmi-proxy.c:492) ==311== by 0x52BEC18: g_simple_async_result_complete (gsimpleasyncresult.c:777) ==311== by 0x52BEC4E: complete_in_idle_cb (gsimpleasyncresult.c:789) ==311== by 0x583FA6D: g_idle_dispatch (gmain.c:5250) ==311== by 0x583D47A: g_main_dispatch (gmain.c:3065) ==311== by 0x583E237: g_main_context_dispatch (gmain.c:3641) ==311== by 0x583E463: g_main_context_iterate (gmain.c:3712) ==311== by 0x583E79C: g_main_loop_run (gmain.c:3906) ==311== by 0x401411: main (qmi-proxy.c:220) ==311== Address 0x87c7450 is 48 bytes inside a block of size 64 free'd ==311== at 0x4C2A0C0: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==311== by 0x584519E: g_free (gmem.c:197) ==311== by 0x585BBF6: g_slice_free1 (gslice.c:1124) ==311== by 0x4E92CC5: client_free (qmi-proxy.c:149) ==311== by 0x4E92DD4: connection_close (qmi-proxy.c:177) ==311== by 0x4E93CFF: connection_readable_cb (qmi-proxy.c:586) ==311== by 0x52C2A4D: socket_source_dispatch (gsocket.c:3264) ==311== by 0x583D47A: g_main_dispatch (gmain.c:3065) ==311== by 0x583E237: g_main_context_dispatch (gmain.c:3641) ==311== by 0x583E463: g_main_context_iterate (gmain.c:3712) ==311== by 0x583E79C: g_main_loop_run (gmain.c:3906) ==311== by 0x401411: main (qmi-proxy.c:220) ==311== Block was alloc'd at ==311== at 0x4C2B3D0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==311== by 0x584502D: g_malloc (gmem.c:104) ==311== by 0x585B990: g_slice_alloc (gslice.c:1016) ==311== by 0x585B9D4: g_slice_alloc0 (gslice.c:1042) ==311== by 0x4E93FC5: incoming_cb (qmi-proxy.c:655) ==311== by 0x60F2A4B: ffi_call_unix64 (unix64.S:75) ==311== by 0x60F24B8: ffi_call (ffi64.c:492) ==311== by 0x55BB773: g_cclosure_marshal_generic (gclosure.c:1454) ==311== by 0x55BA093: g_closure_invoke (gclosure.c:777) ==311== by 0x55D1B45: signal_emit_unlocked_R (gsignal.c:3586) ==311== by 0x55D0F00: g_signal_emit_valist (gsignal.c:3340) ==311== by 0x55D1383: g_signal_emit (gsignal.c:3386) and: ==9308== Invalid read of size 8 ==9308== at 0x4E93641: device_new_ready (qmi-proxy.c:348) ==9308== by 0x52BEC18: g_simple_async_result_complete (gsimpleasyncresult.c:777) ==9308== by 0x52BEC4E: complete_in_idle_cb (gsimpleasyncresult.c:789) ==9308== by 0x583FA6D: g_idle_dispatch (gmain.c:5250) ==9308== by 0x583D47A: g_main_dispatch (gmain.c:3065) ==9308== by 0x583E237: g_main_context_dispatch (gmain.c:3641) ==9308== by 0x583E463: g_main_context_iterate (gmain.c:3712) ==9308== by 0x583E79C: g_main_loop_run (gmain.c:3906) ==9308== by 0x401411: main (qmi-proxy.c:220) ==9308== Address 0x8d04930 is 32 bytes inside a block of size 72 free'd ==9308== at 0x4C2A0C0: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==9308== by 0x584519E: g_free (gmem.c:197) ==9308== by 0x585BBF6: g_slice_free1 (gslice.c:1124) ==9308== by 0x4E92EAB: client_free (qmi-proxy.c:159) ==9308== by 0x4E92FBA: connection_close (qmi-proxy.c:187) ==9308== by 0x4E93FC1: connection_readable_cb (qmi-proxy.c:626) ==9308== by 0x52C2A4D: socket_source_dispatch (gsocket.c:3264) ==9308== by 0x583D47A: g_main_dispatch (gmain.c:3065) ==9308== by 0x583E237: g_main_context_dispatch (gmain.c:3641) ==9308== by 0x583E463: g_main_context_iterate (gmain.c:3712) ==9308== by 0x583E79C: g_main_loop_run (gmain.c:3906) ==9308== by 0x401411: main (qmi-proxy.c:220) ==9308== Block was alloc'd at ==9308== at 0x4C2B3D0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==9308== by 0x584502D: g_malloc (gmem.c:104) ==9308== by 0x585B990: g_slice_alloc (gslice.c:1016) ==9308== by 0x585B9D4: g_slice_alloc0 (gslice.c:1042) ==9308== by 0x4E94287: incoming_cb (qmi-proxy.c:695) ==9308== by 0x60F2A4B: ffi_call_unix64 (unix64.S:75) ==9308== by 0x60F24B8: ffi_call (ffi64.c:492) ==9308== by 0x55BB773: g_cclosure_marshal_generic (gclosure.c:1454) ==9308== by 0x55BA093: g_closure_invoke (gclosure.c:777) ==9308== by 0x55D1B45: signal_emit_unlocked_R (gsignal.c:3586) ==9308== by 0x55D0F00: g_signal_emit_valist (gsignal.c:3340) ==9308== by 0x55D1383: g_signal_emit (gsignal.c:3386)
2016-10-27libqmi-glib,proxy: plug memleak on command errorAleksander Morgado1-0/+1
2016-10-27libqmi-glib,proxy: print error message on response forwarding error, and ↵Aleksander Morgado1-1/+4
plug memleak
2016-10-27libqmi-glib,proxy: print error message on proxy open response error, and ↵Aleksander Morgado1-0/+2
plug memleak
2016-10-27libqmi-glib,proxy: print error message when indication cannot be forwardedAleksander Morgado1-1/+1
2016-10-27build: include PDC service enums in distAleksander Morgado1-0/+2
https://bugs.freedesktop.org/show_bug.cgi?id=98459
2016-10-26pdc: minor fixes in qmicli loggingAliaksandr Barouski1-6/+4
2016-10-26pdc: use NOT_PROVISIONED to detect 'no configs'Aliaksandr Barouski1-1/+2
changed logic a bit to support situation when there is no config activated. In this case indication generated with error NOT_PROVISIONED.
2016-10-26pdc: 2s of timeout to wait for configs listAleksander Morgado1-0/+26
There won't be any indication if no configs are available. Based on a patch from Aliaksandr Barouski <alex.borovsky@gmail.com>.
2016-10-26qmicli: minor fix in comment textAleksander Morgado1-1/+1
2016-10-26qmicli,pdc: refactor coding style and fix invalid freesAleksander Morgado1-515/+423
Mostly coding style fixes, although the patch also fixes several allocation issues when freeing GSlices.
2016-10-26qmicli: remove unused helpersAleksander Morgado2-50/+0
2016-10-26qmicli: refactor qmicli_read_binary_array_from_string() helperAleksander Morgado2-27/+77
The original implementation actually had some bugs when freeing the output array in error conditions. Also, use g_ascii_xdigit_value() instead of custom conversions.
2016-10-26pdc: new PDC service implementationAliaksandr Barouski11-1/+1620
Added calls for configure hp4120 LTE modem
2016-10-24dms: new 'Change Device Download Mode' commandAleksander Morgado1-0/+79
Based on a patch from Aliaksandr Barouski <alex.borovsky@gmail.com> https://bugs.freedesktop.org/show_bug.cgi?id=96465
2016-10-11qmicli/nas: add --nas-get-rf-band-infoDan Williams1-0/+73
2016-10-06wds: add more TLVs and ModifyProfile/DeleteProfile requestsDan Williams1-0/+26
2016-10-06wds: add more Profile-related TLVsDan Williams1-1/+37
2016-10-06wds: add Go Dormant, Go Active, and Get Dormancy StatusDan Williams1-0/+149
2016-10-06wds: add Set Event Report and Event Report IndicationDan Williams1-20/+296
2016-10-05qmicli: fix handling of unspecified ip_type in --wds-start-networkDan Williams1-1/+1
QMI_WDS_IP_FAMILY_UNSPECIFIED = 8 but ip_type gets initialized to 0, so the "IP Family Preference" was always being sent with an unrecognized value. Fixes: 81c21379 qmicli: add support for IP type to --wds-start-networ
2016-09-30qmi-device: assume reasonable DMS version if WDS is high enoughDan Williams1-7/+25
Some devices (Quectel EC21) lie about their supported DMS version, so assume a reasonable DMS version if the WDS version is high enough.
2016-09-26qmicli,dms: report offline reason for LOW_POWER mode tooDan Williams1-1/+1
If the device cannot exit low-power mode it sometimes reports a reason, like pri-image-misconfiguration.
2016-08-29qmicli,dms: avoid pointer when reading enum arrayAleksander Morgado1-3/+3
2016-08-29qmicli,dms: prefer '--dms-set-firmware-preference' instead of ↵Aleksander Morgado1-6/+6
'--dms-set-firmware-pref'
2016-08-29qmicli: report which new images the firmware expects to downloadBjørn Mork1-0/+20
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-08-29qmicli: preparing for firmware download supportBjørn Mork1-0/+72
The firmware preference must be set to the new firmware version before a firmware download can take place. Add support for setting the firmware preference independently of the currently installed images. Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-08-23qmicli: show IP type in --wds-start-network outputDan Williams1-2/+9
2016-08-19nas: fix RX/TX mixupBjørn Mork1-2/+2
Don't know what I was thinking here, but the referenced channels are of course *RX* channels. None of my modems can do TX CA. Yet :) Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-08-18qmicli: add support for IP type to --wds-start-networkDan Williams1-1/+25
2016-07-07libqmi-glib,device: avoid unref-ing MBIM message if none receivedAleksander Morgado1-1/+2
2016-07-07libqmi-glib,device: fix build with mbim-qmux disabledAleksander Morgado1-7/+12
2016-07-07libqmi-glib,version: new symbol to flag qmi-over-mbim supportAleksander Morgado1-0/+17
2016-07-07libqmi-glib,mbim: run the mbim close operation synchronouslyAleksander Morgado1-20/+40
2016-07-07libqmi-glib,mbim: don't create mbim device multiple timesAleksander Morgado1-0/+9
2016-07-07libqmi-glib,mbim: rework transaction management on mbim backendAleksander Morgado2-56/+159
The lifecycle for transactions going through the MBIM backend is a bit different w.r.t. the default one: * Given that libmbim has its own timeout management for the commands sent, we will rely on it instead of having our own. This means that we always assume that mbim_command() finishes, as it should be. * Instead of using the response QMI message to match a transaction, when using MBIM we use the transaction key given in the context passed to mbim_command() and by doing this we make sure that the transaction is always removed from the tracking table, regardless of whether the QMI message inside matched or not.
2016-07-07libqmi-glib,mbim: destroy mbim device on port closeAleksander Morgado1-10/+28
2016-07-07libqmi-glib,device: include steps for mbim device create/openAleksander Morgado1-39/+78
2016-07-07libqmi-glib,device: fix indentationAleksander Morgado1-12/+12
2016-07-07build: update `--enable-mbim-qmux' rulesAleksander Morgado1-8/+10
If libmbim 1.14.0 found, enable QMI over MBIM support.
2016-07-07qmicli: support MBIM EXT_QMUX devicesBjørn Mork1-0/+7
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-07-07libqmi: support MBIM EXT_QMUX serviceBjørn Mork3-5/+158
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-07-07qmicli: remove unused user_data in qmi_device_new() callbackAleksander Morgado1-1/+1
Reported-by: Jing Chen <jing.chen@spirent.com>
2016-06-10nas: support 'Force Network Search'Aleksander Morgado1-0/+47
2016-06-01libqmi-glib,test: fix implicit conversions to long typesAleksander Morgado1-2/+2
cc1: warnings being treated as errors test-generated.c: In function 'dms_get_time_ready': test-generated.c:292: error: integer constant is too large for 'long' type test-generated.c:298: error: integer constant is too large for 'long' type
2016-04-03qmicli,nas: avoid redefining 'index'Aleksander Morgado1-3/+3
qmicli-nas.c: In function 'get_lte_cphy_ca_info_ready': qmicli-nas.c:2780:12: error: declaration of 'index' shadows a global declaration [-Werror=shadow] cc1: all warnings being treated as errors make[7]: *** [qmicli-qmicli-nas.o] Error 1
2016-04-03libqmi-glib: handle api break introduced in 7fe1238 (released in 1.14.0)Aleksander Morgado1-0/+11
We provide a compatibility symbol to try to provide a better backwards compatibility.
2016-04-03libqmi-glib: handle api break introduced in 7ca279e9a42 (released in 1.14.0)Aleksander Morgado4-0/+168
Commit 7ca279e9a42 introduced a couple of method renames that we now try to recover in order to provide a better backwards API compatibility.
2016-04-03nas: implement 'Get LTE Cphy CA Info'Bjørn Mork2-0/+146
Carrier aggregation is much more fun when you can watch it being activated :) $ qmicli -p -d /dev/cdc-wdm0 --nas-get-lte-cphy-ca-info [/dev/cdc-wdm0] Successfully got carrier aggregation info DL Bandwidth: '20' Secondary Cell Info Physical Cell ID: '101' TX Channel: '3050' DL Bandwidth: '20' LTE Band: 'eutran-7' State: 'activated' Primary Cell Info Physical Cell ID: '299' TX Channel: '1450' DL Bandwidth: '20' LTE Band: 'eutran-3' Secondary Cell index: '1' I have absolutely no clue about the required NAS version, so I just put the current version I have there... Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-03-25libqmi-glib: use ((guint64) 1) << 31 for QMI_*_BAND_CAPABILITY_BC_15Reinhard Speyerer2-2/+2
The current definition of QMI_*_BAND_CAPABILITY_BC_15 gets converted to a negative value (0xffffffff80000000) which causes false positives for BC15 to be returned from dms_add_qmi_bands() and nas_add_qmi_bands() in ModemManager/src/mm-modem-helpers-qmi.c when a matching QMI band (e.g. WCDMA900) is present in qmi_bands like in this example https://lists.freedesktop.org/archives/libqmi-devel/2016-March/001572.html . Replace 1 << 31 with ((guint64) 1) << 31 for QMI_*_BAND_CAPABILITY_BC_15 to avoid incorrect mmcli "Bands | supported: 'cdma-bc15-aws, ...'" output. Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>