aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
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-27core: ensure all errors returned in DBus operations are normalizedAleksander Morgado
We want to ensure that all errors reported via DBus operations are normalized to MM-specific errors. We don't want to return QMI or MBIM specific errors, as those are protocol specific and we don't want DBus clients to need to rely on knowing which is the protocol in use by the device.
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-10-09iface-modem: fix error message for failed mode settingokaestne
2023-09-27iface-modem: actually respect build optionsRobert Marko
iface-modem does not include config.h so it doesnt actually have the meson generated build defines to check against. I found this while trying to use AT commands over D-Bus by enabling at_command_via_dbus, confirming that Meson sees it, defines it in config.h but then I still got the: "Cannot send AT command to modem: operation only allowed in debug mode". Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2023-09-18api,modem: new 'Physdev' propertyLukas Voegl
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2023-09-11iface-modem: ensure error is set when UNKNOWN returned in modem state waitAleksander Morgado
2023-09-11iface-modem: ignore UNKNOWN modem state explicitly during wait operationAleksander Morgado
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.
2023-06-14iface-modem: ignore sim swap check if not implementedAleksander Morgado
Explicitly return TRUE to indicate success because otherwise the caller will expect a valid GError set.
2023-05-12broadband-modem-mbim: account for race condition in quick hot swap caseNagi Marupaka
On MBIM modems, when the SIM is ejected and re-inserted in a quick manner, the state machine logic encounters a race condition and eventually, the modem response for subscriber status is ignored. This change accounts for that state transition without erroring out. Fixes #672.
2023-05-11mm-iface-modem: increase the SIM retries to 7Nagi Marupaka
In some cases modem is taking 7 tries to detect an initialized SIM.
2023-04-11iface-modem: fix incorrectly halted periodic signal checksAleksander Morgado
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 0080ed612d0a412c5794059a93ed30ca07103b79 Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/702
2022-11-04iface-modem: decrease severity of logs that don't affect functionalityAleksander Morgado
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-04iface-modem: improve logging of user request to set current modesAleksander Morgado
2022-11-04iface-modem: improve logging of user request to set current bandsAleksander Morgado
2022-11-04iface-modem: improve logging of user request to factory reset modemAleksander Morgado
2022-11-04iface-modem: improve logging of user request to reset modemAleksander Morgado
2022-11-04iface-modem: improve logging of user request to set power stateAleksander Morgado
2022-11-04iface-modem: improve logging of user request to enable/disable modemAleksander Morgado
2022-11-04iface-modem: improve logging of user request to get cell infoAleksander Morgado
2022-11-04iface-modem: improve logging of user request to set primary SIM slotAleksander Morgado
2022-11-04iface-modem: improve logging of user request to delete bearerAleksander Morgado
2022-11-04iface-modem: improve logging of user request to run AT commandAleksander Morgado
2022-11-04iface-modem: improve logging of user request to set current capabilitiesAleksander Morgado
2022-11-04iface-modem: improve logging of user request to create bearerAleksander Morgado
2022-11-04iface-modem: refactor user request to list bearersAleksander Morgado
2022-11-04iface-modem: improve logging in INFO levelAleksander Morgado
2022-11-04core,log: new 'MSG' log level between 'INFO' and 'WARN'Aleksander Morgado
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-10-11mm-iface-modem: always require a SIM card in 3GPP modulesAkash Aggarwal
Avoid removing 3GPP capabilities if sim is absent. Transition to 'Failed' state for 3GPP capable devices if sim is absent.
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