Commit Graph

8154 Commits

Author SHA1 Message Date
Dylan Van Assche
a1b52c14bf mm-iface-modem: set signal quality to 0% on shutdown
If a modem is disabled, the signal quality is still set to the cached
value, even though the modem is not connected to any network anymore.
Set the signal quality to 0% when the interface is removed from DBus.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/558
2022-04-29 17:43:10 +02:00
Amol Lad
4d0400b77f mmcli: correctly set key_length
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/559
2022-04-28 12:02:02 +02:00
Aleksander Morgado
5a050f8604 bearer-qmi: fix QmiWdRequestedSettings->QmiWdsRequestedSettings typo 2022-04-27 12:20:34 +02:00
Aleksander Morgado
9735437061 bearer-qmi: use the new QmiWdRequestedSettings enum type
And bump libqmi to 1.31.5, which is the version introducing the rename.
2022-04-27 11:53:13 +02:00
Maxim Anisimov
17934810db iface-modem-3gpp-profile-manager: fix copy-paste error on tags for quarks
Ussd module initialization does not work correctly because the tags match.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2022-04-22 09:50:13 +03:00
Dylan Van Assche
f00cb9f67c introspection: add Modem Simple 2022-04-21 09:23:26 +02:00
som
1e08f9ca2c mm-log: hiding personal info while logging
During mm logging, some of the information like simIccId, Telephone
numbers need to be hidden from displaying in the logs to protect
some of the user information.

Implemented for MBIM requiring libmbim 1.27.6, which is the
development version that includes the needed API.
2022-04-20 15:20:34 +02:00
Aleksander Morgado
4207ee61b7 huawei: disable +CPOL based features in Huawei E226
Issue and bugfix suggestion by Alex Leopoldo Villacís Lasso.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/552
2022-04-15 15:23:53 +02:00
Konrad Zapałowicz
96fb425906 cinterion: add PLS63 port type hints
The PLS63 is a drop-in replacement for PLS62 model, however it uses
different USB SoC and enumerates differently on the USB bus.

This commit adds relevant type hints with a correct Vendor and Product
IDs so that the device is correctly discovered. Without these type hints
the modem would not work correctly as it uses wrong port for PPP.
2022-04-13 22:10:21 -07:00
Carlo Lobrano
0645b70aea plugins,telit: SWPKGV parsing needs more permissive regex
In some cases the "base" software package string does not have the
currently expected format of \d{2}.\d{2}.\d{3}. Specifically the last
triplet of characters might not be digits. For example a valid version
string might be 25.20.-04, which the current regex is unable to parse.

This change replace the previous regex with one less restrictive,
checking only the first part of the version's format.
2022-04-12 08:46:29 +02:00
Carlo Lobrano
818b539d65 test,modem-helpers-telit: fix test inputs
test input strings for test_telit_parse_swpkgv_response invert <CR> and
<LF>. The correct match is \r for <CR> and \n for <LF>.
2022-04-11 17:49:37 +02:00
Carlo Lobrano
ac243f9467 sms: prevent crash if date is out of range
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out
of range, and currently mm_new_iso8601_time passes the GDateTime created
by those two functions to date_time_format_iso8601 without checking for
NULL values, causing a g_date_time_format_iso8601 crash if PDU data is
corrupted with wrong date.

To prevent this, mm_new_iso8601_time now can return NULL and set a new
GError if GDateTime created by g_date_time_new is NULL.

Fixes #546
2022-04-08 15:41:49 +02:00
som
5c8c1136bd modem-mbim: update default error when network error is out of range
When the modem sends an error which is outside the range
defined in MBIM_NW_ERROR list then MM should use a default
error(MBIM_NW_ERROR_NONE) instead of crash.
2022-04-07 20:01:40 +00:00
Carlo Lobrano
e175ada2ce plugins,telit: remove unnecessary after sim unlock 1s delay
Currently the Telit modem implements modem_after_sim_unlock() with 1s
timeout, however the #QSS URC management (introduced later) waits for
QSS=1 URC in csim_unlock_periodic_check up to 3s, which makes this 1s
delay not necessary anymore.

see also:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/3
2022-04-07 10:29:33 +02:00
Aleksander Morgado
7960b365d5 data: add example connection dispatcher
Just a minimal example that prints the events in syslog
2022-04-05 08:14:53 +00:00
Aleksander Morgado
99232154b3 build: rename directory where fcc unlocks are kept 2022-04-05 08:14:53 +00:00
Aleksander Morgado
2dafb32d63 base-bearer: integrate connection status dispatcher scripts 2022-04-05 08:14:53 +00:00
Aleksander Morgado
e8612671ef dispatcher-connection: new dispatcher for connection status scripts
The user or the packages can install custom dispatcher scripts that
will be run by the ModemManaer daemon itself upon bearer connection
status updates.

Scripts installed by users should go into the
/etc/ModemManager/connection.d directory.

Scripts installed by packages should go into the
/usr/lib/ModemManager/connection.d directory.

The name of the script will specify the order how it's run, so it's
suggested to name them with a numeric prefix, e.g. "99-something".
2022-04-05 08:14:53 +00:00
Aleksander Morgado
e188a77ede dispatcher-fcc-unlock: inherit from the base dispatcher object 2022-04-05 08:14:53 +00:00
Aleksander Morgado
01c8edf68c dispatcher: new generic object to handle script dispatchers
Based on the FCC unlock specific one, but without any FCC unlock
specific constraint.
2022-04-05 08:14:53 +00:00
som
1fec1cd3c2 profile-manager: profile-id and apn-type check not required for user settings
When the user provides the profile parameter, as per the MM documentation
profile-id is an optional parameter. So with the fix the profile-id
check in input is removed. apn-type is also optional when the user
provides the settings. This check is also removed as part of the fix.
2022-04-05 08:01:48 +00:00
Aleksander Morgado
19f389949c port-serial: ensure the port object is valid after BUFFER_FULL handling
The BUFFER_FULL signal handler is effectively working in the same way
as the response buffer processor, in both cases we may have scheduled
the completion of the serial command, and that in turn may end up
fully disposing the port object. We must make sure the port object is
valid for as long as we need it in this function, so we take a
reference while processing the response buffer.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/535
2022-04-04 10:13:06 +02:00
Sven Schwermer
210fa8bf35 qmi: Fall back to NAS SSP/NAS TP capabilities
If no DMS capabilities are reported, we fall back to the capabilities
reported by NAS SSP or NAS TP.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-03-30 10:19:09 +02:00
Andrew Lassalle
0fbab3c8dc broadband-modem-mbim: Set InitialEPSBearer's authentication to CHAP when is UNKNOWN
This is the same behavior that is used when creating the bearer in
mm-bearer-mbim.
2022-03-29 16:01:30 +00:00
Andrew Lassalle
9793378870 bearer-properties: Match UNKNOWN auth to CHAP for loose comparison
MBIM and QMI fallback to CHAP when a username or password is present
but no authentication type was provided. Consider CHAP==UNKNOWN when
using loose comparison.
2022-03-29 16:01:30 +00:00
Aleksander Morgado
d5805002c1 core: remove "all rights reserved" from copyright lines
The rights each contributor has are the ones stated by the GPL/LGPL,
not more and not less.
2022-03-29 16:36:15 +02:00
Carlo Lobrano
cf7b58ce21 telit: reorganize common_parse_bnd_response for readability 2022-03-29 14:18:55 +00:00
Carlo Lobrano
c208d33e5b telit: fix AT#BND parsing for LE910C1-EUX
Some modems, like LE910C1-EUX, express the LTE part of #BND output in
HEX format, but currently the MM parser for such case is limited to
modems that have "ext_4g_bands". This commits use the new MMTelitModel
info to decide how to parse #BND command output.

Fixes #487
2022-03-29 14:18:55 +00:00
Carlo Lobrano
30a35e6dc3 telit: detect modem model from revision
Telit revision string can be used to identify the specific model, which
in turn is useful to specialize the behavior of the plugin.

This change adds revision parsing to detect some telit modems. Initially
it adds the ones that have different behaviors in #BND output parsing
for example.
2022-03-29 14:18:55 +00:00
Carlo Lobrano
3df96a4255 telit: override load revision
Currently, firmware revision string is obtained via AT+CGMR or AT+GMR
commands from the default mm-broadband-modem. For a class of Telit
modems however this command does not return the actual Telit Software
Package version, but the "Modem FW Version", which is only a component
of the whole firmware. For this class of modems, the correct string is
obtained with "AT#SWPKGV" command.

This change overrides load_revision* functions to add the ability to
parse "AT#SWPKGV" command for the modems that support it, and falls back
to the same logic that was implemented in mm-broadband-modem otherwise.
2022-03-29 14:18:55 +00:00
Bjørn Mork
afd3ce86c9 mm-netlink: use unaligned netlink attribute length
Alignment padding is not accounted for in the netlink attribute
length.  Fix to avoid warnings later if we add shorter fixed
length attributes, even though it currently makes no difference
since we only add a 4 byte attribute

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2022-03-28 13:25:52 +02:00
Bjørn Mork
7bbf6c8a4a mm-netlink: only change IFF_UP flag
This fixes the missing NOARP flag on the second and following VLAN
sub-interfaces when multiplexing over the cdc_mbim driver.

ifi_change specifies all the flags we want to change. Any listed
flag which isn't set in ifi_flags will be cleared by the kernel:

        if (ifm->ifi_change)
                flags = (flags & ifm->ifi_change) |
                        (rtnl_dev_get_flags(dev) & ~ifm->ifi_change);

Drivers like cdc_mbim set some netdev flags by default, indicating
supported or unsupported features. The driver emulates an ethernet
netdev but it doesn't implement ARP.  Clearing NOARP on cdc_mbim
netdevs will block IP transmissions, waiting for an ARP reply we
never will receive.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2022-03-28 13:25:07 +02:00
Nathan Follens
b5a0a50040 po add Dutch translation 2022-03-28 10:21:27 +02:00
Aleksander Morgado
ea247f7e69 foxconn: consolidate checks for T99W175 and T99W265
These two devices require QDU and MCFG+APPS version string
comparison. We now have a single place where we check for this
requirements.
2022-03-28 08:06:10 +00:00
Aleksander Morgado
cd2dd20b08 foxconn: consolidate logic deciding required update methods 2022-03-28 08:06:10 +00:00
Aleksander Morgado
b16b49f9d5 foxconn: consolidate logic deciding requested firmware version type
We don't want to have in two different places the vid:pid match list
when selecting the type of firmware version we ask for.
2022-03-28 08:06:10 +00:00
Aleksander Morgado
4efb5f61cf foxconn: switch to use autoptr() in firmware info loading 2022-03-28 08:06:10 +00:00
Aleksander Morgado
b81680a3fd foxconn: remove unneeded input bundle unref 2022-03-28 08:06:10 +00:00
Freedom Liu
a56f96f074 foxconn: use new qmi service(fox) to get firmware version
foxconn modules get firmware version:
Try with the new FOX service first. If FOX service failed, try with DMS service.
T99W175(vid:105b) ; T77W968(0489:e0b4 ; 0489:e0b5):
    qmi service: dms
T99W265(0489:e0da ; 0489:e0db):
    qmi service: fox
2022-03-28 08:06:10 +00:00
Aleksander Morgado
8d0d90a6dd build: require libqmi 1.31.4 for FOX service support 2022-03-28 08:06:10 +00:00
Iñigo Martínez
0bc0831b22 build,meson: Fix udev rules and keyfiles tests
The port to the meson build system a set of defines were lost, that
made the udev rules and the keyfiles tests to not run properly.

This has been changed so defines are now in their proper place and
tests are run properly.

Fixes #537
2022-03-27 00:02:23 +01:00
Aleksander Morgado
1fdc3ac703 linktop: new port type hints
Flag ttyACM0 as data port and ttyACM1 as primary port, as per
https://bugzilla.gnome.org/show_bug.cgi?id=637140#c10

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/14
2022-03-26 15:51:11 +01:00
Theodore A. Roth
e8bb90e006 cinterion: Add support for PLSx3w modems
Signed-off-by: Theodore A. Roth <theodore_roth@trimble.com>
2022-03-25 11:22:46 +00:00
Stephan Gerhold
8d95c82f9c shared-qmi: ignore slot status indications until initial status is known
Recent ModemManager versions no longer work on the Samsung A5 (Qualcomm
MSM8916) smartphone: MM ends up in an infinite loop trying to probe the
modem over and over again.

Looking at the debug log it seems to be related to a "Slot Status"
indication that comes in during probe time and causes MM to restart
the probing process:

    [/dev/wwan0qmi0] Sent generic request (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Register Events" (0x002E)
      << TLV: translated = physical-slot-status
    [/dev/wwan0qmi0] Received generic indication (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Slot Status" (0x0048)
      << TLV: translated = { [0] = '[ physical_card_status = 'present', ...
    [/dev/wwan0qmi0] Received generic response (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Register Events" (0x002E)
      << TLV: translated = SUCCESS
    [modem42] registered for slot status indications
    [/dev/wwan0qmi0] Sent generic request (translated)...
      << QMUX: service = "uim"
      << QMI: message = "Get Slot Status" (0x0047)
    [modem42] received slot status indication
    [modem42] An active slot had a status change, will reprobe the modem
     <infinite loop>

The "Slot Status" indication (uim_slot_status_indication_cb) arrives
immediately after starting to listen for the event, which is before
ModemManager has actually loaded the initial slot status in
uim_get_slot_status_ready. In this situation !slot_array_status_equal()
will always cause the modem to reprobe, even though it is not necessary
during the probe phase.

To fix this add a simple check to uim_slot_status_indication_cb() that
ignores the indication if the initial slot status was not loaded yet.
2022-03-23 20:39:14 +01:00
Aleksander Morgado
8ab31cf0e6 broadband-modem-mbim: consolidate initialized SIM creation method
The logic to create a new SIM object from the slot status info was
used in several places.
2022-03-22 21:53:08 +00:00
som
035879dab9 broadband-modem-mbim: update sim-type and esim-status of inactive slot
During initialization if the number of slots is more than 1 then
update the sim-type and esim-status of the inactive slot as well.
2022-03-22 21:53:08 +00:00
Daniele Palmas
c447785fd8 telit: fix mode 'any' setting with AT commands
When setting mode 'any' with +WS46 command the supported modes
should be considered for choosing the at command correct argument.
2022-03-18 16:32:24 +01:00
Aleksander Morgado
598d99b5bd test,modem-helpers: add test for the EM9191 COPS=? response
Including 5GNR network reporting (act=12)

https://forum.sierrawireless.com/t/5g-network-scan-with-the-em9191-operation-not-allowed/26374/9
2022-03-16 11:04:06 +00:00
Aleksander Morgado
2c8cfb4768 modem-helpers: improve and fix COPS=? numeric fields parsing
The numeric fields in the +COPS=? response were relying on a very weak
parsing logic, assuming that they were single-digit numeric values and
not using the common string to integer conversion utilities.

This commit improves the conversion from the 3GPP/ETSI defined network
availability and access technology values to the MM defined ones,
providing enum-based matches even if the numeric values are the same.

The commit also fixes the parsing of access technology values > 10,
required to report 5G related values.
2022-03-16 11:04:06 +00:00
Aleksander Morgado
5ba67aff82 modem-helpers: act given in COPS=? may have more than one digit
The new 5GNR related values are >= 10, so don't expect one single
digit (\d), expect one or more (\d+).
2022-03-16 11:04:06 +00:00