aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
AgeCommit message (Collapse)Author
2022-09-19mm-iface-modem: don't attempt to check lock status when current active slot ↵Jack Song
have eSIM without profiles Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/630
2022-07-29iface-modem: reordering of ready methods in sync()Aleksander Morgado
2022-07-16mm-iface-modem,mm-broadband-modem,mm-shared-qmi: support SIM IMSI switchPrakash Pabba
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-06-09suspend: add suspend/resume support with powerd on ChromeOSRukun Mao
ModemManager handles suspend and resume signals sent from powerd Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-05-25iface-modem: allow state updates without bearer listAleksander Morgado
E.g. if we reach the failed state before the bearer list is created.
2022-05-25iface-modem: report failed modems with unknown capabilitiesAleksander Morgado
Instead of not creating a modem object, create it in failed state with the "unknown capabilities" failed state reason.
2022-05-25iface-modem: minor coding style fixAleksander Morgado
2022-05-25iface-modem: fail initialization if eSIM without profilesAleksander Morgado
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-25iface-modem: skip setting up carrier config on esim without profilesAleksander Morgado
2022-05-25iface-modem: load current modes and current bands even without SIMAleksander Morgado
These are current settings in the modem, they don't really depend on whether there is a SIM or not.
2022-05-25iface-modem: move helper method out of the initialization logicAleksander Morgado
2022-05-25iface-modem: minor coding style fixAleksander Morgado
2022-05-20iface-modem: common SIM event reporting logicAleksander Morgado
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-20iface-modem: remove MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED propertyAleksander Morgado
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-20iface-modem: initialization restart support moved to iface-specific private ↵Aleksander Morgado
context
2022-05-20iface-modem: rework signal check logic to use the iface-specific private contextAleksander Morgado
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-20iface-modem: move recent signal quality handling to iface-specific private ↵Aleksander Morgado
context
2022-05-20iface-modem: move state update context to iface-specific private contextAleksander Morgado
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-03mm-iface-modem: mark signal strength as recent on initDylan Van Assche
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-04-29mm-iface-modem: set signal quality to 0% on shutdownDylan Van Assche
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-05dispatcher-fcc-unlock: inherit from the base dispatcher objectAleksander Morgado
2022-01-30iface-modem: make update_unlock_retries method staticMichal Mazur
2022-01-18iface-modem: implement support for 'GetCellInfo()'Aleksander Morgado
2021-12-26iface-modem: minor coding style changesAleksander Morgado
2021-11-17iface-modem: use external dispatcher to attempt FCC unlockAleksander Morgado
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-10-11iface-modem: Allow SetPowerState(Low|On) on failed stateAndrew Lassalle
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-07-12iface-modem: ignore warning when trying to disconnect signal handlerAleksander Morgado
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-12iface-modem: refactor new SIM slots array creationAleksander Morgado
2021-07-12shared-qmi,iface-modem : Do not reprobe on hotswap in inactive slotPavan Holla
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-09iface-modem: don't fail enabling if modem_power_up() isn't implementedAleksander Morgado
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-05-26iface-modem,bearer-list: sync all bearers one after the otherAleksander Morgado
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-26base-bearer: synchronize state when resumingDylan Van Assche
Refresh connection status on resume to confirm that the connection bearers are still valid.
2021-05-26iface-modem: ignore cancellation during sync()Aleksander Morgado
There is no input cancellable in the method, so the GTask will never get cancelled from the outside.
2021-05-26iface-modem: remove the signal quality enforced refresh during sync()Aleksander Morgado
when mm_iface_modem_refresh_signal() is called, we'll restart the signal quality refresh logic already, there is no need to request an enforced start. The enforced start was also modifying ctx->enabled unconditionally, which is really not ok. This logic would be enabled only when we're registered, and that logic is fine, no need to change that.
2021-05-26iface-modem: synchronize state when resumingDylan Van Assche
Refresh signal strength and access technologies, check for SIM swaps, and check if the SIM is locked. The modem may have switched to a different access technologies or have a different signal strength when resuming. Moreover, the user may swap or remove the SIM when suspended.
2021-05-23mm-iface-modem: fix typo in step functionDylan Van Assche
2021-05-23iface-modem: new optional FCC unlock step in the power state updateAleksander Morgado
There are devices that come locked before they can be put online. Until now we had a specific implementation for this in the generic QMI modem, but we should have it in a more generic way for any kind of modem.
2021-05-12iface-modem: fix segfault if attempting to switch slot and slots unsupportedAleksander Morgado
Reported and fix suggested by Maxim Anisimov Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/368
2021-04-14iface-modem: minor refactor in the unload required logicAleksander Morgado
No change in the logic, just in how it's setup. E.g. we will load the max number of retries just once when the logic starts, instead of checking it on every iteration. Also some other minor coding style changes included, e.g. adding the timeout between retries as a defined symbol.
2021-04-14iface-modem: Increase unlock_required retriesPavan Holla
If a SIM is known to exist, for e.g. if it was created during load_sim_slots, persist a few more times before giving up on the SIM to be ready. There are modems on which the SIM takes more than 15s to be ready, luckily, they happen to be QMI modems where the SIM's iccid in load_sim_slots lets us know that there is a sim.
2021-04-02iface-modem: publish helper to abort invocation if state not reachedAleksander Morgado
So that we can use it in other interfaces to abort invocations e.g. if the modem is not yet enabled.
2021-03-24iface-modem: avoid check for SIM swap if no interface skeleton availableAleksander Morgado
2021-03-24iface-modem: avoid lock info update if no interface skeleton availableAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/351
2021-03-10api,modem: new 'MaxActiveMultiplexedBearers' propertyAleksander Morgado
In addition to the amount of bearers a user may connect without multiplexing enabled (the default until now), we now also expose the maximum number of bearers a user may connect after enabling multiplexing over one single network interface (if supported). The method responsible for creating the MMBearerList is now also subclassable, so that implementations supporting multiplexing can provide their own version with their own thresholds.
2021-03-10api,modem: deprecate the 'MaxBearers' propertyAleksander Morgado
This property was never initialized with a correct value, we would always use the same value as used for MaxActiveBearers, which isn't technically right. Just suggest to ignore this property, and flag it as deprecated. In addition to deprecating the API property, we will internally no longer limit the amount of bearer objects that may be created with different connection settings. The bearer object exposed in DBus is a representation of the connection that may be setup, and so we can hold as many representations as we want as long as the amount of connected bearers doesn't exceed the maximum amount for each modem. Leaving around the disconnected modems also serves another purpose. Each bearer holds information about the amount of times a connection with it has been attempted, and the amount of data transferred through it. If we use the Simple.Connect() method to connect the modem using different bearer settings, we won't lose the information of the past connection attempts with different settings.
2021-01-11iface-modem: avoid leaking the MmGdbusModem when bearers are updatedAleksander Morgado
See See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/302
2020-12-21iface-modem: don't consider charset setup failure as fatal.Frederic Martinsons
On some modem (for example SORACOM SC-QGLC4-C1) , the character set setup step fails with "Unknown error" when the SIM card is missing or locked. This leads to not expose Modem interface and not being able to unlocked the SIM. We should not consider this step as fatal but just issue a warning to let other steps continue (which will let modem in failed state anyway). Closes #289 Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-26base-sim: Reprobe modem if lock status cannot be read after sending pukPavan Holla
If the lock status cannot be read during a puk unblock attempt, reprobe the modem. It is likely that the SIM was permanently blocked if the lock status cannot be read.
2020-11-09broadband-modem-qmi: peeking QMI port only in QMI modemsAleksander Morgado
Move the logic out of the base modem, and make it applicable only for QMI modems.
2020-11-09broadband-modem-mbim: peeking MBIM port only in MBIM modemsAleksander Morgado
Move the logic out of the base modem, and make it applicable only for MBIM modems.