From e5920efe092ea41965ecf11fc98193e18bd502b3 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 11 Jul 2014 11:51:38 +0200 Subject: [PATCH] broadband-modem-mbim: VZ20M returns ERROR_PIN_REQUIRED in PIN query response VID/PID: 258d:e000 Instead of returning success and the PIN type + PIN status + Remaining attempts, this modem returns a plain ERROR_PIN_REQUIRED error, so try to handle that... --- src/mm-broadband-modem-mbim.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c index be6c5017..b2f9debf 100644 --- a/src/mm-broadband-modem-mbim.c +++ b/src/mm-broadband-modem-mbim.c @@ -553,7 +553,15 @@ pin_query_ready (MbimDevice *device, g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (unlock_required), NULL); - } else + } + /* VZ20M reports an error when SIM-PIN is required... */ + else if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_PIN_REQUIRED)) { + g_error_free (error); + g_simple_async_result_set_op_res_gpointer (ctx->result, + GUINT_TO_POINTER (MBIM_PIN_TYPE_PIN1), + NULL); + } + else g_simple_async_result_take_error (ctx->result, error); if (response)