broadband-modem-mbim: don't make no-SIM errors directly fatal, retry instead
The MC7710 will report a MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED status when initializing and the SIM is not ready yet. So retry a couple of times as we do for MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED. If all retries are consumed, get the last reported status to build the error. This change makes all modems without SIM require up to 10s to get fully initialized and exposed in DBus; but it shouldn't be a big deal as the modems are unusable anyway. https://bugzilla.gnome.org/show_bug.cgi?id=698264
This commit is contained in:
@@ -527,7 +527,8 @@ unlock_required_subscriber_ready_state_ready (MbimDevice *device,
|
|||||||
/* Don't set error */
|
/* Don't set error */
|
||||||
break;
|
break;
|
||||||
case MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED:
|
case MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED:
|
||||||
error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED);
|
/* This is an error, but we still want to retry.
|
||||||
|
* The MC7710 may use this while the SIM is not ready yet. */
|
||||||
break;
|
break;
|
||||||
case MBIM_SUBSCRIBER_READY_STATE_BAD_SIM:
|
case MBIM_SUBSCRIBER_READY_STATE_BAD_SIM:
|
||||||
error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG);
|
error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG);
|
||||||
@@ -546,8 +547,15 @@ unlock_required_subscriber_ready_state_ready (MbimDevice *device,
|
|||||||
load_unlock_required_context_complete_and_free (ctx);
|
load_unlock_required_context_complete_and_free (ctx);
|
||||||
}
|
}
|
||||||
/* Need to retry? */
|
/* Need to retry? */
|
||||||
else if (ready_state == MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED) {
|
else if (ready_state == MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED ||
|
||||||
|
ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED) {
|
||||||
if (--ctx->n_ready_status_checks == 0) {
|
if (--ctx->n_ready_status_checks == 0) {
|
||||||
|
/* All retries consumed, issue error */
|
||||||
|
if (ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED)
|
||||||
|
g_simple_async_result_take_error (
|
||||||
|
ctx->result,
|
||||||
|
mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED));
|
||||||
|
else
|
||||||
g_simple_async_result_set_error (ctx->result,
|
g_simple_async_result_set_error (ctx->result,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
|
Reference in New Issue
Block a user