From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH] huawei: follow sim state change notifications
Date: Tue, 25 May 2010 10:01:58 +0200 [thread overview]
Message-ID: <1274774518.27220.121.camel@localhost.localdomain> (raw)
In-Reply-To: <20100525075637.32623.43301.stgit@potku.valot.fi>
[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]
Hi Kalle,
> With Huawei E1552 I got sim busy errors when I plugged in the modem
> and ofono was already running:
>
> May 24 17:02:04 tukki ofonod[7619]: > AT+CRC=1\r
> May 24 17:02:04 tukki ofonod[7619]: < \r\n+CME ERROR: SIM busy\r\n
> May 24 17:02:04 tukki ofonod[7619]: > AT+CLIP=1\r
> May 24 17:02:04 tukki ofonod[7619]: < \r\n+CME ERROR: SIM busy\r\n
>
> Fix this by following sim state changes with ^SIMST notification and
> only enable modem after SIM is ready. In case SIM is already ready
> and we miss the notification for some reason, also use AT^SYSINFO
> to check the state during enable phase.
>
> Also change huawei_enable() to return -EINPROGRESS to make sure that
> ofono modem is not powered too early. I believe this was a bug.
> ---
>
> plugins/huawei.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++---
> 1 files changed, 93 insertions(+), 6 deletions(-)
>
> diff --git a/plugins/huawei.c b/plugins/huawei.c
> index e1408bd..7d59a26 100644
> --- a/plugins/huawei.c
> +++ b/plugins/huawei.c
> @@ -47,9 +47,18 @@
> #include <drivers/atmodem/atutil.h>
> #include <drivers/atmodem/vendor.h>
>
> +enum huawei_state {
> + HUAWEI_DISABLED,
> + HUAWEI_DISABLE,
> + HUAWEI_ENABLE,
> + HUAWEI_ENABLED,
> +};
> +
is this really needed? I don't see why you want it. Where is the race
condition that you are trying to fix with it.
> struct huawei_data {
> GAtChat *chat;
> GAtChat *event;
> + gint sim_state;
> + enum huawei_state state;
> };
I think the sim_state should be just enough.
Regards
Marcel
next prev parent reply other threads:[~2010-05-25 8:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 7:56 [PATCH] huawei: follow sim state change notifications Kalle Valo
2010-05-25 8:01 ` Marcel Holtmann [this message]
2010-05-25 8:34 ` 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=1274774518.27220.121.camel@localhost.localdomain \
--to=marcel@holtmann.org \
--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