aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-3gpp.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-30 11:06:32 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-30 13:47:00 +0200
commit7518772d4bcb5f6a2c5d4fcf33346e1036625755 (patch)
treede9de16e3eae87797bbe8c44c0b8fecbe6ddd276 /src/mm-iface-modem-3gpp.c
parent3b366118b66bb27642a72adb49ceafaab5b6da5d (diff)
core: fatal errors in iface initializations force the modem into a FAILED state
Modems which end up being found unusable (e.g. no SIM, fatal SIM error, no capabilities) will be exposed in DBus, but just with the Modem interface and in a FAILED state which allows no actions.
Diffstat (limited to 'src/mm-iface-modem-3gpp.c')
-rw-r--r--src/mm-iface-modem-3gpp.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index 109cdd57..a2bbf20d 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -188,8 +188,10 @@ handle_register_auth_ready (MMBaseModem *self,
NULL);
switch (modem_state) {
+ case MM_MODEM_STATE_FAILED:
case MM_MODEM_STATE_UNKNOWN:
- /* We should never have a UNKNOWN->REGISTERED transition */
+ case MM_MODEM_STATE_LOCKED:
+ /* We should never have such request (interface wasn't exported yet) */
g_assert_not_reached ();
break;
@@ -199,13 +201,6 @@ handle_register_auth_ready (MMBaseModem *self,
MM_CORE_ERROR_WRONG_STATE,
"Cannot register modem: "
"device not fully initialized yet");
- handle_register_context_free (ctx);
- return;
-
- case MM_MODEM_STATE_LOCKED:
- /* We should never have such request in LOCKED state
- * (interface wasn't exported yet) */
- g_assert_not_reached ();
break;
case MM_MODEM_STATE_ENABLED:
@@ -381,8 +376,10 @@ handle_scan_auth_ready (MMBaseModem *self,
NULL);
switch (modem_state) {
+ case MM_MODEM_STATE_FAILED:
case MM_MODEM_STATE_UNKNOWN:
- /* We should never have such request in UNKNOWN state */
+ case MM_MODEM_STATE_LOCKED:
+ /* We should never have such request (interface wasn't exported yet) */
g_assert_not_reached ();
break;
@@ -392,13 +389,6 @@ handle_scan_auth_ready (MMBaseModem *self,
MM_CORE_ERROR_WRONG_STATE,
"Cannot scan networks: "
"device not fully initialized yet");
- handle_scan_context_free (ctx);
- return;
-
- case MM_MODEM_STATE_LOCKED:
- /* We should never have such request in LOCKED state
- * (interface wasn't exported yet) */
- g_assert_not_reached ();
break;
case MM_MODEM_STATE_DISABLED: