Commit Graph
3736 Commits
Author SHA1 Message Date
David Leonard 48973e3d72 sms: fix CMDA SMS UTF-8 translation
Fixes incoming SMS translation issue seen on MC7354 when translating
contents from Latin-1 encoding to UTF-8, because the encoding parameter
"ISO−8859−1" used U+2212 (MINUS SIGN) instead of U+002D (HYPHEN-MINUS).

  [mm-sms-part-cdma.c:873] read_bearer_data_user_data():
  text/data: ignored (latin to UTF-8 conversion error): 0:
  Conversion from character set 'ISO−8859−1' to 'UTF-8' is
  not supported

Fix thanks to Peter Hunt
2020-08-26 14:37:10 +10:00
Aleksander Morgado 599f545c0d sms-part-3gpp: allow sending UTF-16 as if it were UCS-2
Despite 3GPP TS 23.038 specifies that Unicode SMS messages are
encoded in UCS-2, UTF-16 encoding is commonly used instead on many
modern platforms to allow encoding code points that fall outside the
Basic Multilingual Plane (BMP), such as Emoji.

Update the logic to always use UTF-16 instead of UCS-2 when creating
or parsing PDUs (even if we always report as sending or receiving
UCS-2). For all purposes, UCS-2 is considered a subset of UTF-16
(assuming that code points out of the [U+0000,U+D7FF] and
[U+E000,U+FFFF] ranges are not applicable in UCS-2).

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/250
2020-08-20 18:15:37 +02:00
Aleksander Morgado 81162df15d charsets: refactor coding style
Mostly to use GLib types like gchar or gint, and also to use
G_N_ELEMENTS() instead of custom end of array terminating items.
2020-08-20 18:13:54 +02:00
Aleksander Morgado eb5443b197 charsets: add UTF-16BE as a possible modem charset
Just as an implementation detail to be taken as an extension of
UCS2BE, never really to be used as a real modem charset.
2020-08-20 18:13:18 +02:00
Aleksander Morgado 93686510d7 sms-part-3gpp: minor refactor in text split logic 2020-08-20 10:57:01 +02:00
Aleksander Morgado d43d595c02 broadband-modem-qmi: avoid unused functions
Only applicable when building with WITH_NEWEST_QMI_COMMANDS.

  mm-broadband-modem-qmi.c:4741:1: error: ‘common_enable_disable_unsolicited_events_signal_strength’ defined but not used [-Werror=unused-function]
   4741 | common_enable_disable_unsolicited_events_signal_strength (GTask *task)
        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mm-broadband-modem-qmi.c:4528:1: error: ‘serving_system_indication_cb’ defined but not used [-Werror=unused-function]
   4528 | serving_system_indication_cb (QmiClientNas *client,
        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mm-broadband-modem-qmi.c:3468:1: error: ‘common_enable_disable_unsolicited_registration_events_serving_system’ defined but not used [-Werror=unused-function]
   3468 | common_enable_disable_unsolicited_registration_events_serving_system (GTask *task)
        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mm-broadband-modem-qmi.c:2812:1: error: ‘get_serving_system_3gpp_ready’ defined but not used [-Werror=unused-function]
   2812 | get_serving_system_3gpp_ready (QmiClientNas *client,
        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mm-broadband-modem-qmi.c:1652:1: error: ‘get_signal_strength_ready’ defined but not used [-Werror=unused-function]
   1652 | get_signal_strength_ready (QmiClientNas *client,
2020-08-19 15:07:31 +02:00
Aleksander Morgado 9b8fb447b0 broadband-modem-qmi: fix type comparison
Only applicable when building with WITH_NEWEST_QMI_COMMANDS.

  mm-broadband-modem-qmi.c: In function ‘process_common_info’:
  mm-broadband-modem-qmi.c:2924:20: error: comparison is always false due to limited range of data type [-Werror=type-limits]
   2924 |         if (mnc[2] == 0xFF) {
        |                    ^~
2020-08-19 15:07:24 +02:00
Aleksander Morgado de23b53ee4 modem-helpers: ensure error is set in mm_3gpp_parse_cpms_test_response()
If splitting the +CPMS=? response in groups fails, make sure we set
the GError when returning FALSE.
2020-08-16 14:17:41 +02:00
Aleksander Morgado 7cd373589c bearer-qmi: if connection aborted, ensure network handles are released
If the connection attempt is aborted before finishing (either network
triggered or user triggered), we need to make sure that we run a 'Stop
Network' request for every 'Start Network' that had succeeded until
then, or otherwise we'll no longer be able to re-run a 'Start Network'
with the same settings and get a proper packet data handle.

E.g. in this sequence we attempt a IPv4v6 connection. The logic starts
setting up the IPv4 path:

    Wed Jul 29 14:44:06 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connecting)
    Wed Jul 29 14:44:06 2020 daemon.debug [1567]: <debug> Launching connection with QMI port (usb/cdc-wdm0) and data port (net/wwan0)
    Wed Jul 29 14:44:06 2020 daemon.debug [1567]: <debug> Defaulting to use static IP method
    Wed Jul 29 14:44:06 2020 daemon.debug [1567]: <debug> Running IPv4 connection setup
    ...

The 'Start Network' for IPv4 succeeds and we get a proper packet data
handle:

    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: [/dev/cdc-wdm0] sent generic request (translated)... <<<<<< QMUX: <<<<<<   length  = 23 <<<<<<   flags   = 0x00 <<<<<<   service = "wds" <<<<<<   client  = 20 <<<<<< QMI: <<<<<<   flags       = "none" <<<<<<   transaction = 3075 <<<<<<   tlv_length  = 11 <<<<<<   message     = "Start Network" (0x0020) <<<<<< TLV: <<<<<<   type       = "APN" (0x14) <<<<<<   length     = 8 <<<<<<   value      = 69:6E:74:65:72:6E:65:74 <<<<<<   translated = internet
    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: [/dev/cdc-wdm0] received generic response (translated)... <<<<<< QMUX: <<<<<<   length  = 26 <<<<<<   flags   = 0x80 <<<<<<   service = "wds" <<<<<<   client  = 20 <<<<<< QMI: <<<<<<   flags       = "response" <<<<<<   transaction = 3075 <<<<<<   tlv_length  = 14 <<<<<<   message     = "Start Network" (0x0020) <<<<<< TLV: <<<<<<   type       = "Result" (0x02) <<<<<<   length     = 4 <<<<<<   value      = 00:00:00:00 <<<<<<   translated = SUCCESS <<<<<< TLV: <<<<<<   type       = "Packet Data Handle" (0x01) <<<<<<   length     = 4 <<<<<<   value      = 80:CD:AD:81 <<<<<<   translated = 2175651200

Then, we start the IPv6 connection path:
    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: <debug> Running IPv6 connection setup
    ...

But, because we suddenly are not registered in the network, the
connection is aborted, and we don't cleanup the IPv4 path at this
point, as this patch wasn't available.

    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: <debug> Bearer not allowed to connect, not registered in 3GPP network
    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: <debug> Forcing disconnection of bearer '/org/freedesktop/ModemManager1/Bearer/56'
    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: transaction 0xe1 aborted, but message is not abortable
    Wed Jul 29 14:44:07 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> enabled)
    Wed Jul 29 14:44:07 2020 daemon.debug [1567]: <debug> Couldn't connect bearer '/org/freedesktop/ModemManager1/Bearer/56': 'operation cancelled'

We then attempt a new connection request with the same settings:

    Wed Jul 29 14:44:22 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connecting)
    Wed Jul 29 14:44:22 2020 daemon.debug [1567]: <debug> Launching connection with QMI port (usb/cdc-wdm0) and data port (net/wwan0)
    Wed Jul 29 14:44:22 2020 daemon.debug [1567]: <debug> Defaulting to use static IP method
    Wed Jul 29 14:44:22 2020 daemon.debug [1567]: <debug> Running IPv4 connection setup

And we see how the 'Start Network' command fails with a 'No Effect'
error, as the IPv4 was left connected earlier. Due to this, the modem
is assumed connected, but we won't have a valid packet data handle to
stop the connection cleanly:

    Wed Jul 29 14:44:22 2020 daemon.debug [1567]: [/dev/cdc-wdm0] sent generic request (translated)... <<<<<< QMUX: <<<<<<   length  = 23 <<<<<<   flags   = 0x00 <<<<<<   service = "wds" <<<<<<   client  = 20 <<<<<< QMI: <<<<<<   flags       = "none" <<<<<<   transaction = 3080 <<<<<<   tlv_length  = 11 <<<<<<   message     = "Start Network" (0x0020) <<<<<< TLV: <<<<<<   type       = "APN" (0x14) <<<<<<   length     = 8 <<<<<<   value      = 69:6E:74:65:72:6E:65:74 <<<<<<   translated = internet
    Wed Jul 29 14:44:23 2020 daemon.debug [1567]: [/dev/cdc-wdm0] received generic response (translated)... <<<<<< QMUX: <<<<<<   length  = 26 <<<<<<   flags   = 0x80 <<<<<<   service = "wds" <<<<<<   client  = 20 <<<<<< QMI: <<<<<<   flags       = "response" <<<<<<   transaction = 3080 <<<<<<   tlv_length  = 14 <<<<<<   message     = "Start Network" (0x0020) <<<<<< TLV: <<<<<<   type       = "Result" (0x02) <<<<<<   length     = 4 <<<<<<   value      = 01:00:1A:00 <<<<<<   translated = FAILURE: NoEffect <<<<<< TLV: <<<<<<   type       = "Packet Data Handle" (0x01) <<<<<<   length     = 4 <<<<<<   value      = 00:00:00:00 <<<<<<   translated = 0
2020-08-12 11:36:21 +00:00
Aleksander Morgado 16e3bb892d iface-modem: avoid connection status flapping if briefly unregistered
If the modem is connected and we receive indications of a quick
unregistration cycle (i.e. unregistered, then registered again) we
should not end up flagging the modem as disconnected.

We already had some logic to avoid this with the "deferred 3GPP
unregistration" logic in the base bearer object, but this logic only
took into account the status of the bearer, not the status of the
modem.

    Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (home -> idle)
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP location updated (MCC: '0', MNC: '0', Location area code: '0', Tracking area code: '1CE8', Cell ID: '68F832')
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Connected bearer not registered in 3GPP network
    Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connected -> enabled)
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: signal quality updated (0)
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: access technology changed (lte -> unknown)
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Periodic signal checks disabled
    Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (idle -> registering)
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP location updated (MCC: '0', MNC: '0', Location area code: '0', Tracking area code: '1C84', Cell ID: 'A3E050')
    Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP location updated (MCC: '238', MNC: '1', Location area code: '0', Tracking area code: '1C84', Cell ID: 'A3E050')
    Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (registering -> home)
    Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabled -> registered)

We now try to improve this situation by also considering the case
where modem is supposed to get into "enabled" state (i.e. not
registered, not searching), but we still consider the amount of
connected bearers to decide the final state reported by the modem. In
other words, a modem with the 3GPP registration reported as 'idle'
will still be reported as 'connected' if there is at least one bearer
in connected state. This situation will end as soon as the 'deferred
3GPP unregistration' timeout expires, as that will force the bearer to
be disconnected.
2020-08-12 11:36:21 +00:00
Aleksander Morgado 74dd28c4e3 broadband-modem: minor method rename 2020-08-01 10:02:02 +02:00
Aleksander Morgado 130ea74cc9 iface-modem: move sim hot swap ready to correct place in sequence 2020-08-01 10:01:57 +02:00
Giacinto Cifelli 4d58278d7f changed default authentication algorithm to CHAP
CHAP is almost universal nowadays, and so it is a better default
than PAP

Not changed for uBlox, that prefers an error if not specified,
and for Huawei, which uses NONE with user/pwd and has 2 CHAP choices
2020-07-24 16:34:40 +02:00
Sven Schwermer c70b355718 qmi: Network registration via SSSP if possible
Doing the network registration via Set System Selection Preference is
preferable because it doesn't override the currently set allowed mode,
i.e. access technology.

https://lists.freedesktop.org/archives/modemmanager-devel/2020-July/007972.html

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2020-07-16 08:13:10 +00:00
Justin Standring 47a28114ba broadband-modem-qmi: fix -Wempty-body warning
mm-broadband-modem-qmi.c: In function 'process_common_info':
  mm-broadband-modem-qmi.c:2897:30: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
               /* both apply */ ;
                                ^

Signed-off-by: Justin Standring <justin.standring@taitradio.com>
2020-07-16 13:37:55 +12:00
Justin Standring 6ec12add1b broadband-modem-qmi: fix object logging with WITH_NEWEST_QMI_COMMANDS
mm-broadband-modem-qmi.c: In function 'common_signal_info_get_quality':
  mm-broadband-modem-qmi.c:1469:21: error: 'self' undeclared (first use in this function)
           mm_obj_dbg (self, "RSSI (CDMA): %d dBm", cdma1x_rssi);
                       ^~~~
  mm-broadband-modem-qmi.c:1469:21: note: each undeclared identifier is reported only once for each function it appears in
           mm_obj_dbg (self, "RSSI (CDMA): %d dBm", cdma1x_rssi);
                       ^~~~
  mm-broadband-modem-qmi.c: In function 'process_gsm_info':
  mm-broadband-modem-qmi.c:2992:25: error: 'self' undeclared (first use in this function)
               mm_obj_dbg (self, "no GSM service reported");
                           ^~~~
  mm-broadband-modem-qmi.c: In function 'process_wcdma_info':
  mm-broadband-modem-qmi.c:3100:25: error: 'self' undeclared (first use in this function)
               mm_obj_dbg (self, "no WCDMA service reported");
                           ^~~~
  mm-broadband-modem-qmi.c: In function 'process_lte_info':
  mm-broadband-modem-qmi.c:3209:25: error: 'self' undeclared (first use in this function)
               mm_obj_dbg (self, "no LTE service reported");
                           ^~~~
  mm-broadband-modem-qmi.c: In function 'config_signal_info_ready':
  mm-broadband-modem-qmi.c:4890:21: error: 'self' undeclared (first use in this function)
           mm_obj_dbg (self, "QMI operation failed: '%s'", error->message);
                       ^~~~

Signed-off-by: Justin Standring <justin.standring@taitradio.com>
2020-07-16 13:37:46 +12:00
Aleksander Morgado e98bc7cc08 broadband-modem-qmi: fix parsing of USSD indications with UTF-16 data
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/240
2020-07-08 11:40:41 +02:00
Aleksander Morgado bdbd0fc049 iface-modem-signal: port skeleton update logic to use g_autoptr 2020-07-04 06:37:07 +02:00
Aleksander Morgado 3d138f9f80 iface-modem-signal: remove unneeded skeleton clear attempt
It won't do anything because clear_values() tries to get the skeleton
from the modem object, and the skeleton hasn't been set at that point.
2020-07-04 06:37:07 +02:00
Aleksander Morgado 6f6c090076 broadband-modem: remove misleading comment
5GNR is not 3GPP2
2020-07-04 06:35:25 +02:00
Aleksander Morgado 24670498bc broadband-modem-qmi: minor alignment updates 2020-07-04 06:35:25 +02:00
Aleksander Morgado 10ee7f4cd9 mbim,signal: make sure output pointers are always set
E.g. if 'gsm' pointer is given, make sure it's always set (either to a
MMSignal or to NULL).
2020-07-04 05:50:41 +02:00
Aleksander Morgado 0dd1f12222 mbim,signal: provide 5G signal info if loaded by parent implementation 2020-07-04 05:50:41 +02:00
Walter Hagstrom 88923ffe39 iface-modem-signal: added 5G signal information
Extended the ModemManager Signal interface to include 5G signal
information for RSRP, RSRQ and SINR via libqmi.  Also extended mmci
to print 5G signal info.
2020-07-04 05:50:41 +02:00
Adrien Plazas 6df9cc0844 plugin: define an autofree value to NULL
This satisfies -Werror=maybe-uninitialized.
2020-07-03 08:26:57 +02:00
Aleksander Morgado 4b37b7d3cf base-modem,at: response processors return a more specific enum
Instead of using the FALSE return of the method to indicate either a
fatal error (if result_error was set) or the continuation request (if
result_error wasn't set), provide a enum that has explicit states for
all three possible values (failure, success or continue).
2020-06-28 15:07:34 +02:00
Aleksander Morgado c4d82aaf1e base-modem,at: improve documentation on response processor methods 2020-06-28 15:07:34 +02:00
Aleksander Morgado 7e3863897e broadband-modem: run implicit disabling if enabling fails
The disabling sequence is updated so that the steps to disable the
interfaces never fail. This is done so that the modem is not left
in an "inconsistent" enabled state, if e.g. the modem is enabled and
one of the disabling steps for the interfaces ends up failing. In this
case, it is preferred to say that the modem is disabled, than having
it wrongly enabled.

The enabling sequence is updated so that if any of the steps to enable
the interfaces fail, we end up running an implicit disabling operation
to disable all the interfaces. This is to attempt to cleanup whatever
we had enabled during the enabling operation, including e.g. the open
ports context.
2020-06-28 08:17:25 +00:00
Aleksander Morgado 408e9f327e broadband-modem-qmi: fix assertion when disabling unsolicited events
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/230
2020-06-24 09:31:30 +02:00
Aleksander Morgado c6d213d652 broadband-modem-qmi,bearer-qmi: avoid depending on the client version
The QMI client version is an information provided by the QMI protocol
only when QMUX or MBIM backends are used, it won't be available when
e.g. QRTR is used. The logic in ModemManager should not rely on this
information.
2020-06-23 12:29:05 +00:00
Aleksander Morgado fbf3875344 blacklist: add chinese clone of Arduino nano
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/228
2020-06-22 09:30:09 +02:00
Eric Caruso 9d31cbaa2d mm-kernel-device: give cmp a total order
This allows MMKernelDevice::cmp to compare two kernel devices
with different object types, which means that subclasses can
continue to only handle comparisons with their own type. The
order may not be stable across builds.
2020-06-17 16:19:07 -07:00
Aleksander Morgado 569990f38c broadband-modem-qmi: also build 5GS reg state from Serving System 2020-06-12 09:25:09 +02:00
Aleksander Morgado 8340237f9d broadband-modem-qmi: avoid using stale EPS registration state
When the device goes from LTE to UMTS, we must make sure we also
always update the EPS registration state as unknown, or the built
consolidated state will be wrong.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/225
2020-06-12 09:18:37 +02:00
Maxim Anisimov 3af93cbe18 broadband-modem-qmi: switch USSD state to idle when ussd session is terminated by network
The cellular operator can break the interactive USSD session. In this case, it is necessary
to process this situation otherwise --3gpp-ussd-initiate or --3gpp-ussd-respond will give an error.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2020-06-05 08:24:30 +00:00
Maxim Anisimov 1e0b38d98a sms-part-3gpp: fix unicode names in sms decode iconv() operations
So that the limited iconv() in OpenWRT supports the conversion properly.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2020-06-05 08:43:05 +03:00
Aleksander Morgado a5c060ef87 filter: setup automatic per-vid checks in the plugin whitelist
Until now, the plugin whitelist rule in the filter would only handle
those plugins that require specific udev tags, and those that had
explicit full vid:pid pairs.

This update makes a new implicit automatic whitelist for all devices
that match any of the vids managed by the different plugins.

Looking at the current list of devices in the blacklist and greylist
maintained by ModemManager, there are no devices falling under the
list of supported plugin vids that would need to be blacklisted;
except for u-blox GPS modules:

  huawei    -> 0x12d1        -> None in blacklist/greylist
  thuraya   -> 0x1a26        -> None in blacklist/greylist
  telit     -> 0x1bc7        -> None in blacklist/greylist
  dLink     -> 0x2001        -> None in blacklist/greylist
  wavecom   -> 0x114f        -> None in blacklist/greylist
  x22x      -> 0x1bbb,0x0b3c -> None in blacklist/greylist
  anydata   -> 0x16d5        -> None in blacklist/greylist
  quectel   -> 0x2c7c        -> None in blacklist/greylist
  haier     -> 0x201e        -> None in blacklist/greylist
  novatel   -> 0x1410        -> None in blacklist/greylist
  dell      -> 0x413c        -> None in blacklist/greylist
  option    -> 0x0af0,0x1931 -> None in blacklist/greylist
  nokia     -> 0x0421        -> None in blacklist/greylist
  cinterion -> 0x1e2d,0x0681 -> None in blacklist/greylist
  simtech   -> 0x1e0e        -> None in blacklist/greylist
  iridium   -> 0x1edd        -> None in blacklist/greylist
  pantech   -> 0x106c        -> None in blacklist/greylist
  longcheer -> 0x1c9e,0x1bbb -> None in blacklist/greylist
  linktop   -> 0x230d        -> None in blacklist/greylist
  sierra    -> 0x1199        -> None in blacklist/greylist
  ublox     -> 0x1546        -------------> GPS chips blacklisted !!!!!
  foxconn   -> 0x0489        -> None in blacklist/greylist
  broadmobi -> 0x2020        -> None in blacklist/greylist
  fibocom   -> 0x2cb7        -> None in blacklist/greylist
  tplink    -> 0x2357        -> None in blacklist/greylist
  zte       -> 0x19d2        -> None in blacklist/greylist

The rules used to blacklist the u-blox GPS chips have already been
moved to the u-blox plugin itself, and now they use the broader
ID_MM_DEVICE_IGNORE tag that applies in all filter modes.
2020-06-04 11:34:43 +02:00
Aleksander Morgado bbeca60113 ublox: fully ignore GPS devices with plugin-installed rules
Instead of setting up the ID_MM_TTY_BLACKLIST tag used in 'legacy'
filter mode, tag all known u-blox GPS devices with the broader
ID_MM_DEVICE_IGNORE tag that applies under all filter modes.

Also, make this rules be installed by the plugin itself, because at
the end, it is the u-blox plugin the one attempting to probe all
devices with vid 0x1546.
2020-06-04 11:34:43 +02:00
Aleksander Morgado 15543794b7 filter: 'strict' is the new default
The 'strict' filter policy is less invasive, as it will not touch TTYs
unless there are clear indications that it may be a modem. Under this
mode, the ModemManager-provided blacklist database is not used.
2020-06-01 16:02:46 +00:00
Aleksander Morgado 82d38f701c filter: rename 'default' to 'legacy'
The old 'default' policy is renamed to 'legacy', and is considered now
deprecated.
2020-06-01 16:02:46 +00:00
Aleksander Morgado 6eca223705 shared-qmi: require minimum set of NMEA types before starting GNSS engine 2020-06-01 15:43:48 +00:00
Aleksander Morgado 10648f8d36 broadband-modem-qmi: plug memleak when changing current firmware
==80079== 104 (40 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 4,761 of 5,232
  ==80079==    at 0x483977F: malloc (vg_replace_malloc.c:309)
  ==80079==    by 0x5025AE9: g_malloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x5006223: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x505B0F4: g_array_sized_new (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x2008A3: firmware_change_current (mm-broadband-modem-qmi.c:8426)
  ==80079==    by 0x1AB5F3: select_auth_ready (mm-iface-modem-firmware.c:225)
  ==80079==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x17402E: authorize_ready (mm-base-modem.c:1363)
  ==80079==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x15366D: check_authorization_ready (mm-auth-provider.c:99)
2020-06-01 15:28:52 +02:00
Aleksander Morgado d848b10d24 iface-modem-firmware: plug memleak when listing images
==80079== 1,377 (48 direct, 1,329 indirect) bytes in 1 blocks are definitely lost in loss record 5,200 of 5,232
  ==80079==    at 0x483977F: malloc (vg_replace_malloc.c:309)
  ==80079==    by 0x5025AE9: g_malloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x5006223: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x4FEB59B: ??? (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x4FEE378: g_variant_builder_end (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x48F8314: mm_firmware_properties_get_dictionary (mm-firmware-properties.c:337)
  ==80079==    by 0x1AAF29: load_current_ready (mm-iface-modem-firmware.c:80)
  ==80079==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x4E68688: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x502B58E: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x502D530: ??? (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x502E542: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.6400.2)
2020-06-01 15:28:52 +02:00
Aleksander Morgado 3efe127aa8 iface-modem-voice: fix assertions in call setup/teardown logic 2020-05-27 15:51:26 +02:00
Aleksander Morgado da7bc39f0c blacklist: add USB CEC adapters
These are not being probed when using the STRICT filter, so this
blacklist update is relevant only for DEFAULT filter type.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/212
2020-05-27 05:11:29 +00:00
Aleksander Morgado a399c7e42a charsets: take_and_convert() methods should support GSM encoding
The iconv() operation would fail because we wouldn't give any proper
charset string to convert to/from. Use our custom GSM encoding support
instead.
2020-05-26 15:05:52 +02:00
Aleksander Morgado c994576953 charsets,test: extend UCS2->UTF-8 testing for the reverse operation 2020-05-26 15:05:52 +02:00
Aleksander Morgado c4e6a0c4f6 charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8
This would really be an implementation detail, not a real use
case. Just don't warn in this case, as in the conversion in the
opposite direction.
2020-05-26 15:05:52 +02:00
Aleksander Morgado 0926031119 Revert "charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8"
This reverts commit 6a7dd87f30.

Reverting because the merge request was set to squash all together....
2020-05-26 15:04:20 +02:00
Giacinto Cifelli 6a7dd87f30 charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8
This would really be an implementation detail, not a real use
case. Just don't warn in this case, as in the conversion in the
opposite direction.
2020-05-26 12:45:40 +00:00