summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-09-18 19:56:41 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-09-18 19:56:41 +0200
commit432675448b4abb768cbafd9102acaa70d9afe8a4 (patch)
tree107a040b2e0661ce1bbd379e4a6a7a5b7e9ccdb3
parent792c84a5189dbf73ffd7c56d94a68bfa87710393 (diff)
downloadModemManager-aleksander/qmi-unlock-check.tar.gz
broadband-modem-qmi: make 'internal' errors on pin check retriablealeksander/qmi-unlock-check
When we get an internal error while checking the lock status, tell the upper layers that we can retry the check. It's been observed that this internal error may be issued not only when e.g. there is no SIM, but also when the SIM is not yet fully ready.
-rw-r--r--src/mm-broadband-modem-qmi.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index df95bd657..b7ad42256 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -1442,21 +1442,31 @@ dms_uim_get_pin_status_ready (QmiClientDms *client,
g_prefix_error (&error, "QMI operation failed: ");
g_simple_async_result_take_error (simple, error);
} else if (!qmi_message_dms_uim_get_pin_status_output_get_result (output, &error)) {
- /* When no SIM inserted, an internal error when checking PIN status
- * needs to be fatal so that we mark the modem unusable. */
+ /* Fatal, so that we mark the modem unusable.*/
if (g_error_matches (error,
QMI_PROTOCOL_ERROR,
- QMI_PROTOCOL_ERROR_INTERNAL) ||
- g_error_matches (error,
- QMI_PROTOCOL_ERROR,
QMI_PROTOCOL_ERROR_UIM_UNINITIALIZED)) {
+ /* This error won't force a pin check retry */
g_simple_async_result_set_error (simple,
MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE,
- "Couldn't get PIN status: %s",
+ "SIM failure: %s",
error->message);
g_error_free (error);
- } else {
+ }
+ /* Internal errors are retry-able before being fatal */
+ else if (g_error_matches (error,
+ QMI_PROTOCOL_ERROR,
+ QMI_PROTOCOL_ERROR_INTERNAL)) {
+ g_simple_async_result_set_error (simple,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_RETRY,
+ "Couldn't get PIN status (retry): %s",
+ error->message);
+ g_error_free (error);
+ }
+ /* Other errors, just propagate them */
+ else {
g_prefix_error (&error, "Couldn't get PIN status: ");
g_simple_async_result_take_error (simple, error);
}