diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-21 18:42:09 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-23 19:18:59 +0200 |
commit | 5fe02b819be6b441c6cc80516cfa1b1fb0d8f14e (patch) | |
tree | 89c29bb86f9810f3ef76a1be790133767541b275 | |
parent | 8cee215443cf4eaf4f43e7ac7cd4ffee9a55c284 (diff) |
bearer-qmi: 'no-effect' errors while starting network aren't fatal
-rw-r--r-- | src/mm-bearer-qmi.c | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index 954ff98e..b41477f9 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -130,34 +130,47 @@ start_network_ready (QmiClientWds *client, } if (!qmi_message_wds_start_network_output_get_result (output, &error)) { - mm_info ("error: couldn't start network: %s", error->message); + /* No-effect errors should be ignored. The modem will keep the + * connection active as long as there is a WDS client which requested + * to start the network. If ModemManager crashed while a connection was + * active, we would be leaving an unreleased WDS client around and the + * modem would just keep connected. */ if (g_error_matches (error, QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_CALL_FAILED)) { - guint16 cer; - guint16 verbose_cer_type; - guint16 verbose_cer_reason; - - if (qmi_message_wds_start_network_output_get_call_end_reason ( - output, - &cer, - NULL)) - mm_info ("call end reason: %u", cer); - - if (qmi_message_wds_start_network_output_get_verbose_call_end_reason ( - output, - &verbose_cer_type, - &verbose_cer_reason, - NULL)) - mm_info ("verbose call end reason: %u, %u", - verbose_cer_type, - verbose_cer_reason); + QMI_PROTOCOL_ERROR_NO_EFFECT)) { + g_error_free (error); + + /* Fall down to a successful connection */ + } else { + mm_info ("error: couldn't start network: %s", error->message); + if (g_error_matches (error, + QMI_PROTOCOL_ERROR, + QMI_PROTOCOL_ERROR_CALL_FAILED)) { + guint16 cer; + guint16 verbose_cer_type; + guint16 verbose_cer_reason; + + if (qmi_message_wds_start_network_output_get_call_end_reason ( + output, + &cer, + NULL)) + mm_info ("call end reason: %u", cer); + + if (qmi_message_wds_start_network_output_get_verbose_call_end_reason ( + output, + &verbose_cer_type, + &verbose_cer_reason, + NULL)) + mm_info ("verbose call end reason: %u, %u", + verbose_cer_type, + verbose_cer_reason); + } + + g_simple_async_result_take_error (ctx->result, error); + connect_context_complete_and_free (ctx); + qmi_message_wds_start_network_output_unref (output); + return; } - - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); - qmi_message_wds_start_network_output_unref (output); - return; } qmi_message_wds_start_network_output_get_packet_data_handle (output, &ctx->packet_data_handle, NULL); |