[PATCH 1/2] Provide mechansim to disable PIN2 on QMI modems

David McCullough david.mccullough at accelecon.com
Mon Sep 15 17:02:36 PDT 2014


David McCullough wrote the following:
> 
> Aleksander Morgado wrote the following:
> > On Mon, Sep 15, 2014 at 1:10 PM, David McCullough
> > <david.mccullough at accelecon.com> wrote:
> > >
> > > Some modems report PIN2 support via QMI even though they do not actually
> > > support PIN2.  Here is a snippet of debug on the Sierra Wireless MC7354
> > > sghowing this.  mmcli would incorrectly report PIN unlocking errors.
> > >
> > 
> > The thing here is that some modems may report PIN2-locked, which is
> > true, BUT which doesn't prevent going on with enabling the modem and
> > getting a connection. ModemManager handles this case already, by
> > ensuring that even if the modem says it is PIN2-locked, the modem
> > state doesn't got to LOCKED.
> > 
> > In your case you have PIN1 disabled, PIN2 locked, so the modem will
> > (should) directly go to the DISABLED state when it's detected.
> > 
> > If instead you have PIN1 enabled you'll get PIN1-locked first (so
> > modem will go to LOCKED until PIN1 is unlocked), and once that happens
> > it will go to PIN2 locked (so DISABLED).
> > 
> > All modems in DISABLED state can all directly be ENABLED with Enable().
> > 
> > Note that UnlockRequired property will still say PIN2; even if it went
> > into DISABLED state.
> > 
> > 
> > >     <debug> [1410404595.230075] [mm-broadband-modem-qmi.c:1535] modem_load_unlock_required(): loading unlock required...
> > >     [/dev/cdc-wdm0] Sent message...
> > >     <<<<<< RAW:
> > >     <<<<<<   length = 13
> > >     <<<<<<   data   = 01:0C:00:00:02:02:00:09:00:2B:00:00:00
> > >     [/dev/cdc-wdm0] Sent message (translated)...
> > >     <<<<<< QMUX:
> > >     <<<<<<   length  = 12
> > >     <<<<<<   flags   = 0x00
> > >     <<<<<<   service = "dms"
> > >     <<<<<<   client  = 2
> > >     <<<<<< QMI:
> > >     <<<<<<   flags       = "none"
> > >     <<<<<<   transaction = 9
> > >     <<<<<<   tlv_length  = 0
> > >     <<<<<<   message     = "UIM Get PIN Status" (0x002B)
> > >     [/dev/cdc-wdm0] Received message...
> > >     >>>>>> RAW:
> > >     >>>>>>   length = 32
> > >     >>>>>>   data   = 01:1F:00:80:02:02:02:09:00:2B:00:13:00:02:04:00:00:00:00:00:12:03:00:01:03:0A:11:03:00:03:03:0A
> > >     [/dev/cdc-wdm0] Received message (translated)...
> > >     >>>>>> QMUX:
> > >     >>>>>>   length  = 31
> > >     >>>>>>   flags   = 0x80
> > >     >>>>>>   service = "dms"
> > >     >>>>>>   client  = 2
> > >     >>>>>> QMI:
> > >     >>>>>>   flags       = "response"
> > >     >>>>>>   transaction = 9
> > >     >>>>>>   tlv_length  = 19
> > >     >>>>>>   message     = "UIM Get PIN Status" (0x002B)
> > >     >>>>>> TLV:
> > >     >>>>>>   type       = "Result" (0x02)
> > >     >>>>>>   length     = 4
> > >     >>>>>>   value      = 00:00:00:00
> > >     >>>>>>   translated = SUCCESS
> > >     >>>>>> TLV:
> > >     >>>>>>   type       = "PIN2 Status" (0x12)
> > >     >>>>>>   length     = 3
> > >     >>>>>>   value      = 01:03:0A
> > >     >>>>>>   translated = [ current_status = 'enabled-not-verified' verify_retries_left = '3' unblock_retries_left = '10' ]
> > >     >>>>>> TLV:
> > >     >>>>>>   type       = "PIN1 Status" (0x11)
> > >     >>>>>>   length     = 3
> > >     >>>>>>   value      = 03:03:0A
> > >     >>>>>>   translated = [ current_status = 'disabled' verify_retries_left = '3' unblock_retries_left = '10' ]
> > >
> > 
> > Ok, so this is good. We get PIN1 disabled and PIN2 locked. The modem
> > should go into DISABLED state right just after being detected.
> > 
> > Isn't this the case?
> 
> It works,  the modem connects despite the pin2 state,  but it just doesn't
> feel right to me that the modem is reporting retry errors and state that
> just doesn't apply.
> 
> The first thing that came to mind when I looked at it was "something is
> wrong". So I thought it should be cleaned up.
> 
> If the modem supported dual SIM's and PINs I would be fine with seeing the
> PIN2 state like this,


For reference,  here is the status output from mmcli for some relevant modems:


Huawei MU609 (Supports PIN2 properly)

    -------------------------
    Status   |           lock: 'none'
             | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
             |          state: 'connected'
             |    power state: 'on'
             |    access tech: 'umts'
             | signal quality: '54' (recent)
    -------------------------

Sierra Wireless MC7354 (without patch to ignore pin2)

    -------------------------
    Status   |           lock: 'sim-pin2'
             | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
             |          state: 'connected'
             |    power state: 'on'
             |    access tech: 'umts'
             | signal quality: '47' (recent)
    -------------------------

Sierra Wireless MC7354 (with patch to ignore pin2)

    -------------------------
    Status   |           lock: 'none'
             | unlock retries: 'sim-pin (3), sim-puk (10)'
             |          state: 'connected'
             |    power state: 'on'
             |    access tech: 'umts'
             | signal quality: '47' (cached)
    -------------------------

I am more than happy with the MU609 displaying PIN2 status, the bit I don't
like is the 'lock' status is very misleading on the MC7354,  it is not
locked and PIN2 can never be unlocked.

I am sure I sure the lock state appeared as 'sim-puk2' at one point,  which
seemed to imply it was trying/retrying to unlock PIN2.  I can't reproduce it
now and might have been related to the newest qmi stuff I was doing,

Cheers,
Davidm



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


More information about the ModemManager-devel mailing list