aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
AgeCommit message (Collapse)Author
2019-12-03iface-modem: allow Command() while in Failed stateAleksander Morgado
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
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-10-11iface-modem: allow disabling signal quality polling during runtimeAleksander Morgado
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.
2019-10-11iface-modem: don't log error if it's in progressAleksander Morgado
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.
2019-10-11iface-modem: avoid using MM_CORE_ERROR_CANCELLEDAleksander Morgado
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-07-22iface-modem: don't assume that setting modes is immediateAleksander Morgado
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.
2019-07-21iface-modem: don't assume that setting bands is immediateAleksander Morgado
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.
2019-06-01build: allow unconditionally enabling Modem.Command() methodAleksander Morgado
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.
2019-05-30iface-modem: fix reporting state while registration is deniedAleksander Morgado
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'.
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-12-07iface-modem: always connect all method handlers, even in failed stateAleksander Morgado
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
2018-12-07iface-modem: remove redundant logic to update failed stateAleksander Morgado
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.
2018-08-08iface-modem: reload current bands after settingAleksander Morgado
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.
2018-04-25iface-modem: allow initial signal check after the modem is re-enabledBen Chan
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.
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.
2018-01-25*: Spelling fixesVille Skyttä
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-11-23iface-modem: remove invalid modem reference count in update_lock_info()Aleksander Morgado
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
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-08iface-modem: remove unnecessary error checkBen Chan
This patch removes an unnecessary error check in the update_unlock_retries() where the error is never set.
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-07-17iface-modem: minor coding style fixesBen Chan
2017-07-12iface-modem: fix mm_iface_modem_initialize_finishBen Chan
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.
2017-07-06iface-modem: check error returned by g_task_propagate_error insteadBen Chan
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.
2017-06-30iface-modem: use g_new0 instead of g_slice_new0 to allocate contextBen Chan
By using g_new0 instead of g_slice_new0 to allocate certain context structs, we can simply use g_free as GDestroyNotify in g_task_set_task_data and get rid of those functions that solely wrap the g_slice_free call.
2017-06-30iface-modem: port mm_iface_modem_wait_for_final_state to use GTaskBen Chan
2017-06-30iface-modem: port internal_load_unlock_required to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_update_lock_info to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_set_power_state to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_set_current_modes to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_set_current_bands to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_create_bearer to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_disable to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_enable to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_initialize to use GTaskBen Chan
2017-06-06iface-modem: if bands, capabilities or modes change, refresh signalAleksander Morgado
We also remove the explicit refresh request from the Cinterion plugin, as this is a generic action applicable to all modems that require polling for signal quality and/or access technology.
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.
2017-05-20iface-modem: always complete async context with a valueAleksander Morgado
Just for consistency, this is not a bug per se.
2017-05-15iface-modem: fix setting up signal quality retrieval logicAleksander Morgado
If going directly e.g. from "Searching" to "Connecting", just setup the signal quality retrieval logic right away, don't assume we always go through "Registered" state before starting a connection. Reported-by: <colin.helliwell@ln-systems.com>
2017-03-16iface-modem: improve network registration checks for LTE devicesAleksander Morgado
If a device reports "LTE" in the list of current capabilities, we'll set EPS network supported by default. This will enable CEREG registration checks for AT based devices. If a device reports only "LTE" in the list of current capabilities, we disable all the other network support flags (e.g. will disable CREG and CGREG checks among others). https://bugs.freedesktop.org/show_bug.cgi?id=100170
2016-10-12iface-modem: always sort supported and current bands before exposing themAleksander Morgado
2016-08-15core: use MM-specific logging methods always instead of the generic GLib onesAleksander Morgado
2016-08-10core: minor coding style changesAleksander Morgado
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