summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRatchanan Srirattanamet <ratchanan@ubports.com>2022-10-14 22:45:26 +0700
committerThomas Haller <thaller@redhat.com>2022-11-10 07:44:59 +0100
commitf0ef4a440f5098b08c055ffd2222591da03f9419 (patch)
tree96e05c5c5be82aa462a11736a704567876aa108f
parent2f3a0eaa0bcf463b9e863406fa1d428b49d9d576 (diff)
wwan/device-modem: re-check device availability after enable
It's possible that the modem is enabled outside of NM. If not re-check, device could stay disabled throughout until something else about the modem changes again.
-rw-r--r--src/core/devices/wwan/nm-device-modem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/devices/wwan/nm-device-modem.c b/src/core/devices/wwan/nm-device-modem.c
index 15256781b4..b83120f947 100644
--- a/src/core/devices/wwan/nm-device-modem.c
+++ b/src/core/devices/wwan/nm-device-modem.c
@@ -615,6 +615,11 @@ set_enabled(NMDevice *device, gboolean enabled)
if (enabled == FALSE) {
nm_device_state_changed(device, NM_DEVICE_STATE_UNAVAILABLE, NM_DEVICE_STATE_REASON_NONE);
+ } else {
+ /* It's possible that the modem is enabled outside of NM. Need to recheck. */
+ nm_device_queue_recheck_available(device,
+ NM_DEVICE_STATE_REASON_MODEM_AVAILABLE,
+ NM_DEVICE_STATE_REASON_MODEM_FAILED);
}
}