incorrect 'locked' status

David McCullough david.mccullough at accelerated.com
Tue Oct 18 23:51:06 UTC 2016



Hi Aleksander,

I can confirm it works fine with your patch applied,

Thanks,
Davidm


Aleksander Morgado wrote the following:
> On Tue, Oct 18, 2016 at 8:19 AM, David McCullough
> <david.mccullough at accelerated.com> wrote:
> > I have had a problem here on the MC7304 using Vodfone SIMs (AU).
> >
> > ModemManager is flagging the device as locked (PIN lock) even though there
> > is no lock on the SIM.
> >
> > I ran it with DEBUG (just the PIN / locked transition is attached).
> >
> > Fairly recent clone of ModemManager,  src/mm-iface-modem.c has not changed.
> >
> > The attached patch lets the modem connect fine but I figure it is probably
> > not correct.
> >
> > Basically the new state (lock) is set to MM_MODEM_LOCK_UNKNOWN and the old
> > state (old_lock) is also set to MM_MODEM_LOCK_UNKNOWN.  For this condition
> > the code transitions to the "locked" state.
> >
> > Let me know if you need and more info or debug,
> 
> So, PIN1 is disabled and therefore we check PIN2 and it is "not
> initialized", which we translate to UNKNOWN. In this case, we should
> have provided the state of PIN1 and ignore the state of PIN2.
> 
> Can you test the attached patch?
> 
> -- 
> Aleksander
> https://aleksander.es

> From 86f2ac1e660af39bc51d5521666ad5a2b7df2345 Mon Sep 17 00:00:00 2001
> From: Aleksander Morgado <aleksander at aleksander.es>
> Date: Tue, 18 Oct 2016 10:28:50 +0200
> Subject: [PATCH] broadband-modem-qmi: don't use PIN2 lock state if unknown
> 
> ---
>  src/mm-broadband-modem-qmi.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
> index bc13925..b4f7b56 100644
> --- a/src/mm-broadband-modem-qmi.c
> +++ b/src/mm-broadband-modem-qmi.c
> @@ -1792,8 +1792,14 @@ dms_uim_get_pin_status_ready (QmiClientDms *client,
>              &current_status,
>              NULL, /* verify_retries_left */
>              NULL, /* unblock_retries_left */
> -            NULL))
> -        lock = mm_modem_lock_from_qmi_uim_pin_status (current_status, FALSE);
> +            NULL)) {
> +        MMModemLock lock2;
> +
> +        /* We only use the PIN2 status if it isn't unknown */
> +        lock2 = mm_modem_lock_from_qmi_uim_pin_status (current_status, FALSE);
> +        if (lock2 != MM_MODEM_LOCK_UNKNOWN)
> +            lock = lock2;
> +    }
>  
>      /* We're done! */
>      g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (lock), NULL);
> -- 
> 2.10.0
> 


-- 
David McCullough,  david.mccullough at accelerated.com,   Ph: 0410 560 763


More information about the ModemManager-devel mailing list