Commit Graph
337 Commits
Author SHA1 Message Date
Aleksander Morgado 4e879cbede iface-modem: fix incorrectly halted periodic signal checks
Whenever an explicit signal refresh was requested we would flag the
check as ongoing but never reset the flag, so it would never attempt
to reload it again.

Fixes 0080ed612d
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/702
2023-04-11 10:47:19 +00:00
Aleksander Morgado a872541259 iface-modem: decrease severity of logs that don't affect functionality
Instead of warning about various unimportant things failing that don't
affect functionality, just print the logs in debug level and go on.

E.g. this warning can be completely skipped:
 <wrn> [modem0] couldn't load list of own numbers: Couldn't get MSISDN: QMI protocol error (16): 'NotProvisioned'
2022-11-04 13:12:58 +00:00
Aleksander Morgado 5c604d9d35 iface-modem: improve logging of user request to set current modes 2022-11-04 13:12:57 +00:00
Aleksander Morgado d4c0af9128 iface-modem: improve logging of user request to set current bands 2022-11-04 13:12:57 +00:00
Aleksander Morgado 21d60de42f iface-modem: improve logging of user request to factory reset modem 2022-11-04 13:12:57 +00:00
Aleksander Morgado b82c89f45c iface-modem: improve logging of user request to reset modem 2022-11-04 13:12:57 +00:00
Aleksander Morgado 03528fbff7 iface-modem: improve logging of user request to set power state 2022-11-04 13:12:57 +00:00
Aleksander Morgado a86fb711b3 iface-modem: improve logging of user request to enable/disable modem 2022-11-04 13:12:57 +00:00
Aleksander Morgado 9fe16af157 iface-modem: improve logging of user request to get cell info 2022-11-04 13:12:57 +00:00
Aleksander Morgado 73696cab1a iface-modem: improve logging of user request to set primary SIM slot 2022-11-04 13:12:57 +00:00
Aleksander Morgado 4fa773d234 iface-modem: improve logging of user request to delete bearer 2022-11-04 13:12:57 +00:00
Aleksander Morgado aed53fe30a iface-modem: improve logging of user request to run AT command 2022-11-04 13:12:57 +00:00
Aleksander Morgado ac28a6a1c0 iface-modem: improve logging of user request to set current capabilities 2022-11-04 13:12:57 +00:00
Aleksander Morgado 9840818766 iface-modem: improve logging of user request to create bearer 2022-11-04 13:12:56 +00:00
Aleksander Morgado f98bcd5f58 iface-modem: refactor user request to list bearers 2022-11-04 13:12:56 +00:00
Aleksander Morgado f1fa2eb81e iface-modem: improve logging in INFO level 2022-11-04 13:12:56 +00:00
Aleksander Morgado b3f315ad2d core,log: new 'MSG' log level between 'INFO' and 'WARN'
We're bumping the current "INFO" level messages to the new "MSG"
level, also making the new level the default.

The old "INFO" level will be used to setup an intermediate level of
logging which is not as verbose as "DEBUG" but still provides some
capabilities to analyze the behavior of a modem.
2022-11-04 13:12:56 +00:00
Akash Aggarwal 04ed52a74c mm-iface-modem: always require a SIM card in 3GPP modules
Avoid removing 3GPP capabilities if sim is absent.
Transition to 'Failed' state for 3GPP capable devices if sim is absent.
2022-10-11 11:55:28 +05:30
Jack Song ab80c31898 mm-iface-modem: don't attempt to check lock status when current active slot have eSIM without profiles
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/630
2022-09-19 16:11:48 +08:00
Aleksander Morgado bda3ade5a8 iface-modem: reordering of ready methods in sync() 2022-07-29 15:07:45 +02:00
Prakash Pabba 5c0db37432 mm-iface-modem,mm-broadband-modem,mm-shared-qmi: support SIM IMSI switch
It is possible that SIM IMSI might change in roaming conditions for a sim.

Register for UIM refresh indication always and reprobe if ICCID or IMSI changes for QMI modem.
2022-07-16 22:22:59 +02:00
Rukun Mao 3da84c2079 suspend: add suspend/resume support with powerd on ChromeOS
ModemManager handles suspend and resume signals sent from powerd

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-06-09 08:32:13 +00:00
Aleksander Morgado 63d02f9da2 iface-modem: allow state updates without bearer list
E.g. if we reach the failed state before the bearer list is created.
2022-05-25 11:15:27 +02:00
Aleksander Morgado 9c773fcad4 iface-modem: report failed modems with unknown capabilities
Instead of not creating a modem object, create it in failed state with
the "unknown capabilities" failed state reason.
2022-05-25 11:15:06 +02:00
Aleksander Morgado e90a7410b4 iface-modem: minor coding style fix 2022-05-25 11:15:05 +02:00
Aleksander Morgado 234f185c3a iface-modem: fail initialization if eSIM without profiles
A modem using an eSIM without profiles should not be allowed to get
enabled, it should be really treated as a modem without a physical
SIM.
2022-05-25 11:14:45 +02:00
Aleksander Morgado 0123030136 iface-modem: skip setting up carrier config on esim without profiles 2022-05-25 11:14:40 +02:00
Aleksander Morgado fe91a3044d iface-modem: load current modes and current bands even without SIM
These are current settings in the modem, they don't really depend on
whether there is a SIM or not.
2022-05-25 11:14:39 +02:00
Aleksander Morgado 061f9a275a iface-modem: move helper method out of the initialization logic 2022-05-25 11:14:38 +02:00
Aleksander Morgado f593421d8d iface-modem: minor coding style fix 2022-05-25 10:59:17 +02:00
Aleksander Morgado b497de325a iface-modem: common SIM event reporting logic
We no longer have separate mm_base_modem_process_sim_event() and
mm_broadband_modem_sim_hot_swap_detected() methods. The only
difference between both of them was that one of them would attempt to
cleanup the ports context associated to the SIM hot swap event logic
as soon as a swap was detected, in order to avoid queueing up multiple
such events.

The previous logic wasn't working well, though, as there could be
mixed AT+QMI or AT+MBIM devices that would also require that same
cleanup and so we didn't always know which one should have been
called.

Now we have a single mm_iface_modem_process_sim_event() method, which
will trigger the reprobe and disabling, but which will also perform
the cleanup of the SIM ports swap setup as specified by the
implementation.

So, if a plugin explicitly initializes the serial ports context for
SIM hot swap handling, it should also explicitly clean it up.

Also, the initialization of the serial ports context for SIM hot swap
handling is no longer done automatically for all modems, it will be
done only for those modems using it; i.e. the modems that explicitly
report support SIM hot swap handling using AT URCs.
2022-05-20 09:03:54 +00:00
Aleksander Morgado 61144e2103 iface-modem: remove MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED property
This property is used in the MMIfaceModem to flag whether the SIM hot
swap setup has been performed or not. The flag is now moved to the
iface-specific private context.

The property was also used in AT-based modems, so that implementations
supporting the SIM hot swap via AT URCs could flag the upper layers
whether the enabling of the feature was done correctly or not, and if
so, create and keep the AT ports context open. But this feature only
made sense in AT-based modems, i.e. an MBIM modem that detects SIM hot
swaps via MBIM indications exclusively should not require the AT ports
context open for anything. The check in the MMBroadbandModem object
has therefore been removed, and the logic will be updated so that it
only applies to AT-based modems.
2022-05-20 09:03:54 +00:00
Aleksander Morgado 86eabf4316 iface-modem: initialization restart support moved to iface-specific private context 2022-05-20 09:03:54 +00:00
Aleksander Morgado 0080ed612d iface-modem: rework signal check logic to use the iface-specific private context
The signal and access tech loading operation was using a context that
contained both overall state and state specific to the current
attempt.

The overall modem state is now moved to the iface-specific private
context, and the state specific to the operation is kept in a GTask
that is bound to the ongoing loading operation.
2022-05-20 09:03:54 +00:00
Aleksander Morgado 95da87046c iface-modem: move recent signal quality handling to iface-specific private context 2022-05-20 09:03:54 +00:00
Aleksander Morgado 9fde6f9162 iface-modem: move state update context to iface-specific private context
Avoid keeping separate per-operation contexts, it doesn't make
sense. Just have one single Private context for the whole interface
where we can add support for all operations performed by the
interface.
2022-05-20 09:03:54 +00:00
Dylan Van Assche 3239fc22ff mm-iface-modem: mark signal strength as recent on init
When initializing the Modem interface, we set the signal strength
to the default value (0%) and we are certain this is the recent value
until the modem reports the actual signal strength if available.
Therefore, mark the signal strength as recent instead of cached.
2022-05-03 13:50:13 +02:00
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
Aleksander Morgado e188a77ede dispatcher-fcc-unlock: inherit from the base dispatcher object 2022-04-05 08:14:53 +00:00
Michal Mazur 9843546a49 iface-modem: make update_unlock_retries method static 2022-01-30 13:48:48 +00:00
Aleksander Morgado 3c49e04377 iface-modem: implement support for 'GetCellInfo()' 2022-01-18 09:00:10 +00:00
Aleksander Morgado 59c79b07ae iface-modem: minor coding style changes 2021-12-26 11:01:50 +01:00
Aleksander Morgado 81302efa66 iface-modem: use external dispatcher to attempt FCC unlock
We remove the built-in FCC unlock procedures from the ModemManager, we
will no longer run them automatically, and instead rely on external
scripts/programs to do that.

Packages providing the external FCC unlock tools can install them in
${pkglibdir}/fcc-unlock.d.

Users manually enabling external FCC unlock tools can install them in
${pkgsysconfdir}/fcc-unlock.d.

The user-enabled path takes precedence over the package-enabled one.
2021-11-17 11:30:01 +01:00
Andrew Lassalle 43e76bf1bb iface-modem: Allow SetPowerState(Low|On) on failed state
In some modems, the modem's radio can be ON when no SIM card is present.
In this case, the modem is in failed state, and the host cannot set the
power state to LOW. Since we we will allow the host to set the power to
LOW, we should allow it to set it back to ON.
2021-10-11 10:18:47 -07:00
Aleksander Morgado a61422761f iface-modem: ignore warning when trying to disconnect signal handler
The signal handler may have been already removed during dispose of the
modem object, which is run manually through g_object_run_dispose().

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/399
2021-07-12 21:51:24 +02:00
Aleksander Morgado b983deaa40 iface-modem: refactor new SIM slots array creation 2021-07-12 15:57:43 +02:00
Pavan Holla 503e886c02 shared-qmi,iface-modem : Do not reprobe on hotswap in inactive slot
Prior to this change, a hotswap on the inactive slot would result
in reprobe of the modem. With this change, the sim object would be
updated, but no reprobe will be performed. The advantage is
1) we do not drop connections on the active slot
2) Slot status on the inactive slot is susceptible to firmware bugs.
   We have seen scenarios where the inactive slot is reported as
   absent/ iccid={0}, followed by a correction. We should not
   reprobe the modem if our active slot hasn't changed.
2021-07-12 14:47:52 +02:00
Aleksander Morgado 63f3dcb2fe iface-modem: don't fail enabling if modem_power_up() isn't implemented
There are modems (e.g. Nokia, Thuraya, Iridium) which don't require or
don't support power management, and therefore there is no way to
either load or update the power status.

In those modems we just assume ON is the current and only value (set
in the skeleton during initialization) and so when we attempt to
update the power state to ON during enabling, the logic should not
break.

Fix the logic by making sure the requested_power_setup() function
pointers are only checked for validity after ensuring we're not
already in the desired power state.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/398
2021-07-09 10:45:09 +02:00
Aleksander Morgado e096b50208 iface-modem,bearer-list: sync all bearers one after the other
Do not launch N checks for N bearers and ignore their result. Instead,
go one by one, and report errors one by one.
2021-05-26 13:14:52 +00:00
Dylan Van Assche 8913bab1c5 base-bearer: synchronize state when resuming
Refresh connection status on resume to confirm
that the connection bearers are still valid.
2021-05-26 13:14:52 +00:00