aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.h
AgeCommit message (Collapse)Author
2023-12-01iface-modem: allow cancellability during unlock required checksAleksander Morgado
The process doing the unlock required checks may need a lot of retries e.g. to decide whether a SIM card is available or not. If we do a quick SIM eject, so the unlock required check starts looping, and then insert the SIM again, we expect the loop to be cancelled right away, so that the new modem object can be reprobed without any interference from the old modem object. We now take the modem-wide cancellable and bind it to the GTask in mm_iface_modem_update_lock_info(), and we pass it down to every sub-step of the async logic in the operation. We also plug the cancellable to the delayed retries in the interface logic, to allow aborting the checks right away
2023-10-11iface-modem: new logic to detect SIM swap with explicit IMSI/ICCID queryRukun Mao
This improves SIM hot swap check process, and it can help avoid unnecessary modem reprobe during suspend-resume without SIM inserted. The changes in this CL implemented the new logic ONLY for MBIM, and the new logic has not been implemented for QMI and AT yet. Thus, we keep the legacy `mm_iface_modem_check_for_sim_swap()' till the new logic for QMI and AT has been implemented.
2023-06-14iface-modem: sim swap check always refers to the active SIMAleksander Morgado
Since 503e886c02 the events on inactive SIMs don't trigger a full modem reprobe, and the slot index check is fully unused.
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-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-01-30iface-modem: make update_unlock_retries method staticMichal Mazur
2022-01-18iface-modem: implement support for 'GetCellInfo()'Aleksander 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-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-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-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-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-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.
2020-09-19core: add autoptr cleanup methods to all internal typesAleksander Morgado
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-06-12broadband-modem-qmi: also build 5GS reg state from Serving SystemAleksander Morgado
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-09api: new 5G modeAleksander Morgado
2020-02-12iface-modem: allow loading current required lock infoAleksander Morgado
2019-10-11iface-modem: allow plugins to disable access technology pollingAleksander Morgado
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.
2019-09-15iface-modem: report last attempt to load_unlock_required implementationsAleksander Morgado
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.
2019-04-02api,modem: new 'CarrierConfigurationRevision' propertyAleksander Morgado
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).
2019-04-02firmware: export a device id containing the carrier infoAleksander Morgado
In order to support different per-carrier upgrade paths in fwupd.
2019-04-02iface-modem: new carrier config supportAleksander Morgado
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.
2019-01-03api,firmware: expose firmware versionAleksander Morgado
2018-04-24modem: allow periodic signal check to be disabledBen Chan
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.
2017-12-18mm-iface-modem: add check_for_sim_swap method and enable stepsEric Caruso
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.
2017-09-20iface-modem: add hook to load hardware revisionBen Chan
2017-09-20iface-modem: add mm_iface_modem_get_unlock_retries helperBen Chan
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.
2017-09-07iface-modem: export update_unlock_retries outside MMIfaceModemBen Chan
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.
2017-08-01sim hot swap: improved error managementCarlo Lobrano
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.
2017-06-06iface-modem: consolidate signal quality and access tech pollingAleksander Morgado
Plugins have two ways to update signal quality and access technology values: via unsolicited messages or via polling periodically. Instead of keeping separate contexts for polling signal quality and access technology values, we setup a common timeout to trigger both. This allows us to simplify in which case the explicit update is required, whenever one is needed to be explicitly updated, the other one should also be. The logic now also allows plugins to return an UNSUPPORTED error in either load_signal_quality() and/or load_access_technologies() to tell the interface logic that the polling of the specific item shouldn't be performed (e.g. if the updates are expected via unsolicited messages). If both signal quality and access technology polling is flagged as disabled, we totally disable the polling logic internally. The new SignalCheckContext is bound to the lifetime of the object so that we can keep the value of the supported flags until the object is destroyed.
2016-08-10modem: support SIM hot swapCarlo Lobrano
BaseModem added reprobe property. MMDevice added logic to recreate the modem if it is set invalid and "to reprobe" MMBroadbandModem * added initialization step for SIM hot swap: 1. keep dedicated ports open to listen to modem's unsolicited 2. dedicated error management in case of initialization failure due to SIM missing * added function to be called in order to act upon SIM insertion/removal: 1. close dedicated ports 2. set the modem to be reprobed 3. disable modem * added SIM HOT SWAP boolean property MMIfaceModem * added initialization step for SIM hot swap, if supported by the plugin * dedicated error management in case of initialization failure due to SIM missing
2014-07-06sim: rename 'MMSim' to 'MMBaseSim'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-07-06bearer: rename 'MMBearer' to 'MMBaseBearer'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-02-28iface-modem: allow requesting the refresh of the access techAleksander Morgado
For periodic updates, we may want to request an explicit re-check at some point, instead of waiting for the next scheduled update.
2014-02-20iface-modem: allow transitioning to the OFF power stateAleksander Morgado
There are systems in which the modem power source can be controlled externally, e.g. to switch it on or off. In these cases, it is sometimes advisable to be able to tell the modem to cleanly shut off completely before the power is cut. So, allow transitioning to the OFF power state if the modem supports it, even if afterwards the modem could be completely unreachable.
2014-02-13ports: rename 'MMAtSerialPort' to 'MMPortSerialAt'Aleksander Morgado
2013-11-21altair-lte: add SIMREFRESH supportThieu Le
Register for SIMREFRESH event and reload own numbers and reregister modem with network when this happens.
2013-08-14iface-modem: add mm_iface_modem_get_model helper to query modelBen Chan
2013-06-05api,introspection: new 'SetCurrentCapabilities' methodAleksander Morgado
For those modems which expose a valid 'SupportedCapabilities' property with more than one item in the list, we'll allow switching between them.
2013-06-05api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'Aleksander Morgado
And also make it a list of masks, specifying which are the specific combinations supported, not just one mask with all. E.g.: ------------------------- Hardware | manufacturer: 'Sierra Wireless, Incorporated' | model: 'MC7710' | revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14' | supported: 'gsm-umts | gsm-umts, lte' | current: 'gsm-umts, lte' | equipment id: '358178040668164'
2013-06-05api,introspection: merge 'AllowedModes' and 'SupportedMode' into 'CurrentModes'Aleksander Morgado
We now have a single 'CurrentModes' property which contains both values in a tuple with signature "(uu)". Also, rename 'SetAllowedModes()' to 'SetCurrentModes()', and update the list of arguments expected to have a single "(uu)" tuple.
2013-06-05api,introspection: 'SupportedModes' is now a list of possible combinationsAleksander Morgado
Instead of just a mask of MMModemMode values, we now provide a list of the allowed and preferred mode combinations supported by the modem. E.g.: $> sudo mmcli -m 0 ------------------------- Modes | supported: 'allowed: 2g; preferred: none | allowed: 3g; preferred: none | allowed: 2g, 3g; preferred: none | allowed: 2g, 3g; preferred: 2g | allowed: 2g, 3g; preferred: 3g | allowed: 4g; preferred: none | allowed: 2g, 3g, 4g; preferred: none'