All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v4 2/8] stk: Introduce BIP command handlers
Date: Wed, 08 Jun 2011 03:01:00 -0500	[thread overview]
Message-ID: <4DEF2C3C.7090405@gmail.com> (raw)
In-Reply-To: <4DF2241F.7050108@linux.intel.com>

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

Hi Philippe,

>>>       __ofono_sms_sim_download_cb_t sms_pp_cb;
>>>       void *sms_pp_userdata;
>>> +    struct stk_channel channel;
>>> +    struct stk_channel_data rx_buffer;
>>> +    struct stk_channel_data tx_buffer;
>>
>> Are you sure you need these buffers?  At least the RX buffer can
>> probably be ignored since you can always use the kernel socket buffer
>> instead.  Copying from the kernel buffer into your own buffer just to
>> copy it into SIM's buffer seems like busywork.
>>
> 
> The idea of the Rx buffer is to introduce an intermediate buffer since
> it's up to the UICC to collect the received data with the proactive
> command 'Receive data'. But before that, we need to read the kernel
> buffer to determine the amount of data available and inform the UICC
> about this size.
> 

If this is the only reason you're introducing an rx buffer, then please
don't.  There are ioctls on tcp / udp sockets that give you this
information.  Please see FIONREAD ioctl.

> 
>> The TX buffer is arguable, you might want to use non-blocking IO, but in
>> that case I would use a ring_buffer from GAtChat.
> 
> For STK, what is the added value of a ring buffer? The mechanism for STK
> is to store data in the TX buffer and once the PDU is complete, flush it
> by sending the data. So we can't store before the Tx buffer is empty.
> 
>

Because you would have to use non-blocking IO, and your number of bytes
written to the kernel socket is not guaranteed to be the same as the
contents of the tx buffer.  So you either must memmove or use a ring
buffer which is more efficient.


>>
>> You can't actually do this since the agent does not support calling
>> stk_agent_request_cancel from within a callback.
> 
> OK, thank you for pointing this issue. But then I realize that I don't
> need to expressly release the stk session agent (through
> stk_agent_request_cancel). We just need to wait for the "End session"
> notification which is likely to be received as a result of the Terminal
> response "session terminated by user".

We've already had this discussion ;)  Please don't rely on such behavior.

Regards,
-Denis

  reply	other threads:[~2011-06-08  8:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 16:26 [PATCH v4 1/8] stk: Clear 'respond_on_exit' flag after sending the terminal response Philippe Nunes
2011-05-20 16:26 ` [PATCH v4 2/8] stk: Introduce BIP command handlers Philippe Nunes
2011-06-02  0:28   ` Denis Kenzior
2011-06-10 14:03     ` Philippe Nunes
2011-06-08  8:01       ` Denis Kenzior [this message]
2011-05-20 16:26 ` [PATCH v4 3/8] gprs: Add 'stk' gprs context type Philippe Nunes
2011-06-01  5:30   ` Denis Kenzior
2011-05-20 16:26 ` [PATCH v4 4/8] gprs: Add private APIs for adding/activating/removing hidden PDP contexts Philippe Nunes
2011-06-01  6:18   ` Denis Kenzior
2011-06-10  9:44     ` Philippe Nunes
2011-06-08  7:46       ` Denis Kenzior
2011-05-20 16:26 ` [PATCH v4 5/8] stk: Use Gprs private APIs to handle the Open channel/Close Channel Philippe Nunes
2011-05-20 16:26 ` [PATCH v4 6/8] gprs: Add a host route for STK context type Philippe Nunes
2011-06-01  6:26   ` Denis Kenzior
2011-05-20 16:26 ` [PATCH v4 7/8] stk: Add support of the Setup event list proactive command Philippe Nunes
2011-05-20 16:26 ` [PATCH v4 8/8] stk: Add read/write handlers Philippe Nunes
2011-06-01  5:26 ` [PATCH v4 1/8] stk: Clear 'respond_on_exit' flag after sending the terminal response 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=4DEF2C3C.7090405@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.