Instead of delaying the cpin entry callback until the sim is found to be
'ready', call back into the core right away. The core will wait until
the initialized notification is called from the driver before proceeding
with the rest of the initialization procedure.
The sim state query is now being done in the background and potential
leaking of cbd is now fixed.
SMS_SEND uses an embedded databuffer inside MBIM_SET_SMS_SEND which
wants to use a local offset (local to the databuffer structure) as
opposed to the offset from the start of the static buffer.
For zero element arrays we might inadvertently run past the end of the
iov buffer. Fix this by adding additional checks that n_elem > 0 and
don't call _iter_get_data unless needed.
In SimManager, the Retries property isn't used for gemalto modems.
The at command AT^SPIC is used to get the remaining retries left
for the current required password type.
This commit adds the implementation in the SIM driver of the retries
queries.
When modem does not answer or answers slowly to a discovery request,
a timeout occurs.
In timeout callback, request should be removed from queues to avoid
treating answer if it arrives later.
The Quectel EC21 does not provide the SMS PDU on the message event
notification.
This patch adds a call to 'raw read' on the message ID from the event
notification if the event notification does not already contain the
message data.
The message data begins with the SMSC length, type, and address so
the TPDU length is adjusted accordingly in the raw_read callback. This
differs from the way the raw message data is handled in the case
that it is included in the event notification itself. As I don't have
access to any other QMI modem at this time, I'm can not confirm that
this difference is reasonable.
Implemented the core API's needed for sim-auth:
list_apps: already implemented
open_channel: Opens a logical channel with +CCHO
close_channel: Closes logical channel with +CCHC
logical_access: Access an opened channel with +CGLA
==2941== Invalid read of size 4
==2941== at 0x69338: sim_state_cb (sim.c:1301)
==2941== by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941== by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941== by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941== by 0xA6587: have_line (gatchat.c:600)
==2941== by 0xA6BB7: new_bytes (gatchat.c:759)
==2941== by 0xAAFAF: received_data (gatio.c:124)
==2941== by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941== by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941== by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941== by 0xBDDBB: main (main.c:261)
==2941== Address 0x519c344 is 4 bytes inside a block of size 12 free'd
==2941== at 0x4840B28: free (vg_replace_malloc.c:530)
==2941== by 0x71F33: at_util_sim_state_query_free (atutil.c:613)
==2941== by 0x6930B: sim_state_cb (sim.c:1297)
==2941== by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941== by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941== by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941== by 0xA6587: have_line (gatchat.c:600)
==2941== by 0xA6BB7: new_bytes (gatchat.c:759)
==2941== by 0xAAFAF: received_data (gatio.c:124)
==2941== by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941== by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941== by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941== by 0xBDDBB: main (main.c:261)