All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/5][RfC] Add functions to notify core of SIM insertion/removal/proactive command.
Date: Thu, 01 Apr 2010 10:47:56 -0500	[thread overview]
Message-ID: <201004011047.56997.denkenz@gmail.com> (raw)
In-Reply-To: <1270011462-6831-1-git-send-email-andrew.zaborowski@intel.com>

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

Hi Andrew,

> Make every plugin generate a sim inserted event on start.  For devices
> with removable SIM card, the event should be emitted after the
> plugin detects it.
> ---
> +unsigned int ofono_sim_add_removed_watch(struct ofono_sim *sim,
> +				ofono_sim_ready_notify_cb_t cb,
> +				void *data, ofono_destroy_func destroy);
> +
> +void ofono_sim_remove_removed_watch(struct ofono_sim *sim, unsigned int

So let us refactor the existing SIM ready events and the SIM removed events 
into a single set of watch functions with a state enum.

e.g. something like
enum ofono_sim_state {
	OFONO_SIM_STATE_NOT_PRESENT,
	OFONO_SIM_STATE_INSERTED,
	OFONO_SIM_STATE_READY,
};

>  id); +
>  int ofono_sim_get_ready(struct ofono_sim *sim);
> -void ofono_sim_set_ready(struct ofono_sim *sim);
> +
> +void ofono_sim_inserted(struct ofono_sim *sim);
> +void ofono_sim_removed(struct ofono_sim *sim);

Lets make these into a single function with a ofono_bool_t parameter.

> +void ofono_sim_proactive_command_notify(struct ofono_sim *sim,
> +		int length, const guint8 *pdu);

Can you send this part in a separate patch?  And this belongs on a separate 
stk atom.

> +void ofono_sim_inserted(struct ofono_sim *sim)
> +{
> +	sim->inserted = TRUE;
> +
> +	/* Perform SIM initialization according to 3GPP 31.102 Section 5.1.1.2
> +	 * The assumption here is that if sim manager is being initialized,
> +	 * then sim commands are implemented, and the sim manager is then
> +	 * responsible for checking the PIN, reading the IMSI and signaling
> +	 * SIM ready condition.
> +	 *
> +	 * The procedure according to 31.102 is roughly:
> +	 * Read EFecc
> +	 * Read EFli and EFpl
> +	 * SIM Pin check
> +	 * Request SIM phase (only in 51.011)
> +	 * Read EFust
> +	 * Read EFest
> +	 * Read IMSI
> +	 *
> +	 * At this point we signal the SIM ready condition and allow
> +	 * arbitrary files to be written or read, assuming their presence
> +	 * in the EFust
> +	 */
> +	sim_determine_phase(sim);
> +}

The only other issue here is that you have to wait for the sim atom to 
register before you start the initialization process.  

> +void ofono_sim_proactive_command_notify(struct ofono_sim *sim,
> +		int length, const guint8 *pdu)
> +{
> +}
> +

This belongs on a separate stk atom.

Regards,
-Denis

      reply	other threads:[~2010-04-01 15:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31  4:57 [PATCH 1/5][RfC] Add functions to notify core of SIM insertion/removal/proactive command Andrzej Zaborowski
2010-04-01 15:47 ` Denis Kenzior [this message]

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=201004011047.56997.denkenz@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.