aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
AgeCommit message (Collapse)Author
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.
2020-09-14iface-modem: don't reconfigure sim hot swap context on SIM PIN unlockAleksander Morgado
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.
2020-09-08iface-modem: add mm_iface_modem_check_for_sim_swap functionTeijo Kinnunen
The function shall be needed for profile switch checking.
2020-09-07iface-modem: add an optional iccid parameter to check_for_sim_swapTeijo Kinnunen
If the new iccid is already available, reading the iccid from the card can be skipped.
2020-08-28api,modem: new 'SetPrimarySimSlot' methodAleksander Morgado
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).
2020-08-28api,modem: new 'SimSlots' and 'PrimarySimSlot' propertiesAleksander Morgado
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.
2020-08-12iface-modem: avoid connection status flapping if briefly unregisteredAleksander Morgado
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-01iface-modem: move sim hot swap ready to correct place in sequenceAleksander Morgado
2020-06-12broadband-modem-qmi: also build 5GS reg state from Serving SystemAleksander Morgado
2020-05-19iface-modem: avoid cast-align errorsAleksander Morgado
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, ^
2020-05-18AT modem: charset definition in initGiacinto Cifelli
Charset definition moved from enable state machine to init state machine, so that the right current charset is available also during further initialization steps
2020-04-09iface-modem-3gpp: don't fixup CS network supportAleksander Morgado
This is already done by the modem interface as soon as current capabilities are loaded.
2020-04-09iface-modem-3gpp: new 5GS network supportAleksander Morgado
2020-04-09api: new 5G modeAleksander Morgado
2020-04-09api: new 5GNR capabilityAleksander Morgado
2020-04-09api: deprecate MM_MODEM_CAPABILITY_LTE_ADVANCEDAleksander Morgado
It's not used anywhere.
2020-04-09iface-modem: simplify is_cdma_only() checkAleksander Morgado
The check needs to look for a matching single bit, so no need to make it too complex.
2020-04-08iface-modem: port to use object loggingAleksander Morgado
2020-02-12iface-modem: allow loading current required lock infoAleksander Morgado
2020-01-30iface-modem: fix warnings with -Wimplicit-fallthroughAleksander Morgado
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++; | ~~~~~~~~~~~~~~~~~^~ ...
2020-01-30iface-modem: fix warnings with -Wswitch-defaultAleksander Morgado
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) { | ^~~~~~