Commit Graph

2183 Commits

Author SHA1 Message Date
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
Aleksander Morgado
b126e84b56 cinterion: implement custom shared reset operation
Implemented for all QMI, MBIM and AT based modems. The parent reset
operation always takes priority if available.
2021-07-10 17:20:41 +02:00
Aleksander Morgado
3dd3d6faf6 cinterion: new custom MBIM modem object 2021-07-10 17:04:00 +02:00
Stephan Gerhold
681d5d29d5 qcom-soc: Add support for WWAN subsystem instead of RPMSG
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-08 13:41:47 +00:00
Alexander Dahl
266e98e020 ublox: Mark ubandsel as unsupported on SARA-R4 and -N4
See log from a SARA-R410M-02B-01 before the change:

    Feb 01 05:40:01 unit ModemManager[304]: <debug> [1612158001.012330] [modem0/ttymxc4/at] --> 'AT+UBANDSEL?<CR>'
    Feb 01 05:40:01 unit ModemManager[304]: <debug> [1612158001.026831] [modem0/ttymxc4/at] <-- '<CR><LF>ERROR<CR><LF>'
    Feb 01 05:40:01 unit ModemManager[304]: <debug> [1612158001.027113] [modem0/ttymxc4/at] operation failure: 100 (Unknown error)
    Feb 01 05:40:01 unit ModemManager[304]: <warn>  [1612158001.027298] [modem0] couldn't load current bands: Unknown error

Backed by SARA-R4 series AT commands manual, no reference to +UBANDSEL
in the manual at all.

Log after the change:

    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.500845] [modem0] (u-blox) support configuration found for 'SARA-R410M-02B'
    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.500961] [modem0] (u-blox)   band update requires explicit unregistration
    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.501052] [modem0] (u-blox)   UACT based band configuration unsupported
    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.501141] [modem0] (u-blox)   UBANDSEL based band configuration unsupported

Fixes: 437fb830c8 ("ublox,helpers: assume all SARA/LARA devices require COPS")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
2021-07-07 17:20:23 +02:00
Alexander Dahl
7c9d1e45be ublox: Add more values to URAT combinations
The SARA-R410M-02B-01 only supports values 7 and 8, log excerpt:

    Feb 01 05:40:00 unit ModemManager[304]: <debug> [1612158000.826046] [modem0/ttymxc4/at] --> 'AT+URAT=?<CR>'
    Feb 01 05:40:00 unit ModemManager[304]: <debug> [1612158000.833596] [modem0/ttymxc4/at] <-- '<CR><LF>+URAT: (7-8),(7-8)(7-8)<CR><LF><CR><LF>OK<CR><LF>'
    Feb 01 05:40:00 unit ModemManager[304]: <warn>  [1612158000.833992] [modem0] (u-blox) unexpected AcT value: 7
    Feb 01 05:40:00 unit ModemManager[304]: <warn>  [1612158000.834096] [modem0] (u-blox) unexpected AcT value: 8
    Feb 01 05:40:00 unit ModemManager[304]: <warn>  [1612158000.834193] [modem0] couldn't load supported modes: No combinations built from +URAT=? response

The SARA-R4 series AT commands manual (and also the SARA-R5 AT commands
manual) lists them like this:

- 7: LTE Cat M1
- 8: LTE Cat NB1

After the change, log looks like this:

    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.490627] [modem0/ttymxc4/at] --> 'AT+URAT?<CR>'
    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.499994] [modem0/ttymxc4/at] <-- '<CR><LF>+URAT: 7,8<CR><LF><CR><LF>OK<CR><LF>'
    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.500433] [modem0] (u-blox) current allowed modes retrieved: 4g
    Feb 01 06:58:25 unit ModemManager[329]: <debug> [1612162705.500561] [modem0] (u-blox) current preferred modes retrieved: 4g

Signed-off-by: Alexander Dahl <ada@thorsis.com>
2021-07-07 17:18:56 +02:00
Aleksander Morgado
e1fbc1ccb7 cinterion: fix double free when loading initial EPS context
The properties object stored in the context is being returned as task
result; so we should make sure that object is no longer left in the
context so that it's not freed twice.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/395
2021-06-30 22:31:17 +02:00
Aleksander Morgado
4cf12bb8bc helpers: skip g_warning() in mm_3gpp_parse_ws46_test_response()
Use mm_obj_warn() instead.
2021-06-16 11:59:51 +02:00
Ivan Mikhanchuk
83ac824705 quectel: add support for EM120/160 PCIe modules 2021-06-16 00:40:26 -07:00
Dylan Van Assche
c00eff43ac quectel: ignore QLWURC
QLWURCs are not ignored and causes calls to be rejected in some cases
2021-06-01 12:52:05 +02:00
Felipe Borges
0b8607bc5d cinterion: avoid maybe-uninitialized warning by GCC 10
Reported at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1371
2021-05-27 15:05:55 +02:00
Aleksander Morgado
6fae479bd7 plugins: ignore reload_connection_status() where not supported
Some of the AT-based connection methods don't have any way to query
connection status, or we don't have a proper implementation for those
yet. Ignore the reload operation in all those.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
4038c243f9 cinterion: reuse the same method for load and reload
The load_() method is used for connection monitoring; while the
reload_() method is used to sync connection status after a
suspend/resume operation. The same method can be used for both things
in the Cinterion plugin.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
c188ba3c15 sierra: reuse the same method for load and reload
The load_() method is used for connection monitoring; while the
reload_() method is used to sync connection status after a
suspend/resume operation. The same method can be used for both things
in the Sierra plugin.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
205f46620e novatel-lte: reuse the same method for load and reload
The load_() method is used for connection monitoring; while the
reload_() method is used to sync connection status after a
suspend/resume operation. The same method can be used for both things
in the Novatel LTE plugin.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
10651ba93f quectel: the generic AT based modem supports SIM hot swap 2021-05-26 12:20:00 +00:00
Aleksander Morgado
e4f106f311 broadband-modem-qmi: assume all QMI based modems support SIM hot swap
As we have a generic SIM hot swap implementation in the QMI broadband
modem object.
2021-05-26 12:20:00 +00:00
Aleksander Morgado
43db860c44 base-bearer: report connection error on network initiated disconnections
By default, fallback to "unknown" mobile equipment error when the
modem gets disconnected by the network and we don't have any way to
know a more detailed reason.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
8da8fd0248 api: update MMMobileEquipmentError enum values
Update the list of mobile equipment error codes according to v17.1.0
of 3GPP TS 27.007 (March 2021).

A lot of the enum values that were prefixed with the 'GPRS_' keyword
have now been flagged as deprecated, and a new enum name given to the
corresponding value.

The deprecated symbol names are kept in the compat support to avoid
breaking API/ABI.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
9fdbbc6929 foxconn: setup FCC unlock step
Use the new "DMS Foxconn Set FCC authentication" command to request
the modem unlock during a power up operation.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/373
2021-05-23 00:23:17 +02:00
Aleksander Morgado
e1567c30df foxconn: don't assume parent location is available
If ModemManager is not built with QMI support, the generic MBIM modem
object will not have any location support, so we cannot assume that
iface_modem_location_parent will be valid and that it will have all
load_location_capabilities(), enable_location_gathering() and
disable_location_gathering() implemented.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/362
2021-05-03 00:10:03 +02:00
Aleksander Morgado
25a1b28fbf core: strict return type in g_object_ref()
This is now a requirement when using glib 2.56.
2021-04-30 11:05:42 +00:00
Freedom Liu
35b1672b85 foxconn: add new MBIM QDU firmware update method support
Based on the QDU service newly added in libmbim,
T99W175 module (vid: 0x105b) supports MBIM QDU based update.
2021-04-30 10:44:19 +02:00
Aleksander Morgado
49b63cc62b icera: implement profile management support
Using AT%IPDPCFG for authentication related profile settings
management (querying, updating), and relying on the parent
implementation for the remaining ones.

And using AT%IPDPACT for activation status management (deactivate),
while relying on the parent implementation for the activated check.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
887358663d broadband-bearer: rely on profile management for the cid selection
There is no longer need to perform all the CID selection logic in the
broadband bearer connection procedure, we can rely on the new profile
management operations to do the same thing.

We can do this because we're sure that all the MMBroadbandModem
objects implement the MMModem3gppProfileManager interface.

Additionally, given that we now provide the profile ID value as part
of the MMBearerConnectResult, we no longer need a custom
mm_broadband_bearer_get_3gpp_cid() as we can use the generic
mm_base_bearer_get_profile_id() for the same purpose.
2021-04-29 10:13:22 +00:00
Freedom Liu
47ea5c98f4 foxconn: add support for the T99W175 module
0x0489 is the vendor ID of T77W968, 0x105b is the vendor ID of T99W175.
{0x105b, 0xe0b0},{0x105b, 0xe0b1} is T99W175 PCI device, used by Dell.
{0x105b, 0xe0ab} is T99W175 PCI device, used by Lenovo.

If the modem has an mbim port, create a MbimFoxconn object, regardless
of what the product ID is.

The firmware version format in the T99W175 was selected to have
firmware version + carrier config version + apps version.
2021-04-29 00:58:35 +00:00
Freedom Liu
c31488608a foxconn: change modem-foxconn-t77w968 to modem-mbim-foxconn
Named the object in a more generic way.
2021-04-29 00:58:35 +00:00
Loic Poulain
fefbf4d302 plugins: generic: Add 'wwan' subsystem support
wwan is a new subsystem for WWAN devices, allowing to expose the
WWAN device and its ports in a generic way.

The sysfs hierarchy for such device is

/sys/class/wwanX
/sys/class/wwanX/wwanXpYP

Where X is the WWAN device index, Y the port index and P the
control protocol name (QMI, MBIM...). A control port is also
exposed as character device in /dev.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2021-04-21 12:53:16 +02:00
Dylan Van Assche
1beea40270 quectel: set QGPSXTRA to enable assistance support
Quectel modems require to enable XTRA GNSS assistance first with QGPSXTRA=1, before it can be used.
2021-04-20 15:29:29 +00:00
Aleksander Morgado
aeed8c9e5b qcom-soc-plugin: add support for QRTR+IPA based setups 2021-04-14 11:27:27 +02:00
Zrshuo Zhang
179e12befc fibocom: add port type hints for the NL668-AM 2021-04-07 12:18:58 +02:00
Aleksander Morgado
851a708442 modem-helpers: ip family normalization doesn't need log_object 2021-04-01 11:24:42 +02:00