mbox series

[0/1]

Message ID 20240328081157.4586-1-c.ronco@kerlink.fr (mailing list archive)
Headers show
Series [1/1] atmodem: sim: when reading sim files, avoid incomplete result lines | expand

Message

Christophe Ronco March 28, 2024, 8:11 a.m. UTC
Hi,
I use a ME310G1 modem (from Telit). With some SIMs, Ofono is not able to give CardIdentifier property.

This information is normally read in SIM by reading file 12258. 
This is the first AT+CRSM command send to modem.

When not working, it's because in AT command answer, there are two lines
starting with prefix +CRSM. The first line is:
+CRSM: 0
I don't know what does this answer mean, I though that two parameters minimum
(sw1 and sw2) were requested. A correct result line is also sent, but it
won't be analyzed by AT modem driver. It stops at first line with correct prefix.

Here is an extract of traces I have when this behavior is reproduced:
2024-03-26T12:27:22.721536+00:00 klk-zcel-04000C ofonod[1268]: Aux: > AT+CGMI\r
2024-03-26T12:27:22.730407+00:00 klk-zcel-04000C ofonod[1268]: Aux: < \r\nTelit\r\n\r\nOK\r\n
2024-03-26T12:27:22.731175+00:00 klk-zcel-04000C ofonod[1268]: Aux: > AT+CLCK="SC",2\r
2024-03-26T12:27:22.831416+00:00 klk-zcel-04000C ofonod[1268]: Aux: < \r\nOK\r\n
2024-03-26T12:27:22.831805+00:00 klk-zcel-04000C ofonod[1268]: Aux: > AT+CGMM\r
2024-03-26T12:27:22.840647+00:00 klk-zcel-04000C ofonod[1268]: Aux: < \r\nME310G1-WW\r\n\r\nOK\r\n
2024-03-26T12:27:22.842950+00:00 klk-zcel-04000C ofonod[1268]: Aux: > AT+CRSM=192,12258\r
2024-03-26T12:27:23.101668+00:00 klk-zcel-04000C ofonod[1268]: Modem: < \r\n#QSS: 2\r\n
2024-03-26T12:27:23.165293+00:00 klk-zcel-04000C ofonod[1268]: Aux: < \r\n+CRSM: 0\r\n\r\n+CRSM: 144,0,62178202412183022FE28A01058B032F06068002000A880110\r\n\r\nOK\r\n\r\n#QSS: 2\r\n
2024-03-26T12:27:23.166088+00:00 klk-zcel-04000C ofonod[1268]: ../git/plugins/telit.c:qss_notify() 0x1856a00
2024-03-26T12:27:23.166664+00:00 klk-zcel-04000C ofonod[1268]: ../git/plugins/telit.c:switch_sim_state_status() 0x1856a00, SIM status: 2
2024-03-26T12:27:23.167472+00:00 klk-zcel-04000C ofonod[1268]: Aux: > AT+CGMR\r
2024-03-26T12:27:23.176251+00:00 klk-zcel-04000C ofonod[1268]: Aux: < \r\nM0C.200004\r\n\r\nOK\r\n
2024-03-26T12:27:23.178463+00:00 klk-zcel-04000C ofonod[1268]: Aux: > AT+CRSM=192,28421\r
2024-03-26T12:27:23.929127+00:00 klk-zcel-04000C ofonod[1268]: Aux: < \r\n+CRSM: 144,0,62178202412183026F058A01058B036F060E80020008880110\r\n\r\nOK\r\n

The aim of this patch is to ignore result lines that do not contain at least sw1 and sw2 parameters.

Christophe Ronco (1):
  atmodem: sim: when reading sim files, avoid incomplete result lines

 drivers/atmodem/sim.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)