aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-09-18 19:56:41 +0200
committerDan Williams <dcbw@redhat.com>2013-09-19 09:33:08 -0500
commit6b4602a3356e779389ef97bac0b8461e6d26fc41 (patch)
tree41e2129636a216160d5f3b63c5e1b2d6e38dd527
parent13c7319bffe80545a5c7e8399ad6279b8d3cd87d (diff)
broadband-modem-qmi: make 'internal' errors on pin check retriable
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 df95bd65..b7ad4225 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);
}