All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 5/9] stk: Handle ENVELOPEs in a queue, retry on sim busy.
Date: Thu, 01 Jul 2010 21:28:45 -0500	[thread overview]
Message-ID: <4C2D4EDD.1000701@gmail.com> (raw)
In-Reply-To: <AANLkTim0qPTPK392IBQUtYkHu2ZIe8iI3wCriKXqGSwf@mail.gmail.com>

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

Hi Andrew,

>>> +     GQueue *envelope_q;
>>> +};
>>> +
>>> +struct envelope_op {
>>> +     struct stk_envelope e;
>>> +     int retries;
>>> +     void (*cb)(struct ofono_stk *stk, gboolean ok,
>>> +                     const unsigned char *data, int length);
>>
>> Is the callback really needed?  What can we intelligently do besides
>> printing an error to the log?
> 
> In the generic case we should inform whoever asked us to submit the
> information to the UICC.  We don't currently have any such case (in
> case of Cell Broadcast there's no one to inform.   In case of the
> SimAppAgent our d-bus api doesn't let us do it.  In case of SMS-PP
> download it's a technical difficulty).  But, for example the Timer
> Expiration event is more complicated because it needs to be retried
> until it succeeds, and every time we retry sending the envelope it
> will be different because it contains current time.  So the Timer
> Expiration retrying has to be imlemented separately.
> 

So I suggest keeping it simple for now and not having the callback.  We
can always add it if really needed.

>>> +static void envelope_cb(const struct ofono_error *error, const uint8_t *data,
>>> +                     int length, void *user_data)
>>> +{
>>> +     struct ofono_stk *stk = user_data;
>>> +     struct envelope_op *op = g_queue_peek_head(stk->envelope_q);
>>> +     gboolean result = TRUE;
>>> +
>>> +     stk->envelope_q_busy = FALSE;
>>> +
>>> +     if (op->retries > 0 && error->type == OFONO_ERROR_TYPE_SIM &&
>>> +                     error->error == 0x9300) {
>>> +             op->retries--;
>>> +             goto out;
>>
>> You might really want to use an increasing retry timeout here.
> 
> For now I'm hoping that this retrying is purely theoretical, and it
> never happens in practice.  The problem with increasing timeouts is
> that there's a period where we're not doing anything.  And if we have
> an envelope like Menu Selection or Timer Expiration later in the
> queue, we don't want to delay it.
> 

Ok fair enough.

Regards,
-Denis

  reply	other threads:[~2010-07-02  2:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 10:14 [PATCH 1/9] stk: Utilities for proactive command/envelope handling Andrzej Zaborowski
2010-06-29 10:14 ` [PATCH 2/9] mbmmodem: Cancel running command on *STKEND Andrzej Zaborowski
2010-06-29 10:14 ` [PATCH 3/9] stk: Handle the More Time command as a nop Andrzej Zaborowski
2010-06-29 10:14 ` [PATCH 4/9] Make sim operations return sim error codes to core Andrzej Zaborowski
2010-07-01 19:16   ` Denis Kenzior
2010-06-29 10:14 ` [PATCH 5/9] stk: Handle ENVELOPEs in a queue, retry on sim busy Andrzej Zaborowski
2010-07-01 19:57   ` Denis Kenzior
2010-07-02  1:32     ` Andrzej Zaborowski
2010-07-02  2:28       ` Denis Kenzior [this message]
2010-07-02 19:15         ` Andrzej Zaborowski
2010-06-29 10:14 ` [PATCH 6/9] Add SimToolkit and SimApplicationAgent interfaces Andrzej Zaborowski
2010-07-02 17:21   ` Denis Kenzior
2010-07-02 19:55     ` Andrzej Zaborowski
2010-07-02 20:20       ` Denis Kenzior
2010-07-02 23:40         ` Andrzej Zaborowski
2010-07-03  0:23           ` Andrzej Zaborowski
2010-07-03 18:24           ` Denis Kenzior
2010-06-29 10:14 ` [PATCH 7/9] stk: Add menu related utilities Andrzej Zaborowski
2010-06-29 10:14 ` [PATCH 8/9] stk: Handle Select Item and Set Up Menu commands Andrzej Zaborowski
2010-06-29 10:14 ` [PATCH 9/9] stk: Handle the Display Text command Andrzej Zaborowski
2010-07-01 19:10 ` [PATCH 1/9] stk: Utilities for proactive command/envelope handling 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=4C2D4EDD.1000701@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.