aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-06-09udev: Match WWAN "type" attribute instead of device nameStephan Gerhold
Recent changes in the WWAN framework in the kernel changed the WWAN port names from e.g. "wwan0p1AT" and "wwan0p2QMI" to "wwan0at0" and "wwan0qmi0" [1, 2]. This means that the udev rules no longer match since AT/QMI are now lower-case and no longer at the end of the name. However, recently additionally a "type" sysfs attribute was added for all WWAN ports [3], which makes it much more reliable to match the WWAN port names without relying on their exact device name. Add some additional udev rules to apply the port hints based on the "type" sysfs attributes. This fixes the port enumeration on newer Linux kernels that include the aforementioned commits. Note that we still need to keep the old udev rules for now since Linux 5.13 does not have the "type" attribute yet. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=392c26f7f133b9f09e5f58db1ce6ef4b3b4df49f [2]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=f458709ff40b0d992fec496952f79c7820dd3fde [3]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=b3e22e10fdda8e7be3830289a4a63ae8b88d450c
2021-06-06udev: only flag as candidates the wwan ports, not the full deviceAleksander Morgado
Explicitly ignore the "wwan_dev" device as it is not associated with separate ports (which is what MM needs), but with the whole device instead. See https://lists.freedesktop.org/archives/modemmanager-devel/2021-May/008629.html
2021-06-06core: skip suggesting FCC unlock may be neededAleksander Morgado
This message is too specific, and there are a lot of cases where it wouldn't apply. E.g. when a MBIM module is stuck in low power mode due to some other reason (like hardware rfkill), this message would pop up to the users and completely confuse them.
2021-06-02shared-qmi: add missing g_autoptr() NULL initializerAleksander Morgado
2021-06-01broadband-modem-mbim: skip switch() when selecting MBIM servicesAleksander Morgado
Having a switch() for the MBIM services when processing indications forces us to update it on every new MBIM service added to libmbim, because we build with -Wswitch-enum by default. This warning type is extremely useful, and we should not stop using it, so let's simplify a bit the indication handling code and skip using a switch(). There are right now only 4 different service indications expected, so it shouldn't be a big deal.
2021-05-31mbim: Increase mbim_device_open_full timeoutJarvis-Jiang-G
After fwupd upgrade with mbim-qdu method, MM sometimes generate plugin failed with the regenerated MHI driver. This patch increases the mbim_device_open_full timeout from 30 seconds to 45 seconds to prevent such issue. Signed-off-by: Jarvis Jiang <jarvis.w.jiang@gmail.com>
2021-05-26bearer-mbim: implement reload_connection_status()Aleksander Morgado
Implement connection status reloading for MBIM based bearers. Based on a patch by Dylan Van Assche <me@dylanvanassche.be>
2021-05-26bearer-qmi: implement reload_connection_status() for the sync operationAleksander Morgado
The original load_connection_status() method would return an UNSUPPORTED error if connection monitoring wasn't required (which is the default in most QMI modems). The new reload_connection_status() method requires the check to always be done unconditionally. We take most of the original logic in the load_connection_status() for the new reload_connection_status(), and we add the UNSUPPORTED error logic exclusively in the new load_connection_status().
2021-05-26broadband-bearer: reuse the same method for load and reloadAleksander Morgado
The load_() method is used for connection monitoring; while the reload_() method is used to sync connection status after a suspend/resume operation. The same method can be used for both things in the case of AT+CGACT? based modems.
2021-05-26base-bearer: 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,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: propagate the new connection status after reloadAleksander Morgado
Just triggering a connection status reload won't change the actual bearer object state. We change the signature of the reload_connection_status_finish() method so that it returns the actual reloaded bearer connection status, and so both the load_ and reload_ methods can be implemented with exactly the same method, something that was not possible before. Once we get the new connection status reloaded, we apply it in the bearer object only if it's DISCONNECTED (and it wasn't DISCONNECTED before). This should cover the true real case we're interested in, and nothing else (i.e. we won't overcomplicate the logic attempting to handle disconnected->connected transitions detected in the sync() operation).
2021-05-26base-bearer: fix connection reload completionAleksander Morgado
If we called the class reload_connection_status() method, we should call the class reload_connection_status_finish() as well.
2021-05-26base-bearer: improve comments of the load/reload_connection_status() methodsAleksander Morgado
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-26broadband-modem: abort sync if locked SIM card foundAleksander Morgado
We made sure that the after resume synchronization was only started on modems that had been enabled (and so unlocked). If we detect a locked SIM card during the sync operation, it's either because the SIM card was swapped, or because the modem was fully shutdown during the suspension (and so the SIM requires SIM-PIN again). Either way, we cannot sync the state cleanly at this point, we must trigger a full modem reprobe in order to move back the modem state to Locked.
2021-05-26broadband-modem: fix state machine logic when synchronizing modem interfaceAleksander Morgado
2021-05-26broadband-modem: fail synchronization if no modem exported in DBusAleksander Morgado
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-26broadband-modem: skip 3GPP interface sync if no 3GPP supportAleksander Morgado
2021-05-26broadband-modem: fix type in the ready() for iface_modem_3gpp_sync()Aleksander Morgado
When calling an async method ona given type, the convention is to use the same type in the corresponding ready() method, so that we can use it without additional casts on the finish().
2021-05-26iface-modem-3gpp: 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-3gpp: remove redundant log messageAleksander Morgado
It doesn't give us any valuable information, so just remove it.
2021-05-26iface-modem-3gpp: fix double GError free on registration sync failureAleksander Morgado
2021-05-26iface-modem-3gpp: use g_autoptr() for the MMBearerProperties during syncAleksander Morgado
2021-05-26iface-modem-3gpp: synchronize state when resumingDylan Van Assche
On resume, refresh the EPS bearers and 3GPP registration as the registration and bearers may expired during suspend.
2021-05-26iface-modem-time: 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-26broadband-modem: skip time interface sync if no time supportAleksander Morgado
2021-05-26iface-modem-time: synchronize state when resumingDylan Van Assche
On resume, fetch the current network time as the network time may be changed when suspended.
2021-05-26broadband-modem: skip synchronization after resume if not neededAleksander Morgado
The synchronization after resume should only be needed on enabled modems, as otherwise there is really no chance that the state of the modem may have changed during suspend. E.g. if a modem is failed because it doesn't have a SIM card, or if the SIM-PIN is locked, or if the modem has never been enabled, there is no point in attempting to synchronize the runtime state of the modem.
2021-05-26broadband-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-26base-modem: make sync() available only if suspend-resume enabledAleksander Morgado
2021-05-26base-modem: don't fail if sync() isn't implementedAleksander Morgado
2021-05-26base-modem: fix modem_sync() operation handlingAleksander Morgado
The mm_base_modem_sync() method is an asynchronous method that receives a callback and user data, and therefore we MUST always complete the async method calling that callback. Set that up with a GTask as usual. Also, the mm_base_modem_sync_finish() method should be implemented along with mm_base_modem_sync(), not in the source file of the caller of the async method. The finish() always depends on how the async method was implemented, in our case using a GTask.
2021-05-26base-manager: avoid using the `mm_` prefix for static private methodsAleksander Morgado
2021-05-26base-manager: don't assume a MMDevice always holds a MMModemAleksander Morgado
There are cases, e.g. during modem object disposal, where this is not true.
2021-05-26base-manager: make sure g_autoptr() variables are initialized to NULLAleksander Morgado
Otherwise, we may have memory issues if the variable isn't initialized and the method exits.
2021-05-26base-manager: add quick suspend/resume baseDylan Van Assche
Quick suspend/resume infrastructure for synchronizing the interfaces when resuming.
2021-05-26base-manager: ensure all GUdevDevices have subsystem and name setAleksander Morgado
Under certain rare conditions (e.g. race between querying devices of a given subsystem and the kernel tearing those devices down), the subsystem reported for a GUdevDevice seems to be NULL. So, ensure both subsystem and name are set on the GUdevDevice before we process them. The issue has been observed on GUdevDevices listed by g_udev_client_query_by_subsystem(), not on the ones asynchronously reported via uevents, but we add the validity check on both places for consistency. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/343
2021-05-26broadband-modem-qmi: assume all QMI based modems support SIM hot swapAleksander Morgado
As we have a generic SIM hot swap implementation in the QMI broadband modem object.
2021-05-24broadband-modem: check if skeleton exists when creating device idAleksander Morgado
The logic that creates the device identifier uses some fields that are exposed in DBus (e.g. model, manufacturer...). We should not attempt to load any of that info if the DBus skeleton for the Modem interface is no longer available, as e.g. the device may have gone away already. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/374
2021-05-24broadband-modem: trivial coding style fixAleksander Morgado
2021-05-23mm-iface-modem: fix typo in step functionDylan Van Assche
2021-05-22iface-modem-3gpp: skip initialization in LOCKED stateMichal Mazur
2021-05-22broadband-modem: allow 3GPP initialization before fallbackMichal Mazur
To enable call to disable-facility-lock in LOCKED state, 3gpp interface needs to be initialized before going to fallback step.
2021-05-22modem-qmi: detect personalization locks in LOCKED stateMichal Mazur
2021-05-22base-sim: ignore personalization locks after SIM unlockMichal Mazur
2021-05-23bearer-mbim: network error 0 is actually a valid error (unknown)Aleksander Morgado