Commit Graph

2214 Commits

Author SHA1 Message Date
Freedom Liu
039ac40aab foxconn: delete the carrier mapping table of T99W175
For T99W175, Qualcomm realized mcfg switching mechanism
in FW side. It can work indepently without MM's help.
Therefore, delete mcfg switching mechanism in MM.
2021-10-28 08:40:18 +08:00
Daniele Palmas
2b196d897b telit: allow unlock retries loading for unknown error csim reply
When trying to lock the modem LE910S1 replies:

'AT+CSIM=1<CR>'
'<CR><LF>ERROR<CR><LF>'

but the modem actually supports CSIM unlock retries reporting.
2021-10-25 16:51:35 +02:00
Daniele Palmas
1058c1c69d telit: avoid sim hot swap procedure if #QSS is not supported 2021-10-25 16:51:23 +02:00
Daniele Palmas
3a02c3187b telit: add port type hints for LE910S1 0x7010, 0x7011 compositions 2021-10-25 16:50:27 +02:00
Frederic Martinsons
9d82d30978 cli, plugins: factorize usage of iso8601 datetime format
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-22 13:48:20 +02:00
Aleksander Morgado
c01f22804e modem-helpers: setup common RSSI to signal quality converter 2021-10-18 00:04:09 +02:00
Daniele Palmas
6c574ce3d6 telit: remove prefix mm_shared in static function names 2021-10-15 15:23:59 +02:00
Daniele Palmas
f8c1e84939 telit: prefer qmi for set_current_bands if available 2021-10-15 15:22:02 +02:00
Daniele Palmas
266043255f telit: prefer qmi for load_current_bands if available 2021-10-15 15:21:57 +02:00
Daniele Palmas
91e16ca282 telit: prefer qmi for load_supported_bands if available 2021-10-15 15:18:14 +02:00
Carlo Lobrano
3522a11578 telit: Detect 4G BND format from BND test reply
Telit modems that require hexadecimal number when specifying 4G bands
also reply to #BND=? command with a 4th parameter <LTE_band_ext>
(e.g. LM940, LM960, LN920, FN980).
On the other hand, modems that require decimal number when specifying 4G
bands only return 3 parameters to the same command.

It is then possible replace the detection of ext_4g_bands via UDEV tags
with an inspection of BND=? reply.
2021-10-15 11:39:33 +00:00
Amol Lad
650cdc5a32 telit: LN920 bands support 2021-10-15 11:39:33 +00:00
Freedom Liu
f5ab3c4678 foxconn: add T99W265 modules, support for QDU. 2021-10-15 14:05:27 +08:00
Aleksander Morgado
c06ca6df3f qcom-soc: require udev tag for ports
Since the 'wwan' subsystem addition to the qcom-soc plugin, the rules
to say a modem is handled by this plugin are too broad, and the plugin
attempts to support any kind of device exposed by the WWAN subsystem,
not just those from Qualcomm SoCs.

Update the plugin to require a new ID_MM_QCOM_SOC udev tag that is set
in the plugin udev rules, given that these rules already check for the
expected SoC drivers (bam-dmux, ipa, qcom-q6v5-mss).
2021-10-14 12:54:21 +00:00
Iñigo Martínez
86fcf2592f build,meson: Add an empty line to split includes and dependencies 2021-10-14 07:57:55 +00:00
Iñigo Martínez
bbc157688d build,meson: Improve plugins option set
Improved the way the plugins are set to allow a smaller summary.
2021-10-14 07:57:55 +00:00
Aleksander Morgado
8852cef817 quectel: fix non-initialized GError
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/442
2021-10-13 22:06:31 +02:00
Daniele Palmas
53f6c309bf telit: add port type hints for LN920 0x1060, 0x1061 compositions 2021-10-11 16:02:40 +00:00
Daniele Palmas
291f583a50 telit: fix typo in load_supported_modes_ready 2021-10-11 16:02:40 +00:00
Daniele Palmas
41482d823b telit: fix segmentation fault in initialize_alternate_3g_band
Fix the following segmentation fault:

ModemManager[128007]: mm_port_peek_kernel_device: assertion 'MM_IS_PORT (self)' failed

Thread 1 "ModemManager" received signal SIGSEGV, Segmentation fault.
0x00005555556c6e3e in mm_kernel_device_get_global_property
(self=0x0, property=0x7ffff5947480 "ID_MM_TELIT_BND_ALTERNATE")
at kerneldevice/mm-kernel-device.c:309

Reported by Carlo Lobrano <c.lobrano@gmail.com>
2021-10-11 16:02:40 +00:00
Daniele Palmas
9c47c54f06 telit: fix g_object_unref failed assertion
Fix the following g_object_unref failed assertion:

ModemManager[385967]: <debug> [1632924639.132023] [modem0/ttyUSB2/at] --> 'AT+CSIM=1<CR>'
ModemManager[385967]: <debug> [1632924639.144892] [modem0/ttyUSB2/at] <-- '<CR><LF>ERROR<CR><LF>'
ModemManager[385967]: <debug> [1632924639.145021] [modem0/ttyUSB2/at] operation failure: 100 (Unknown error)
(ModemManager:385967): GLib-GObject-CRITICAL **: 16:10:39.145: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
2021-09-29 16:13:45 +02:00
Aleksander Morgado
b75d1d50d7 Revert "build,meson: Improve plugins option set"
This reverts commit 09a5052a77.

This commit breaks the default disabling of the qcom-soc plugin.
2021-09-15 22:00:28 +02:00
Aleksander Morgado
101ed56711 meson,build: don't include daemon enum sources in plugins
We will end up exporting what we shouldn't:

  $ abidiff /tmp/autotools/lib/ModemManager/libmm-shared-icera.so /tmp/meson/lib/ModemManager/libmm-shared-icera.so
  Functions changes summary: 0 Removed, 0 Changed (3 filtered out), 8 Added functions
  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

  8 Added functions:

    [A] 'function const gchar* mm_bearer_connection_status_get_string(MMBearerConnectionStatus)'    {mm_bearer_connection_status_get_string}
    [A] 'function GType mm_bearer_connection_status_get_type()'    {mm_bearer_connection_status_get_type}
    [A] 'function const gchar* mm_bearer_status_get_string(MMBearerStatus)'    {mm_bearer_status_get_string}
    [A] 'function GType mm_bearer_status_get_type()'    {mm_bearer_status_get_type}
    [A] 'function gchar* mm_filter_rule_build_string_from_mask(MMFilterRule)'    {mm_filter_rule_build_string_from_mask}
    [A] 'function GType mm_filter_rule_get_type()'    {mm_filter_rule_get_type}
    [A] 'function gchar* mm_port_probe_flag_build_string_from_mask(MMPortProbeFlag)'    {mm_port_probe_flag_build_string_from_mask}
    [A] 'function GType mm_port_probe_flag_get_type()'    {mm_port_probe_flag_get_type}
2021-09-15 21:59:38 +02:00
Aleksander Morgado
8167bc89e9 build,meson: fix building shared utils and plugins
When building shared utils modules or plugins, we should not link with
the static libraries built under src/, because that would mean we're
including their symbols as exported by the modules, and it'll break in
runtime.

Instead, just define the correct set of 'include_directories' to be
used in each plugin.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/436
2021-09-15 21:58:23 +02:00
Aleksander Morgado
81b6c1b333 build,meson: rename plugin helpers library variable
So that we don't confuse the plugin-specific libhelpers with the core
libhelpers built in src/.
2021-09-15 14:24:32 +02:00
Aleksander Morgado
20b8d79318 novatel: avoid returning a NULL timezone without error set
Reported and fix suggested by:
Frederic Martinsons <frederic.martinsons@sigfox.com>

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/438
2021-09-15 13:57:57 +02:00
Iñigo Martínez
80f274b371 build,meson: Improve plugins helper library building
To avoid those cases where a plugin does not need a helper library
an empty array is created.

However, when a helper library has to be built, it is not necessary
to include the created static library in an array.
2021-09-10 08:39:37 +00:00
Iñigo Martínez
db2d2c0ceb build,meson: Fix libmm-test-common name and dependencies
`libmm-test-common` is created using underscores. It also uses
`gio-unix-2.0` as a public dependency but actually it should be
private.

Both issues have been fixed.
2021-09-10 08:39:37 +00:00
Iñigo Martínez
09a5052a77 build,meson: Improve plugins option set
Improved the way the plugins are set to allow a smaller summary.
2021-09-10 08:39:37 +00:00
Aleksander Morgado
5fc5c8ba18 build,meson: fix wrong install of simtech port types on thuraya plugin 2021-09-07 10:55:43 +00:00
Iñigo Martínez
77d1c24361 build: Port to meson
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.
2021-09-07 10:55:43 +00:00
Freedom Liu
f720467016 foxconn: add T99W175 carrier mapping table 2021-08-09 17:47:27 +08:00
Freedom Liu
10521ce248 foxconn: update T77W968 carrier mapping table 2021-08-09 15:40:03 +08:00
Freedom Liu
33e2b023ef foxconn: Rename carrier-mapping to t77w968-carrier-mapping 2021-08-09 15:37:22 +08:00
Aleksander Morgado
f9d2168c52 telit: disable +CPOL based features in the LN930
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/414
2021-08-01 16:32:28 +02:00
Aleksander Morgado
999df00d58 fibocom: fix QMI device allowance
E.g. for a FM150:

   [1627656003.230873] [cdc-wdm0] port contents loaded:
   [1627656003.231069] [cdc-wdm0]   bus: usb
   [1627656003.231179] [cdc-wdm0]   interface: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.4/1-11.4.4:1.4
   [1627656003.231272] [cdc-wdm0]   device: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.4
   [1627656003.231364] [cdc-wdm0]   driver: qmi_wwan
   [1627656003.231450] [cdc-wdm0]   vendor: 2cb7
   [1627656003.231536] [cdc-wdm0]   product: 0104
   [1627656003.231626] [cdc-wdm0]   revision: 0414
   [1627656003.231722] [base-manager] adding port cdc-wdm0 at sysfs path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.4/1-11.4.4:1.4/usbmisc/cdc-wdm0
   ...
   [1627656004.333874] [plugin/fibocom] port cdc-wdm0 filtered by implicit QMI driver
2021-07-31 23:12:55 +02:00
Aleksander Morgado
c4130dcf83 huawei: disable CPOL based features in the R215
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/411
2021-07-31 23:12:55 +02:00
Aleksander Morgado
13d82c1de2 huawei: ignore ^LWURC URCs
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/412
2021-07-31 23:12:55 +02:00
Iñigo Martínez
7c4db66eb3 build: Rename template files
The template files in the `build-aux` directory used in enums sources
and headers generation use the `{$name}-template.[ch]` pattern.
However, the examples in the official guide[0] and usually GNOME and
Freedesktop packages use the `{$name}.[ch].template` pattern.

Due to this, the name of the template files and build commands have
been changed.

[0] https://developer.gnome.org/gobject/stable/glib-mkenums.html
2021-07-30 10:14:52 +00:00
Aleksander Morgado
b935782010 cinterion: increase ^SCFG? timeout to 120s
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-29 13:06:11 +02:00
Aleksander Morgado
e4d4bbbb72 huawei: plug memleak when processing GETPORTMODE hints
==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-27 00:10:02 +02:00
Aleksander Morgado
0d1952c489 option: disable preferred networks management in custom SIM object
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-27 00:10:02 +02:00
Aleksander Morgado
af0fba0585 iridium: disable preferred networks management in SIM object
It's not applicable to Iridium modems, which only work with one single
operator.
2021-07-27 00:10:02 +02:00
Aleksander Morgado
5db3e330b9 hso: query profile id from hso bearer during connecting phase
As the profile id is not really set in the base bearer object until
after connected.
2021-07-14 00:23:49 +02:00
Aleksander Morgado
cadce18865 icera: fix segfault during connection reset logic
==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-14 00:23:49 +02:00
Aleksander Morgado
f72fe9577c icera: query profile id from icera bearer during connecting phase
As the profile id is not really set in the base bearer object until
after connected.
2021-07-14 00:23:49 +02:00
Aleksander Morgado
fc512c711f simtech: disable CPOL? checks in SIM7070
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-14 00:23:49 +02:00
Aleksander Morgado
3e037dc158 plugins: AT/QCDM/GPS port type hints only applicable to TTY ports
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-13 10:56:11 +02:00
Aleksander Morgado
4102cbc700 cinterion: ignore Intel Firmware Update service completely 2021-07-11 15:30:02 +02:00
Aleksander Morgado
dc09d3350c cinterion,shared: add missing interface prerequisites 2021-07-11 15:16:41 +02:00