Age | Commit message (Collapse) | Author |
|
If we had already successfully run the sim hot swap context setup
during the initial initialization, make sure we don't re-run on SIM
PIN unlock, because we may be re-creating signal handlers and such.
|
|
The function shall be needed for profile switch checking.
|
|
If the new iccid is already available, reading the iccid from the
card can be skipped.
|
|
This new method allows changing the SIM slot considered as primary,
when the modem supports multiple SIM slots.
The generic handling of this method will make sure that the modem
object and all its SIM objects are re-probed from scratch as soon as a
successful SIM slot switch happens.
Implementations may report MM_CORE_ERROR_EXISTS when the switch
doesn't need to happen (e.g. if the requested SIM slot is already the
active one).
|
|
The 'SimSlots' property exposes an array of SIM object paths, with one
array item for each available SIM slot in the system. If a valid SIM
card is found in a given slot, the path of the SIM object will be
exposed in the array item; if no valid SIM card is found, the empty
object path ("/") will be exposed instead.
The 'PrimarySimSlot' property exposes which of the SIM slots available
in the system is the one configured as being primary. In a Multi-SIM
Single-Standby setup, the primary slot will be the one corresponding
to the single active SIM in the system. In a Multi-SIM Multi-Standby
setup, the primary slot will be the one configured to act as primary
(e.g. the one that will be used for the data connection) among all the
active SIM cards found.
|
|
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.
|
|
|
|
|
|
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.
mm-iface-modem.c: In function 'after_set_load_current_bands_ready':
mm-iface-modem.c:2358:55: error: cast increases required alignment of target type [-Werror=cast-align]
requested_str = mm_common_build_bands_string ((MMModemBand *)requested_bands->data, requested_bands->len);
^
mm-iface-modem.c:2359:55: error: cast increases required alignment of target type [-Werror=cast-align]
current_str = mm_common_build_bands_string ((MMModemBand *)current_bands->data, current_bands->len);
^
mm-iface-modem.c: In function 'validate_bands':
mm-iface-modem.c:2474:48: error: cast increases required alignment of target type [-Werror=cast-align]
(const MMModemBand *)supported_bands_array->data,
^
mm-iface-modem.c: In function 'mm_iface_modem_set_current_bands':
mm-iface-modem.c:2535:50: error: cast increases required alignment of target type [-Werror=cast-align]
bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array->data,
^
|
|
Charset definition moved from enable state machine to init state machine,
so that the right current charset is available also during further
initialization steps
|
|
This is already done by the modem interface as soon as current
capabilities are loaded.
|
|
|
|
|
|
|
|
It's not used anywhere.
|
|
The check needs to look for a matching single bit, so no need to make
it too complex.
|
|
|
|
|
|
mm-iface-modem.c: In function ‘peridic_signal_check_step’:
mm-iface-modem.c:1311:26: error: this statement may fall through [-Werror=implicit-fallthrough=]
1311 | ctx->running_step++;
| ~~~~~~~~~~~~~~~~~^~
...
|
|
mm-iface-modem.c: In function ‘bearer_status_changed’:
mm-iface-modem.c:483:9: error: switch missing default case [-Werror=switch-default]
483 | switch (mm_base_bearer_get_status (bearer)) {
| ^~~~~~
mm-iface-modem.c: In function ‘peridic_signal_check_step’:
mm-iface-modem.c:1293:5: error: switch missing default case [-Werror=switch-default]
1293 | switch (ctx->running_step) {
| ^~~~~~
mm-iface-modem.c: In function ‘interface_enabling_step’:
mm-iface-modem.c:3965:5: error: switch missing default case [-Werror=switch-default]
3965 | switch (ctx->step) {
| ^~~~~~
mm-iface-modem.c: In function ‘interface_initialization_step’:
mm-iface-modem.c:4708:5: error: switch missing default case [-Werror=switch-default]
4708 | switch (ctx->step) {
| ^~~~~~
|
|
Allow the generic command API while in FAILED state, in case the modem
integrator has some special commands to recover the device.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/163
|
|
Same as with the signal quality polling, we may want to disable
explicitly the access technology polling if we can rely on plugin
specific URCs for this purpose.
|
|
E.g. if we have a specific command to enable the signal quality URCs,
we should only disable polling if the command is supported by the
specific modem and the command succeeds. If unsupported or fails, we
shouldn't disable the polling.
|
|
If we're loading signal quality or access technology, skip reporting
any error message if the specific error received is 'in-progress'.
Plugins will use this error when they cannot process the response to
the operation, e.g. if it was already consumed by a URC handler.
|
|
|
|
The load_unlock_required() step will be automatically retried by the
generic interface logic unless some specific errors happen (e.g. it
won't be retried if a SIM missing error is received).
This patch allows telling the implementation of the method whether
this time being run is the last one before reporting a hard error or
not.
|
|
The modem may take the request to set modes and reply right away with
a success before actually changing the current modes in use.
Therefore, If we reload modes right after we receive the set response,
we may still see the old modes instead of the new ones. Try to avoid
this, by reloading current modes a couple of times after we have set
them if they are not yet the expected ones.
|
|
The modem may take the request to set bands and reply right away with
a success before actually changing the current bands in use.
Therefore, If we reload bands right after we receive the set response,
we may still see the old band mask instead of the new one. Try to
avoid this, by reloading current bands a couple of times after we have
set them if the band mask is not the expected one.
|
|
If ModemManager is being used in a custom system, make it easy to
unconditionally enable the Modem.Command() method, in case the modem
needs to be configured in some way that is not supported via standard
modem interfaces.
|
|
When registration is denied, we should be reporting the modem with
'enabled' state instead of 'registered'. This was not happening
because the logic to build the consolidated state (for 3GPP+3GPP2
modems) was using as default initial state the current old state, and
so if the old one was 'registered' it never allowed getting a
consolidated state of 'enabled', because 'registered' > 'enabled'.
Instead of using the old initial state, the consolidated modem state
should use 'enabled' as default initial value, which is the lowest
among 'enabled, 'searching' and 'registered'.
|
|
Which reports the version of the currently active carrier
configuration.
We also update the firmware 'version' reported in the firmware
settings so that carrier-specific upgrades can be performed (e.g. when
the firmware stays the same but the MCFG is updated).
|
|
In order to support different per-carrier upgrade paths in fwupd.
|
|
During initialization phase we will allow querying the modem for the
details of which carrier-specific configuration is being used, and
will expose a description string in the API.
In addition to showing the current configuration, we will also allow
automatically switching the configuration based on the SIM card
detected in the device. In order to allow this, plugins/modems will
need to provide the expected mapping between carrier config
description and MCCMNC. This mapping cannot be generic, because
different manufacturers may use different description strings.
|
|
|
|
So that the returned error is much more descriptive.
E.g. instead of this:
$ sudo mmcli -m 0 -e
error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method Enable is not implemented on interface org.freedesktop.ModemManager1.Modem'
We'll get this:
$ sudo mmcli -m 0 -e
error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: modem in failed state'
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/96
|
|
When the MMIfaceModem initialization returns with the SIM_NOT_INSERTED
error, the base logic is already updating the modem failed reason to
SIM_MISSING. There is no need to do that explicitly for the case where
SIM hot swap is supported.
|
|
Setting bands is a very device-specific operation. Sometimes the
device requires specific band combinations, or sometimes the 'any'
specific logic doesn't apply to all supported bands (e.g. may apply
only to the currently selected modes, as in XMM based devices).
So, don't assume that if the set command succeeds we have set all
expected bands. Instead, do an explicit loading of the current bands
after the set operation, same thing as we do when setting modes.
|
|
Commit 708b00ae3 "modem: allow periodic signal check to be disabled"
added a "iface-modem-periodic-signal-check-disabled" property in
MMIfaceModem/MMBroadbandModem to indicate if the periodic signal check
should be disabled. If the property is set to TRUE, the
signal_quality_polling_supported field of SignalCheckContext is set to
FALSE, which is sticky across modem disable/enable operations. However,
that is undesirable as we would like to issue an initial signal check to
refresh the signal quality value after the modem is re-enabled from a
state when the RF may have been previously turned off.
|
|
ModemManager decides to disable periodic signal check if either
load_signal_quality is not implemented or load_signal_quality returns an
unsupported error. However, in some cases, we want to use
load_signal_quality to query the initial signal quality but rely on
unsolicited signal quality updates from the modem afterwards without
periodically polling for signal quality. To support that, this patch
introduces a property in MMIfaceModem/MMBroadbandModem to indicate if
the periodic signal check should be disabled.
|
|
|
|
When in low-power mode, some modems will not dispatch unsolicited
notifications, such as for SIM hot swapping. There is code in
MMBroadbandModemTelit to handle this by checking the SIM identifier
during modem power up against the identifier cached in the SIM
D-Bus object. If they're different, the SIM has likely been
swapped while we were powered down.
We can move this code out to MMBroadbandModem because it doesn't
actually rely on any Telit-specific details, and invoke it from
MMIfaceModem via a new method.
|
|
The modem object is being explicitly referenced and stored in the
Context, but then never unref-ed, completely leaking a modem reference
forever.
Fixes: 4df545884733bbc5a851ab86e0983dec057d5482
|
|
|
|
This patch adds a mm_iface_modem_get_unlock_retries helper for getting
the current MMUnlockRetries value of a MMIfaceModem object, which later
allows us to partially update (e.g. a specific MMModemLock) the
MMUnlockRetries value of a MMIfaceModem object.
|
|
This patch exports the internal function update_unlock_retries() in
MMIfaceModem as mm_iface_modem_update_unlock_retries(), which later
allows us to call it from other classes.
|
|
This patch removes an unnecessary error check in the
update_unlock_retries() where the error is never set.
|
|
Currently, when SIM hot swap fails in either mm-iface or plugin, the
ModemManager still opens ports context and prints a message saying that
SIM hot swap is supported and that it's waiting for SIM insertion,
instead of clearly saying that SIM hot swap is not working.
This patch:
1. introduces a new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED
which is FALSE by default and set to TRUE only when
setup_sim_hot_swap_finish() succeded.
2. subordinates the completion of SIM hot swap setup (in
mm-broadband-modem) and the related messages to the the value of
MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED
Finally, this patch replaces the MBIM's sim_hot_swap_on private property
with the new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, since they have the
same meaning.
|
|
|
|
This fixes commit 66f10d61a20e6c661cb04225835ec7a343f4fe36
("iface-modem: port mm_iface_modem_initialize to use GTask"), which
didn't update mm_iface_modem_initialize_finish to use
g_task_propagate_boolean.
|
|
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
|