Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] sim: Read EFsst
Date: Wed, 25 Aug 2010 12:17:07 -0500	[thread overview]
Message-ID: <4C755013.3040603@gmail.com> (raw)
In-Reply-To: <1282735748-23050-1-git-send-email-yang.gu@intel.com>

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

Hi Yang,

> -static void sim_efust_read_cb(int ok, int length, int record,
> +static void sim_efsst_read_cb(int ok, int length, int record,
>  				const unsigned char *data,
>  				int record_length, void *userdata)
>  {
> @@ -1057,6 +1059,27 @@ static void sim_efust_read_cb(int ok, int length, int record,
>  	if (!ok)
>  		goto out;
>  
> +	if (length < 2) {
> +		ofono_error("EFsst shall contain at least two bytes");
> +		goto out;
> +	}
> +
> +	sim->efsst = g_memdup(data, length);
> +	sim->efsst_length = length;
> +
> +out:
> +	sim_retrieve_imsi(sim);
> +}
> +
> +static void sim_efust_read_cb(int ok, int length, int record,
> +				const unsigned char *data,
> +				int record_length, void *userdata)
> +{
> +	struct ofono_sim *sim = userdata;
> +
> +	if (!ok)
> +		goto error;
> +
>  	if (length < 1) {
>  		ofono_error("EFust shall contain at least one byte");
>  		goto out;
> @@ -1073,6 +1096,12 @@ static void sim_efust_read_cb(int ok, int length, int record,
>  
>  out:
>  	sim_retrieve_imsi(sim);
> +	return;
> +
> +error:
> +	ofono_sim_read(sim, SIM_EFSST_FILEID,
> +			OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
> +			sim_efsst_read_cb, sim);
>  }

That is really not how it works.  If the file ID is the same then you
need some other information to determine whether this is a phase 3 or a
phase 2 SIM.  Look at how EFecc reading in voicecall.c is done.  In
other words, this function needs to make an intelligent decision whether
this is EFsst or EFust.

In your case the only heuristic we have is EFphase, which is mandatory
for all Phase 2 SIMs (and absent in all Phase 3 SIMs).

Regards,
-Denis

  reply	other threads:[~2010-08-25 17:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25 11:29 [PATCH] sim: Read EFsst Yang Gu
2010-08-25 17:17 ` Denis Kenzior [this message]
2010-08-26  9:12   ` Gu, Yang
2010-08-26 10:12   ` Gu, Yang
2010-08-26 16:51     ` andrzej zaborowski

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=4C755013.3040603@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox