Open Source Telephony
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@canonical.com>
To: ofono@ofono.org
Subject: Re: [RFC PATCH v1 2/2] huawei: fix online logic
Date: Fri, 17 Sep 2010 17:16:53 +0300	[thread overview]
Message-ID: <87ocbwcv56.fsf@potku.valot.fi> (raw)
In-Reply-To: <87sk18cvzr.fsf@potku.valot.fi>

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

Kalle Valo <kalle.valo@canonical.com> writes:

> I'm guessing ofono_sim_inserted_notify() has something to do this. When
> I did some quick tests, IIRC I was able to see HUAWEI_SIM_STATE_VALID
> only after I had called ofono_sim_inserted_notify(). 
>
> I think the way you are after is that we would first receive
> HUAWEI_SIM_STATE_VALID (or the three other valid states) and only then
> call ofono_sim_inserted_notify(). At least to me that would make sense.
> I just don't know how to do that because I see only later in the
> initialisation phase.

Just to show my problem. I did this on top of my two huawei v1 patches:

diff --git a/plugins/huawei.c b/plugins/huawei.c
index 0b4e65e..ac26a02 100644
--- a/plugins/huawei.c
+++ b/plugins/huawei.c
@@ -185,9 +185,9 @@ static gboolean notify_sim_state(struct ofono_modem *modem,
        case HUAWEI_SIM_STATE_INVALID_OR_LOCKED:
                ofono_modem_set_powered(modem, TRUE);
 
-               if (data->sim)
-                       ofono_sim_inserted_notify(data->sim, TRUE);
-               break;
+               /* if (data->sim) */
+               /*      ofono_sim_inserted_notify(data->sim, TRUE); */
+               return TRUE;
        case HUAWEI_SIM_STATE_VALID:
        case HUAWEI_SIM_STATE_INVALID_CS:
        case HUAWEI_SIM_STATE_INVALID_PS:
@@ -199,8 +199,8 @@ static gboolean notify_sim_state(struct ofono_modem *modem,
                 */
                ofono_modem_set_powered(modem, TRUE);
 
-               if (data->sim)
-                       ofono_sim_inserted_notify(data->sim, TRUE);
+               /* if (data->sim) */
+               /*      ofono_sim_inserted_notify(data->sim, TRUE); */
 
                if (data->online_cbd) {
                        cb = data->online_cbd->cb;

So we are not calling sim_inserted() at all and poll for sim states for
a while. And the output in cold start case is this:

Sep 17 17:14:29 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 255
Sep 17 17:14:32 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0
Sep 17 17:14:32 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0
Sep 17 17:14:34 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0
Sep 17 17:14:34 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0
Sep 17 17:14:36 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0
Sep 17 17:14:36 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0
Sep 17 17:14:38 dell-m520 ofonod[2436]: plugins/huawei.c:notify_sim_state() 0

My modem always stays in HUAWEI_SIM_STATE_INVALID_OR_LOCKED (0) case
forever.

-- 
Kalle Valo

  reply	other threads:[~2010-09-17 14:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17 10:23 [RFC PATCH v1 0/2] huawei: fix cold start Kalle Valo
2010-09-17 10:23 ` [RFC PATCH v1 1/2] huawei: poll sim state Kalle Valo
2010-09-17 12:48   ` Marcel Holtmann
2010-09-20 12:29     ` Kalle Valo
2010-09-17 10:23 ` [RFC PATCH v1 2/2] huawei: fix online logic Kalle Valo
2010-09-17 12:53   ` Marcel Holtmann
2010-09-17 13:58     ` Kalle Valo
2010-09-17 14:16       ` Kalle Valo [this message]
2010-09-17 13:07 ` [RFC PATCH v1 0/2] huawei: fix cold start Kalle Valo

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=87ocbwcv56.fsf@potku.valot.fi \
    --to=kalle.valo@canonical.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