From fb14d0dbb24a81be95502e098b8ed23e45db8e1c Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 29 Oct 2020 23:04:08 +0100 Subject: helpers-qmi: 'illegal' card application state is fatal No need to retry checking card status when the application state is illegal, just treat the SIM card as unusable right away. https://forum.sierrawireless.com/t/uim-card-application-state-illegal/21842 --- src/mm-modem-helpers-qmi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mm-modem-helpers-qmi.c') diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c index 52cad511..af0926fb 100644 --- a/src/mm-modem-helpers-qmi.c +++ b/src/mm-modem-helpers-qmi.c @@ -1924,6 +1924,16 @@ mm_qmi_uim_get_card_status_output_parse (gpointer log_ return FALSE; } + /* Illegal application state is fatal, consider it as a failed SIM right + * away and don't even attempt to retry */ + if (app->state == QMI_UIM_CARD_APPLICATION_STATE_ILLEGAL) { + g_set_error (error, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG, + "Illegal SIM/USIM application state"); + return FALSE; + } + /* If card not ready yet, return RETRY error. * If the application state reports needing PIN/PUk, consider that ready as * well, and let the logic fall down to check PIN1/PIN2. */ -- cgit v1.2.3-70-g09d2