From 10a0ed12c461242ca3dbf6f9192907d320b561f7 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Thu, 18 Oct 2012 23:44:19 -0700 Subject: [PATCH] novatel-lte: retry $NWQMISTATUS upon an unknown error during connecting The $NWQMISTATUS command sometimes replies an ERROR shortly after calling the $NWQMICONNECT command, but then replies the proper QMI status if we retry it. This behavior is observed on an E362 modem with 4.08 firmware. (ttyUSB0): --> 'AT$NWQMICONNECT=,,,,,,"",,,"",""' (ttyUSB0): <-- 'OK' (ttyUSB0): --> 'AT$NWQMISTATUS' (ttyUSB0): <-- 'ERROR' Got failure code 100: Unknown error QMI connection status failed: Unknown error --- plugins/novatel/mm-broadband-bearer-novatel-lte.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/novatel/mm-broadband-bearer-novatel-lte.c b/plugins/novatel/mm-broadband-bearer-novatel-lte.c index bf085cd0..80c74645 100644 --- a/plugins/novatel/mm-broadband-bearer-novatel-lte.c +++ b/plugins/novatel/mm-broadband-bearer-novatel-lte.c @@ -193,12 +193,14 @@ connect_3gpp_qmistatus_ready (MMBaseModem *modem, &error); if (!result) { mm_warn ("QMI connection status failed: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); - return; - } - - if (is_qmistatus_connected (result)) { + if (!g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN)) { + g_simple_async_result_take_error (ctx->result, error); + detailed_connect_context_complete_and_free (ctx); + return; + } + g_error_free (error); + result = "Unknown error"; + } else if (is_qmistatus_connected (result)) { MMBearerIpConfig *config; mm_dbg("Connected");