Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/2] huawei: postpone post_sim until SIM is ready
Date: Wed, 11 Aug 2010 18:23:48 -0500	[thread overview]
Message-ID: <4C633104.7000502@gmail.com> (raw)
In-Reply-To: <20100810095741.18457.64025.stgit@potku.valot.fi>

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

Hi Kalle,

On 08/10/2010 04:57 AM, Kalle Valo wrote:
> On my Huawei E1552 with PIN locked SIM sim_state is 0 when calling
> huawei_post_sim() and gprs context is not registered. This is because
> ^SIMST notification is received only after huawei_post_sim() is called:
> 
> Aug 10 12:38:33 tukki ofonod[6565]: plugins/huawei.c:huawei_post_sim() 0x6cdb50
> [...]
> Aug 10 12:38:34 tukki ofonod[6565]: Pcui:< \r\n^SIMST:1\r\n\r\n^SRVST:2\r\n
> Aug 10 12:38:34 tukki ofonod[6565]: plugins/huawei.c:notify_sim_state() 1
> 
> Add a test to wait for sim_state to be ready and also a call to
> notify_sim_state() to call huawei_post_sim() whenever needed.

So this problem affects multiple modem families and I think we should
solve it a bit better.  What I'm proposing is to introduce a new
function to include/sim.h.  Something like:

void ofono_sim_ready_notify(struct ofono_sim *sim);

The way it should work is as follows:

When oFono determines the SIM PIN is READY, it checks whether
ofono_sim_ready_notify has been called.  If it hasn't, then it stalls
the initialization procedure (and calling post_sim) until
ofono_sim_ready_notify is called.

This way if the SIM is not PIN locked, the driver can call sim_inserted
and sim_ready at once.  If the PIN is locked, the driver can notify
sim_ready later.

Regards,
-Denis

  reply	other threads:[~2010-08-11 23:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10  9:57 [PATCH 0/2] huawei: PIN unlock working with E1552 Kalle Valo
2010-08-10  9:57 ` [PATCH 1/2] huawei: poll sim state Kalle Valo
2010-08-11 23:08   ` Denis Kenzior
2010-08-13  8:11     ` Kalle Valo
2010-08-10  9:57 ` [PATCH 2/2] huawei: postpone post_sim until SIM is ready Kalle Valo
2010-08-11 23:23   ` Denis Kenzior [this message]
2010-08-13  8:15     ` Kalle Valo
2010-08-13 15:38       ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C633104.7000502@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox