aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-29cinterion: increase ^SCFG? timeout to 120sAleksander Morgado
The timeout in this command is extremely large, because there are some modules like the EGS5 that build the response based on the current network registration, and that implies the module needs to be registered. If for any reason there is no serving network where to register, the response comes after a very long time, up to 100s. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/408
2021-07-28ci: switch to build libmbim from git using mesonAleksander Morgado
2021-07-27port-mbim: increase timeout of first command after port openAleksander Morgado
The port open operation may be happening very early after the device has booted, so let's give the module some more time to reply the very first MBIM query we do. The original 10s seems to be a bit tight in some cases. See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/405#note_1006746
2021-07-27port-qmi: open without data format explicitly if requested by userAleksander Morgado
Regardless of whether WDA is supported or not.
2021-07-27port-qmi: early check if WDA is supportedAleksander Morgado
We should check if WDA is supported before running any other logic that may change the state of the kernel or the modem. E.g. if we don't do this as the first step, the loading of the supported kernel data modes may end up changing the expected kernel data mode to raw-ip.
2021-07-27port-qmi: cleanly close device if an open operation failedAleksander Morgado
ModemManager[703345]: <debug> [1626962477.971869] [modem0] couldn't open QMI port with data format update: Unexpected kernel data mode: cannot setup using CTL ModemManager[703345]: <debug> [1626962477.972197] [cdc-wdm0/qmi] Opening QMI device... ModemManager[703345]: <debug> [1626962477.972310] [cdc-wdm0/qmi] Checking if QMI device already opening... ModemManager[703345]: <warn> [1626962477.975182] [modem0] couldn't start initialization: QMI device open/close operation in progress
2021-07-27port-qmi: support devices that only run in 802.3 modeAleksander Morgado
E.g. the ZTE MF190 has a very old QMI firmware that is not able to run CTL Set Data Format (raw-ip). ModemManager[666366]: [/dev/cdc-wdm0] QMI Device supports 4 services: ModemManager[666366]: [/dev/cdc-wdm0] ctl (1.2) ModemManager[666366]: [/dev/cdc-wdm0] wds (1.3) ModemManager[666366]: [/dev/cdc-wdm0] dms (1.2) ModemManager[666366]: [/dev/cdc-wdm0] nas (1.0) ModemManager[666366]: [/dev/cdc-wdm0] Setting network port data format... ModemManager[666366]: [/dev/cdc-wdm0] Sent message... <<<<<< RAW: <<<<<< length = 21 <<<<<< data = 01:14:00:00:00:00:00:03:26:00:09:00:10:02:00:02:00:01:01:00:00 ModemManager[666366]: [/dev/cdc-wdm0] Sent generic request (translated)... <<<<<< QMUX: <<<<<< length = 20 <<<<<< flags = 0x00 <<<<<< service = "ctl" <<<<<< client = 0 <<<<<< QMI: <<<<<< flags = "none" <<<<<< transaction = 3 <<<<<< tlv_length = 9 <<<<<< message = "Set Data Format" (0x0026) <<<<<< TLV: <<<<<< type = "Protocol" (0x10) <<<<<< length = 2 <<<<<< value = 02:00 <<<<<< translated = raw-ip <<<<<< TLV: <<<<<< type = "Format" (0x01) <<<<<< length = 1 <<<<<< value = 00 <<<<<< translated = absent ModemManager[666366]: [/dev/cdc-wdm0] Received message... <<<<<< RAW: <<<<<< length = 19 <<<<<< data = 01:12:00:80:00:00:01:03:26:00:07:00:02:04:00:01:00:2D:00 ModemManager[666366]: [/dev/cdc-wdm0] Received generic response (translated)... <<<<<< QMUX: <<<<<< length = 18 <<<<<< flags = 0x80 <<<<<< service = "ctl" <<<<<< client = 0 <<<<<< QMI: <<<<<< flags = "response" <<<<<< transaction = 3 <<<<<< tlv_length = 7 <<<<<< message = "Set Data Format" (0x0026) <<<<<< TLV: <<<<<< type = "Result" (0x02) <<<<<< length = 4 <<<<<< value = 01:00:2D:00 <<<<<< translated = FAILURE: InvalidDataFormat ModemManager[666366]: <debug> [1626961628.001354] [cdc-wdm0/qmi] QMI port open operation failed: QMI protocol error (45): 'InvalidDataFormat' ModemManager[666366]: <warn> [1626961628.002563] [modem0] couldn't start initialization: QMI protocol error (45): 'InvalidDataFormat' ModemManager[666366]: <warn> [1626961628.004181] [modem0] couldn't initialize: 'Modem is unusable, cannot fully initialize'
2021-07-27broadband-modem-qmi: remove trailing whitespacesAleksander Morgado
2021-07-27ci: remove autoconf-archive from templateAleksander Morgado
2021-07-27huawei: plug memleak when processing GETPORTMODE hintsAleksander Morgado
==99766== 96 (24 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 3,791 of 4,243 ==99766== at 0x483E7C5: malloc (vg_replace_malloc.c:380) ==99766== by 0x50DCAC9: g_malloc (gmem.c:106) ==99766== by 0x50F46D6: g_slice_alloc (gslice.c:1069) ==99766== by 0x50CE9F2: g_list_insert_sorted_real (glist.c:1109) ==99766== by 0x753DE92: ??? ==99766== by 0x753E6D4: ??? ==99766== by 0x753E897: ??? ==99766== by 0x1F059D: mm_plugin_create_modem (mm-plugin.c:922) ==99766== by 0x166693: mm_device_create_modem (mm-device.c:481) ==99766== by 0x161547: device_support_check_ready (mm-base-manager.c:219) ==99766== by 0x4F03533: g_task_return_now (gtask.c:1219) ==99766== by 0x4F07078: UnknownInlinedFun (gtask.c:1289) ==99766== by 0x4F07078: g_task_return (gtask.c:1245)
2021-07-27option: disable preferred networks management in custom SIM objectAleksander Morgado
It's been observed that running CPOL? would completely break the AT port of the modules like the GIO225. Fully disable this feature in the whole option and option-hso plugins, by creating a new custom SIM object with the features disabled completely, and setup as a new shared interface object. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/404
2021-07-27iridium: disable preferred networks management in SIM objectAleksander Morgado
It's not applicable to Iridium modems, which only work with one single operator.
2021-07-27libqcdm: plug leak in qcdm_cdm_log_config_new()Aleksander Morgado
==748616== 37 bytes in 1 blocks are definitely lost in loss record 2,850 of 4,938 ==748616== at 0x48435FF: calloc (vg_replace_malloc.c:1117) ==748616== by 0x249CCF: qcdm_cmd_log_config_new (commands.c:1742) ==748616== by 0x24A321: qcdm_cmd_log_config_set_mask_new (commands.c:1901) ==748616== by 0x1DAE12: modem_cdma_setup_cleanup_unsolicited_events (mm-broadband-modem.c:8643) ==748616== by 0x1DAF21: modem_cdma_setup_unsolicited_events (mm-broadband-modem.c:8671) ==748616== by 0x1AE49F: interface_enabling_step (mm-iface-modem-cdma.c:1627) ==748616== by 0x1AE680: mm_iface_modem_cdma_enable (mm-iface-modem-cdma.c:1693) ==748616== by 0x1E2DF6: enabling_step (mm-broadband-modem.c:11756) ==748616== by 0x1E204E: iface_modem_3gpp_ussd_enable_ready (mm-broadband-modem.c:11606) ==748616== by 0x4F03533: g_task_return_now (gtask.c:1219) ==748616== by 0x4F07078: UnknownInlinedFun (gtask.c:1289) ==748616== by 0x4F07078: g_task_return (gtask.c:1245) ==748616== by 0x1AA323: interface_enabling_step (mm-iface-modem-3gpp-ussd.c:702)
2021-07-27build: import used AX_ macros from autoconf-archiveAleksander Morgado
This allows us to build from git without build-depending on autoconf-archive, which is not always available as a package.
2021-07-27build: update introspection.m4Aleksander Morgado
In sync with gobject-introspection 1.68.0
2021-07-26bearer-mbim: Disable multiplex support for wwan devicesLoic Poulain
WWAN network devices expose link management over netlink (wwan type), but it is not yet supported by libmbim. Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-07-26kernel-device: Add get_wwandev_sysfs_pathLoic Poulain
The wwan subsystem is a new bus agnostic framework exposing wwan device and its components (ports, netdev...). It can be useful to get the wwan device a device belongs to Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-07-26mm-sim-mbim: Remove trailing F in ICCIDPavan Holla
QMI modems remove trailing F in 19 digit ICCID. Do the same on MBIM modems for consistency.
2021-07-25introspection: signal quality signature is (ub)Dylan Van Assche
Signal quality property signature of the Modem Simple interface is not an unsigned integer, but a struct containing an unsigned integer indicating the strength and a boolean to indicate if the value was recently taken.
2021-07-21port-qmi: open dpm port automatically in case of IPA net driverJoel Selvaraj
Requires IPA kernel driver to expose the TX and RX endpoint IDs through sysfs. Available from linux 5.14 onwards.
2021-07-21base-modem: set net sysfs pathJoel Selvaraj
Required by MMPortQmi for fetching the TX and RX endpoint IDs through sysfs from linux 5.14 onwards
2021-07-21port-qmi: allow MMPortQmi to get the net sysfs pathJoel Selvaraj
Will be set by base modem when organizing ports, similar to net driver name. Required for fetching the TX and RX endpoint IDs through sysfs from linux 5.14 onwards.
2021-07-14broadband-modem-mbim: fix passing new slots array in the set operationAleksander Morgado
2021-07-14broadband-modem-mbim: slot index in MM starts at 1Aleksander Morgado
When querying the slots using "Slot info status", the modem expects the slot index passed in the [0,number_slots-1] range. But for the ModemManager API, the slot indices start at 1; i.e. they are in the [1,number_of_slots] range. Consider that wen reporting the current slot index using MBIM.
2021-07-14mm-broadband-modem-mbim: implement the set_primary_sim_slot() method for DSSAZhangMingjie
2021-07-14mm-broadband-modem-mbim: implement the load_sim_slots() method for DSSAZhangMingjie
2021-07-14build: bump libmbim requirement to support DSSA operationsAleksander Morgado
2021-07-14modem-qmi: disable call list check in case of QMIJoel Selvaraj
Fixes AT load call list function messing up with the call list in case of both AT+QMI is available for a given modem.
2021-07-14hso: query profile id from hso bearer during connecting phaseAleksander Morgado
As the profile id is not really set in the base bearer object until after connected.
2021-07-14icera: fix segfault during connection reset logicAleksander Morgado
==252789== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==252789== Access not within mapped region at address 0x28 ==252789== at 0x7D17D22: connect_reset_ready (mm-broadband-bearer-icera.c:419) ==252789== by 0x4EEC242: g_simple_async_result_complete (gsimpleasyncresult.c:802) ==252789== by 0x17EFC6: at_command_ready (mm-base-modem-at.c:538) ==252789== by 0x4EEC242: g_simple_async_result_complete (gsimpleasyncresult.c:802) ==252789== by 0x259423: serial_command_ready (mm-port-serial-at.c:393) ==252789== by 0x4EEC242: g_simple_async_result_complete (gsimpleasyncresult.c:802) ==252789== by 0x252B9B: command_context_complete_and_free (mm-port-serial.c:141) ==252789== by 0x254542: port_serial_got_response (mm-port-serial.c:755) ==252789== by 0x254A78: parse_response_buffer (mm-port-serial.c:926) ==252789== by 0x254FFE: common_input_available (mm-port-serial.c:1035) ==252789== by 0x2550DE: iochannel_input_available (mm-port-serial.c:1058) ==252789== by 0x50D3F84: UnknownInlinedFun (gmain.c:3344) ==252789== by 0x50D3F84: g_main_context_dispatch (gmain.c:4062)
2021-07-14icera: query profile id from icera bearer during connecting phaseAleksander Morgado
As the profile id is not really set in the base bearer object until after connected.
2021-07-14simtech: disable CPOL? checks in SIM7070Aleksander Morgado
The whole device breaks when the CPOL? query is sent; happening consistently all the time: <debug> [1626211395.825257] [modem4/ttyUSB3/at] --> 'AT+CPOL=,2<CR>' <debug> [1626211395.842156] [modem4/ttyUSB3/at] <-- '<CR><LF>OK<CR><LF>' <debug> [1626211395.843227] [modem4/sim4] loading preferred networks... <debug> [1626211395.845289] [modem4/ttyUSB3/at] --> 'AT+CPOL?<CR>' <debug> [1626211401.110974] [modem4/ttyUSB3/at] unexpected port hangup! <debug> [1626211401.111586] [modem4/ttyUSB3/at] forced to close port <debug> [1626211401.112331] [modem4/ttyUSB3/at] closing serial port... <debug> [1626211401.112771] [modem4/ttyUSB3/at] serial port closed Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/401
2021-07-13bearer-mbim: never update bearer properties sent by the userAleksander Morgado
We should never run any mm_bearer_properties_set_X() operations ourselves for the properties received by the user, or otherwise the logic comparing the bearers will fail and we may end up creating one bearer per connection attempt.
2021-07-13base-bearer: setup common default for unknown multiplex fallbackAleksander Morgado
If the user doesn't provide a specific multiplex setting, we'll fallback to a predefined default. For now, the default is REQUESTED.
2021-07-13broadband-bearer: multiplexing is not supported in generic AT based bearerAleksander Morgado
2021-07-13plugins: AT/QCDM/GPS port type hints only applicable to TTY portsAleksander Morgado
There are modems out there, that reuse the same vid:pid for multiple USB layouts, so there may be port type hints that are not really applicable in all layouts. E.g. the EM7565 in MBIM layout uses interface #0 for the MBIM port, while in QMI layout it uses interface #0 for the QCDM port (which is what the port type hint included in MM states). With these rules, if we don't bind the port type hint to TTY ports only, we would be wrongly flagging the MBIM port as possible QCDM port: <debug> [plugin/sierra] probes required for port cdc-wdm0: 'mbim' <debug> [cdc-wdm0/probe] no AT/QMI/MBIM probing in possible QCDM port <debug> [cdc-wdm0/probe] port is not AT-capable <debug> [cdc-wdm0/probe] port is not QMI-capable <debug> [cdc-wdm0/probe] port is not MBIM-capable <debug> [cdc-wdm0/probe] port probing finished: no more probings needed Avoid this, by making sure all port type hints are added exclusively to TTY ports. It's not a perfect solution, but it's enough for the known cases.
2021-07-12shared-qmi: fix use of uninitialized memoryAleksander Morgado
==636642== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ==636642== at 0x5282BAC: send (in /usr/lib/libpthread-2.33.so) ==636642== by 0x4EF20AF: UnknownInlinedFun (gsocket.c:3426) ==636642== by 0x4EF20AF: g_socket_send_with_blocking (gsocket.c:3529) ==636642== by 0x4EDF176: g_output_stream_write (goutputstream.c:242) ==636642== by 0x4EDF2D4: g_output_stream_write_all (goutputstream.c:301) ==636642== by 0x4A5CDAC: endpoint_send (qmi-endpoint-qmux.c:409) ==636642== by 0x4A5B963: qmi_endpoint_send (qmi-endpoint.c:225) ==636642== by 0x4A55408: qmi_device_command_abortable (qmi-device.c:2897) ==636642== by 0x4A554C3: qmi_device_command_full (qmi-device.c:2923) ==636642== by 0x4B52664: qmi_client_nas_set_system_selection_preference (qmi-nas.c:61099) ==636642== by 0x1F6FDC: register_in_network_sssp (mm-shared-qmi.c:455) ==636642== by 0x1F71E6: mm_shared_qmi_3gpp_register_in_network (mm-shared-qmi.c:505) ==636642== by 0x19FCF0: mm_iface_modem_3gpp_register_in_network (mm-iface-modem-3gpp.c:484) ==636642== Address 0x880a3b3 is 19 bytes inside a block of size 32 alloc'd ==636642== at 0x484383F: realloc (vg_replace_malloc.c:1192) ==636642== by 0x50DC130: g_realloc (gmem.c:171) ==636642== by 0x50A067C: g_array_maybe_expand (garray.c:1009) ==636642== by 0x50A0A0C: UnknownInlinedFun (garray.c:520) ==636642== by 0x50A0A0C: g_array_append_vals (garray.c:509) ==636642== by 0x50A0A9E: g_byte_array_append (garray.c:2430) ==636642== by 0x4A4B70D: qmi_message_tlv_write_guint8 (qmi-message.c:686) ==636642== by 0x4B14CA8: __qmi_message_nas_set_system_selection_preference_request_create (qmi-nas.c:33477) ==636642== by 0x4B525B6: qmi_client_nas_set_system_selection_preference (qmi-nas.c:61087) ==636642== by 0x1F6FDC: register_in_network_sssp (mm-shared-qmi.c:455) ==636642== by 0x1F71E6: mm_shared_qmi_3gpp_register_in_network (mm-shared-qmi.c:505) ==636642== by 0x19FCF0: mm_iface_modem_3gpp_register_in_network (mm-iface-modem-3gpp.c:484) ==636642== by 0x1B0BD4: check_next_registration (mm-iface-modem-simple.c:154)
2021-07-12iface-modem: ignore warning when trying to disconnect signal handlerAleksander Morgado
The signal handler may have been already removed during dispose of the modem object, which is run manually through g_object_run_dispose(). Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/399
2021-07-12iface-modem: refactor new SIM slots array creationAleksander Morgado
2021-07-12shared-qmi,iface-modem : Do not reprobe on hotswap in inactive slotPavan Holla
Prior to this change, a hotswap on the inactive slot would result in reprobe of the modem. With this change, the sim object would be updated, but no reprobe will be performed. The advantage is 1) we do not drop connections on the active slot 2) Slot status on the inactive slot is susceptible to firmware bugs. We have seen scenarios where the inactive slot is reported as absent/ iccid={0}, followed by a correction. We should not reprobe the modem if our active slot hasn't changed.
2021-07-11cinterion: ignore Intel Firmware Update service completelyAleksander Morgado
2021-07-11broadband-modem-mbim: allow disabling the use of the Intel Firmware Update ↵Aleksander Morgado
service Not all manufacturers expect this service to be used for the simple purpose of reseting the modem. It works with Sierra Wireless devices (e.g. EM7345, XMM7160_V1.1_MODEM_01.1349.12), but it doesn't work with Cinterion devices (e.g. mPLS62-w, XMM7160_V1.1_MBIM_NAND_ADAPT_R). So allow plugins to disable its use entirely.
2021-07-11cinterion,shared: add missing interface prerequisitesAleksander Morgado
2021-07-10cinterion: implement custom shared reset operationAleksander Morgado
Implemented for all QMI, MBIM and AT based modems. The parent reset operation always takes priority if available.
2021-07-10cinterion: new custom MBIM modem objectAleksander Morgado
2021-07-09utils: remove custom g_ptr_array_find_with_equal_func()Aleksander Morgado
This was required when building with GLib < 2.54, but we now require 2.56 as minimum, so it is no longer needed.
2021-07-09libmm-glib,common-helpers: fix build with glib 2.56Benoît Monin
The support of autoptr for GEnumClass and GFlagsClass was introduced in glib 2.58. To keep compatibility with glib 2.56, declare the autoptr cleanup functions. Fixes #397
2021-07-09iface-modem: don't fail enabling if modem_power_up() isn't implementedAleksander Morgado
There are modems (e.g. Nokia, Thuraya, Iridium) which don't require or don't support power management, and therefore there is no way to either load or update the power status. In those modems we just assume ON is the current and only value (set in the skeleton during initialization) and so when we attempt to update the power state to ON during enabling, the logic should not break. Fix the logic by making sure the requested_power_setup() function pointers are only checked for validity after ensuring we're not already in the desired power state. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/398
2021-07-08qcom-soc: Add support for WWAN subsystem instead of RPMSGStephan Gerhold
Recent Linux kernel versions have introduced a generic WWAN subsystem that provides various char devices for QMI, AT etc, similar to the subsystem-specific char devices for USB or RPMSG. The RPMSG char device for Qualcomm SoCs (e.g. MSM8916/MSM8974) are particularly complicated to work with because they need to be explicitly created from userspace with rpmsgexport and don't show up automatically. However, it turns out it's fairly simple to wrap the RPMSG subsystem in a simple driver for the WWAN subsystem. This has several advantages: - We can drop support for the special RPMSG char devices entirely at some point. - The WWAN char devices show up automatically, without having to export them explicitly, making ModemManager work out of the box on these devices. For now, just support using the WWAN subsystem alternatively for the qcom-soc plugin. Later we can consider dropping the old RPMSG code.
2021-07-08modem-qmi: implement voice unsolicited events and process all_call_status ↵Joel Selvaraj
indication