diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-08-06 10:15:36 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2018-09-22 10:09:19 +0200 |
commit | 5f6ebc7c544100153c2b019268cb55f889476a64 (patch) | |
tree | 2c464dd588a62c479e40f875659bb6b9e69b3341 | |
parent | 2e6bcd3171ee7c033fea54a74588c1e2ec1af1f6 (diff) | |
download | ModemManager-5f6ebc7c544100153c2b019268cb55f889476a64.tar.gz |
broadband-modem: allow Enable() if disabling or initializing
The first step in the Enable() processing is to wait for a final
state, so we can definitely wait for the ongoing disabling or
initializing states to finish before we go on with the enable
operation, there is no need to early fail if the disabling or
initializing intermediate states are detected.
(cherry picked from commit 8430b051139cc4ca5711345f6244ca5cf160c7e6)
-rw-r--r-- | src/mm-broadband-modem.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 8c0835661..a4be504d6 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -9969,12 +9969,10 @@ enable (MMBaseModem *self, break; case MM_MODEM_STATE_FAILED: - case MM_MODEM_STATE_INITIALIZING: g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, - "Cannot enable modem: " - "device not fully initialized yet"); + "Cannot enable modem: initialization failed"); break; case MM_MODEM_STATE_LOCKED: @@ -9984,7 +9982,9 @@ enable (MMBaseModem *self, "Cannot enable modem: device locked"); break; - case MM_MODEM_STATE_DISABLED: { + case MM_MODEM_STATE_INITIALIZING: + case MM_MODEM_STATE_DISABLED: + case MM_MODEM_STATE_DISABLING: { EnablingContext *ctx; ctx = g_new0 (EnablingContext, 1); @@ -9997,14 +9997,6 @@ enable (MMBaseModem *self, return; } - case MM_MODEM_STATE_DISABLING: - g_task_return_new_error (task, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot enable modem: " - "currently being disabled"); - break; - case MM_MODEM_STATE_ENABLING: g_assert_not_reached (); break; |