All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] fix SIM file reading on MC7304 modem
@ 2017-02-17 15:06 Christophe Ronco
  2017-02-17 15:06 ` [PATCH 1/1] qmimodem: fix sim file reading on MC7304 Christophe Ronco
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Ronco @ 2017-02-17 15:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2184 bytes --]

I always had errors when reading SIM files on modem MC7304.
Failing function in qmimodem driver is qmi_read_attributes.
Using OFONO_QMI_DEBUG, response from modem is
UIM_resp msg=36 len=7 [client=1,type=2,tid=274,len=19]
QMI:        {type=2,error=INTERNAL}

Using qmicli (and AT command), I am able to read the same file:
qmicli -d /dev/cdc-wdm0 --uim-get-file-attributes=0x3f00,0x7fff,0x6fad
[(null)] Successfully got file '/dev/cdc-wdm0' attributes from the UIM:
Card result:
        SW1: '0x90'
        SW2: '0x00'
File attributes:
        File size: 4
        File ID: 28589
        File type: transparent
        Record size: 0
        Record count: 0
        Read security attributes: (always) (null)
        Write security attributes: (single) adm
        Increase security attributes: (always) (null)
        Deactivate security attributes: (single) adm
        Activate security attributes: (single) adm
        Raw:    62:17:82:02:41:21:83:02:6F:AD:8A:01:05:8B:03:6F:06:01:80:02:00:04:88:01:18

I ended up trying to do it using qmicli and comparing binary commands sent by
ofono qmimodem driver and qmicli.

Command sent by qmimodem driver in qmi_read_attributes function
01 1b 00 00 0b 01
00 12 01 24 00 0f 00 "Get File Attributes" (0x0024), length 15
01 02 00 06 00 : "Session Information" (0x01), session_type = 'Card on slot 1' application_identifier = ''
02 07 00 ad 6f 04 00 3f ff 7f: "File" (0x02)

Command sent by qmicli:
01:1B:00:00:0B:01:
00:01:00:24:00:0F:00: "Get File Attributes" (0x0024), length 15
02:07:00:AD:6F:04:00:3F:FF:7F: "File" (0x02)
01:02:00:00:00 "Session Information" (0x01) session_type = 'primary-gw-provisioning' application_identifier = ''

So difference seemed to be session_type value in "Session Information" parameter.
I have no idea what this parameter really means. I changed that to set 
session_type to 'primary-gw-provisioning' in qmimodem driver and ... it fixed
the bug.
I have also tested the fix on a MC7430.


Christophe Ronco (1):
  qmimodem: fix sim file reading on MC7304

 drivers/qmimodem/sim.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-17 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 15:06 [PATCH 0/1] fix SIM file reading on MC7304 modem Christophe Ronco
2017-02-17 15:06 ` [PATCH 1/1] qmimodem: fix sim file reading on MC7304 Christophe Ronco
2017-02-17 17:18   ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.