All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] simfs: read files from specific AID's
@ 2017-11-06 17:49 James Prestwood
  2017-11-06 17:49 ` [PATCH 2/5] sim: header definitions for ISIM context API James Prestwood
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: James Prestwood @ 2017-11-06 17:49 UTC (permalink / raw)
  To: ofono

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

The simfs atom could not read EF's that did not exist on the
'default' ADF directory. This implements a new way to read EF's
that exist on a given AID. A new fs object/context can be
initialized for a given AID. Using this fs context with
the existing read file API will read from that AID rather than
the default ADF.
---
 src/simfs.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 src/simfs.h |   3 ++
 2 files changed, 118 insertions(+), 9 deletions(-)

diff --git a/src/simfs.c b/src/simfs.c
index 37a232a..daf3135 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -70,13 +70,26 @@ struct sim_fs_op {
 	unsigned char path_len;
 	gconstpointer cb;
 	gboolean is_read;
+	int session_id;
+	unsigned int watch_id;
 	void *userdata;
 	struct ofono_sim_context *context;
 };
 
+struct ofono_sim_context {
+	struct sim_fs *fs;
+	struct ofono_watchlist *file_watches;
+	struct ofono_sim_aid_session *session;
+};
+
 static void sim_fs_op_free(gpointer pointer)
 {
 	struct sim_fs_op *node = pointer;
+
+	if (node->context->session)
+		__ofono_sim_remove_session_watch(node->context->session,
+				node->watch_id);
+
 	g_free(node->buffer);
 	g_free(node);
 }
@@ -121,11 +134,6 @@ struct file_watch {
 	int ef;
 };
 
-struct ofono_sim_context {
-	struct sim_fs *fs;
-	struct ofono_watchlist *file_watches;
-};
-
 struct sim_fs *sim_fs_new(struct ofono_sim *sim,
 				const struct ofono_sim_driver *driver)
 {
@@ -156,6 +164,21 @@ struct ofono_sim_context *sim_fs_context_new(struct sim_fs *fs)
 	return context;
 }
 
+struct ofono_sim_context *sim_fs_context_new_with_aid(struct sim_fs *fs,
+		unsigned char *aid)
+{
+	struct ofono_sim_context *context = sim_fs_context_new(fs);
+
+	if (context == NULL)
+		return NULL;
+
+	context->session = __ofono_sim_get_session_by_aid(fs->sim, aid);
+	if (!context->session)
+		return NULL;
+
+	return context;
+}
+
 void sim_fs_context_free(struct ofono_sim_context *context)
 {
 	struct sim_fs *fs = context->fs;
@@ -805,6 +828,83 @@ error:
 	return FALSE;
 }
 
+static void sim_fs_read_session_cb(const struct ofono_error *error,
+		const unsigned char *sdata, int length, void *data)
+{
+	struct sim_fs *fs = data;
+	struct sim_fs_op *op = g_queue_peek_head(fs->op_q);
+	ofono_sim_file_read_cb_t cb;
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+		sim_fs_op_error(fs);
+		return;
+	}
+
+	cb = op->cb;
+	cb(TRUE, length, 0, sdata, length, op->userdata);
+
+	sim_fs_end_current(fs);
+}
+
+static void session_read_info_cb(const struct ofono_error *error,
+					int filelength,
+					enum ofono_sim_file_structure structure,
+					int recordlength,
+					const unsigned char access[3],
+					unsigned char file_status,
+					void *data)
+{
+	struct sim_fs *fs = data;
+	struct sim_fs_op *op = g_queue_peek_head(fs->op_q);
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+		sim_fs_op_error(fs);
+		return;
+	}
+
+	sim_fs_op_cache_fileinfo(fs, error, filelength, structure, recordlength,
+			access, file_status);
+
+	if (op->info_only) {
+		sim_fs_read_info_cb_t cb = op->cb;
+
+		cb(1, file_status, filelength, recordlength, op->userdata);
+
+		sim_fs_end_current(fs);
+		return;
+	}
+
+	if (op->structure == OFONO_SIM_FILE_STRUCTURE_TRANSPARENT)
+		fs->driver->session_read_binary(fs->sim, op->session_id,
+				op->id, op->offset, filelength, op->path,
+				op->path_len, sim_fs_read_session_cb, fs);
+	else
+		fs->driver->session_read_record(fs->sim, op->session_id,
+				op->id, op->offset, recordlength, op->path,
+				op->path_len, sim_fs_read_session_cb, fs);
+}
+
+static void get_session_cb(ofono_bool_t active, int session_id,
+		void *data)
+{
+	struct sim_fs *fs = data;
+	struct sim_fs_op *op;
+
+	if (!active) {
+		sim_fs_op_error(fs);
+		return;
+	}
+
+	fs->op_source = 0;
+
+	op = g_queue_peek_head(fs->op_q);
+
+	op->session_id = session_id;
+
+	fs->driver->session_read_info(fs->sim, session_id, op->id, op->path,
+			op->path_len, session_read_info_cb, fs);
+}
+
 static gboolean sim_fs_op_next(gpointer user_data)
 {
 	struct sim_fs *fs = user_data;
@@ -827,10 +927,16 @@ static gboolean sim_fs_op_next(gpointer user_data)
 		if (sim_fs_op_check_cached(fs))
 			return FALSE;
 
-		driver->read_file_info(fs->sim, op->id,
-					op->path_len ? op->path : NULL,
-					op->path_len,
-					sim_fs_op_info_cb, fs);
+		if (!op->context->session) {
+			driver->read_file_info(fs->sim, op->id,
+						op->path_len ? op->path : NULL,
+						op->path_len,
+						sim_fs_op_info_cb, fs);
+		} else {
+			op->watch_id = __ofono_sim_add_session_watch(
+					op->context->session, get_session_cb,
+					fs, NULL);
+		}
 	} else {
 		switch (op->structure) {
 		case OFONO_SIM_FILE_STRUCTURE_TRANSPARENT:
diff --git a/src/simfs.h b/src/simfs.h
index bb3ab0f..39af6a3 100644
--- a/src/simfs.h
+++ b/src/simfs.h
@@ -29,6 +29,9 @@ struct sim_fs *sim_fs_new(struct ofono_sim *sim,
 				const struct ofono_sim_driver *driver);
 struct ofono_sim_context *sim_fs_context_new(struct sim_fs *fs);
 
+struct ofono_sim_context *sim_fs_context_new_with_aid(struct sim_fs *fs,
+		unsigned char *aid);
+
 unsigned int sim_fs_file_watch_add(struct ofono_sim_context *context,
 					int id, ofono_sim_file_changed_cb_t cb,
 					void *userdata,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] sim: header definitions for ISIM context API
  2017-11-06 17:49 [PATCH 1/5] simfs: read files from specific AID's James Prestwood
@ 2017-11-06 17:49 ` James Prestwood
  2017-11-06 17:49 ` [PATCH 3/5] sim: implement create ISIM context James Prestwood
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2017-11-06 17:49 UTC (permalink / raw)
  To: ofono

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

This will allow an atom to create a SIM context to an ISIM
AID (if available). It is then possible to access EF's on the
ISIM using this SIM context.
---
 include/sim.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/sim.h b/include/sim.h
index e10941f..23a9bc2 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -244,6 +244,10 @@ ofono_bool_t ofono_sim_remove_spn_watch(struct ofono_sim *sim, unsigned int *id)
 void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted);
 
 struct ofono_sim_context *ofono_sim_context_create(struct ofono_sim *sim);
+
+struct ofono_sim_context *ofono_sim_context_create_isim(
+		struct ofono_sim *sim);
+
 void ofono_sim_context_free(struct ofono_sim_context *context);
 
 /* This will queue an operation to read all available records with id from the
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] sim: implement create ISIM context
  2017-11-06 17:49 [PATCH 1/5] simfs: read files from specific AID's James Prestwood
  2017-11-06 17:49 ` [PATCH 2/5] sim: header definitions for ISIM context API James Prestwood
@ 2017-11-06 17:49 ` James Prestwood
  2017-11-06 22:22   ` Denis Kenzior
  2017-11-06 17:49 ` [PATCH 4/5] sim: added ImsPrivateIdentity to SimManager James Prestwood
  2017-11-06 17:49 ` [PATCH 5/5] docs: ImsPrivateIdentity property documentation James Prestwood
  3 siblings, 1 reply; 7+ messages in thread
From: James Prestwood @ 2017-11-06 17:49 UTC (permalink / raw)
  To: ofono

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

API to create a sim context for the ISIM application, if found.
During AID discovery, if an ISIM AID is found, a new fs object is
initialized for the ISIM which will be used for any future
ISIM context creation.
---
 src/sim.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/src/sim.c b/src/sim.c
index 101914e..23a6395 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -123,6 +123,7 @@ struct ofono_sim {
 	unsigned int cphs_spn_short_watch;
 
 	struct sim_fs *simfs;
+	struct sim_fs *simfs_isim;
 	struct ofono_sim_context *context;
 	struct ofono_sim_context *early_context;
 
@@ -1483,6 +1484,14 @@ static void discover_apps_cb(const struct ofono_error *error,
 		s->state = SESSION_STATE_INACTIVE;
 		sim->aid_sessions = g_slist_prepend(sim->aid_sessions, s);
 
+		if (app->type == SIM_APP_TYPE_ISIM) {
+			/*
+			 * If an ISIM application is found, we should init
+			 * the FS structure so the ISIM EF's can be accessed.
+			 */
+			sim->simfs_isim = sim_fs_new(sim, sim->driver);
+		}
+
 		iter = g_slist_next(iter);
 	}
 }
@@ -2237,6 +2246,36 @@ struct ofono_sim_context *ofono_sim_context_create(struct ofono_sim *sim)
 	return sim_fs_context_new(sim->simfs);
 }
 
+struct ofono_sim_context *ofono_sim_context_create_isim(
+		struct ofono_sim *sim)
+{
+	GSList *iter = sim->aid_sessions;
+
+	if (sim == NULL || sim->simfs_isim == NULL)
+		return NULL;
+
+	/*
+	 * Check if the AID is even valid
+	 */
+	while (iter) {
+		struct ofono_sim_aid_session *session = iter->data;
+
+		/*
+		 * This AID based context is only relevant for an ISIM AID. A
+		 * USIM application can be accessed with the 'default' FS
+		 * context API's.
+		 */
+		if (session->record->type == SIM_APP_TYPE_ISIM) {
+			return sim_fs_context_new_with_aid(sim->simfs_isim,
+					session->record->aid);
+		}
+
+		iter = g_slist_next(iter);
+	}
+
+	return NULL;
+}
+
 void ofono_sim_context_free(struct ofono_sim_context *context)
 {
 	return sim_fs_context_free(context);
@@ -3067,6 +3106,8 @@ static void sim_remove(struct ofono_atom *atom)
 
 	sim_fs_free(sim->simfs);
 	sim->simfs = NULL;
+	sim_fs_free(sim->simfs_isim);
+	sim->simfs_isim = NULL;
 
 	g_free(sim);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] sim: added ImsPrivateIdentity to SimManager
  2017-11-06 17:49 [PATCH 1/5] simfs: read files from specific AID's James Prestwood
  2017-11-06 17:49 ` [PATCH 2/5] sim: header definitions for ISIM context API James Prestwood
  2017-11-06 17:49 ` [PATCH 3/5] sim: implement create ISIM context James Prestwood
@ 2017-11-06 17:49 ` James Prestwood
  2017-11-06 22:23   ` Denis Kenzior
  2017-11-06 17:49 ` [PATCH 5/5] docs: ImsPrivateIdentity property documentation James Prestwood
  3 siblings, 1 reply; 7+ messages in thread
From: James Prestwood @ 2017-11-06 17:49 UTC (permalink / raw)
  To: ofono

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

If the ISIM AID is found a new AID based context will be
created and the EFIMPI file will be read from the SIM
which contains the ImsPrivateIdentity.
---
 src/ofono.h |  2 ++
 src/sim.c   | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/src/ofono.h b/src/ofono.h
index 007cd13..7e96c96 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -419,6 +419,8 @@ enum sim_app_type __ofono_sim_session_get_type(
 unsigned char *__ofono_sim_session_get_aid(
 		struct ofono_sim_aid_session *session);
 
+const char *__ofono_sim_get_ims_private_id(struct ofono_sim *sim);
+
 #include <ofono/stk.h>
 
 typedef void (*__ofono_sms_sim_download_cb_t)(ofono_bool_t ok,
diff --git a/src/sim.c b/src/sim.c
index 23a6395..5da11d1 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -126,6 +126,7 @@ struct ofono_sim {
 	struct sim_fs *simfs_isim;
 	struct ofono_sim_context *context;
 	struct ofono_sim_context *early_context;
+	struct ofono_sim_context *isim_context;
 
 	unsigned char *iidf_image;
 	unsigned int *iidf_watch_ids;
@@ -138,6 +139,7 @@ struct ofono_sim {
 
 	GSList *aid_sessions;
 	GSList *aid_list;
+	char *ims_identity;
 };
 
 struct msisdn_set_request {
@@ -409,6 +411,10 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 		ofono_dbus_dict_append(&dict, "ServiceProviderName",
 					DBUS_TYPE_STRING, &sim->spn);
 
+	if (sim->ims_identity)
+		ofono_dbus_dict_append(&dict, "ImsPrivateIdentity",
+					DBUS_TYPE_STRING, &sim->ims_identity);
+
 	fdn = sim->fixed_dialing;
 	ofono_dbus_dict_append(&dict, "FixedDialing", DBUS_TYPE_BOOLEAN, &fdn);
 
@@ -1458,6 +1464,25 @@ static void sim_set_ready(struct ofono_sim *sim)
 	call_state_watches(sim);
 }
 
+static void impi_read_cb(int ok, int total_length, int record,
+		const unsigned char *data,
+		int record_length, void *userdata)
+{
+	struct ofono_sim *sim = userdata;
+
+	if (!ok) {
+		DBG("error reading IMPI");
+		return;
+	}
+
+	if (data[0] != 0x80) {
+		DBG("invalid TLV tag 0x%02x", data[0]);
+		return;
+	}
+
+	sim->ims_identity = g_strndup((const char *)data + 2, data[1]);
+}
+
 static void discover_apps_cb(const struct ofono_error *error,
 		const unsigned char *dataobj,
 		int len, void *data)
@@ -1490,6 +1515,12 @@ static void discover_apps_cb(const struct ofono_error *error,
 			 * the FS structure so the ISIM EF's can be accessed.
 			 */
 			sim->simfs_isim = sim_fs_new(sim, sim->driver);
+			sim->isim_context = ofono_sim_context_create_isim(
+					sim);
+			/* attempt to get the NAI from EFimpi */
+			ofono_sim_read_bytes(sim->isim_context,
+					SIM_ISIM_EFIMPI_FILEID, 0, 255, NULL,
+					0, impi_read_cb, sim);
 		}
 
 		iter = g_slist_next(iter);
@@ -2558,6 +2589,14 @@ static void sim_free_main_state(struct ofono_sim *sim)
 		sim->context = NULL;
 	}
 
+	if (sim->isim_context) {
+		ofono_sim_context_free(sim->isim_context);
+		sim->isim_context = NULL;
+	}
+
+	if (sim->ims_identity)
+		g_free(sim->ims_identity);
+
 	if (sim->aid_sessions)
 		g_slist_free_full(sim->aid_sessions, aid_session_free);
 }
@@ -3417,6 +3456,11 @@ void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
 	}
 }
 
+const char *__ofono_sim_get_ims_private_id(struct ofono_sim *sim)
+{
+	return sim->ims_identity;
+}
+
 static void open_channel_cb(const struct ofono_error *error, int session_id,
 		void *data);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] docs: ImsPrivateIdentity property documentation
  2017-11-06 17:49 [PATCH 1/5] simfs: read files from specific AID's James Prestwood
                   ` (2 preceding siblings ...)
  2017-11-06 17:49 ` [PATCH 4/5] sim: added ImsPrivateIdentity to SimManager James Prestwood
@ 2017-11-06 17:49 ` James Prestwood
  3 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2017-11-06 17:49 UTC (permalink / raw)
  To: ofono

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

---
 doc/sim-api.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/sim-api.txt b/doc/sim-api.txt
index 01ddc75..bce47c1 100644
--- a/doc/sim-api.txt
+++ b/doc/sim-api.txt
@@ -200,3 +200,8 @@ Properties	boolean Present [readonly]
 			might have changed the retry counters, i.e. calls to
 			ChangePin(), EnterPin(), ResetPin() LockPin(),
 			UnlockPin().
+
+		string ImsPrivateIdentity [readonly, optional]
+
+			Contains the SIM's ImsPrivateIdentity, read from the
+			ISIM.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/5] sim: implement create ISIM context
  2017-11-06 17:49 ` [PATCH 3/5] sim: implement create ISIM context James Prestwood
@ 2017-11-06 22:22   ` Denis Kenzior
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2017-11-06 22:22 UTC (permalink / raw)
  To: ofono

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

Hi James,

On 11/06/2017 11:49 AM, James Prestwood wrote:
> API to create a sim context for the ISIM application, if found.
> During AID discovery, if an ISIM AID is found, a new fs object is
> initialized for the ISIM which will be used for any future
> ISIM context creation.
> ---
>   src/sim.c | 41 +++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 41 insertions(+)
> 

Patches 2, 3, and 5 applied.  I made a minor tweak here:

> +	/*
> +	 * Check if the AID is even valid
> +	 */

Updated this comment and

> +	while (iter) {
> +		struct ofono_sim_aid_session *session = iter->data;
> +
> +		/*
> +		 * This AID based context is only relevant for an ISIM AID. A
> +		 * USIM application can be accessed with the 'default' FS
> +		 * context API's.
> +		 */

Removed this one.  It didn't make sense to me here.

> +		if (session->record->type == SIM_APP_TYPE_ISIM) {
> +			return sim_fs_context_new_with_aid(sim->simfs_isim,
> +					session->record->aid);
> +		}
> +
> +		iter = g_slist_next(iter);
> +	}
> +
> +	return NULL;
> +}
> +
>   void ofono_sim_context_free(struct ofono_sim_context *context)
>   {
>   	return sim_fs_context_free(context);

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/5] sim: added ImsPrivateIdentity to SimManager
  2017-11-06 17:49 ` [PATCH 4/5] sim: added ImsPrivateIdentity to SimManager James Prestwood
@ 2017-11-06 22:23   ` Denis Kenzior
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2017-11-06 22:23 UTC (permalink / raw)
  To: ofono

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

Hi James,

On 11/06/2017 11:49 AM, James Prestwood wrote:
> If the ISIM AID is found a new AID based context will be
> created and the EFIMPI file will be read from the SIM
> which contains the ImsPrivateIdentity.
> ---
>   src/ofono.h |  2 ++
>   src/sim.c   | 44 ++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 46 insertions(+)
> 
> diff --git a/src/ofono.h b/src/ofono.h
> index 007cd13..7e96c96 100644
> --- a/src/ofono.h
> +++ b/src/ofono.h
> @@ -419,6 +419,8 @@ enum sim_app_type __ofono_sim_session_get_type(
>   unsigned char *__ofono_sim_session_get_aid(
>   		struct ofono_sim_aid_session *session);
>   
> +const char *__ofono_sim_get_ims_private_id(struct ofono_sim *sim);
> +

get_impi()

>   #include <ofono/stk.h>
>   
>   typedef void (*__ofono_sms_sim_download_cb_t)(ofono_bool_t ok,
> diff --git a/src/sim.c b/src/sim.c
> index 23a6395..5da11d1 100644
> --- a/src/sim.c
> +++ b/src/sim.c
> @@ -126,6 +126,7 @@ struct ofono_sim {
>   	struct sim_fs *simfs_isim;
>   	struct ofono_sim_context *context;
>   	struct ofono_sim_context *early_context;
> +	struct ofono_sim_context *isim_context;
>   
>   	unsigned char *iidf_image;
>   	unsigned int *iidf_watch_ids;
> @@ -138,6 +139,7 @@ struct ofono_sim {
>   
>   	GSList *aid_sessions;
>   	GSList *aid_list;
> +	char *ims_identity;

char *impi;

>   };
>   
>   struct msisdn_set_request {
> @@ -409,6 +411,10 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
>   		ofono_dbus_dict_append(&dict, "ServiceProviderName",
>   					DBUS_TYPE_STRING, &sim->spn);
>   
> +	if (sim->ims_identity)
> +		ofono_dbus_dict_append(&dict, "ImsPrivateIdentity",
> +					DBUS_TYPE_STRING, &sim->ims_identity);
> +
>   	fdn = sim->fixed_dialing;
>   	ofono_dbus_dict_append(&dict, "FixedDialing", DBUS_TYPE_BOOLEAN, &fdn);
>   
> @@ -1458,6 +1464,25 @@ static void sim_set_ready(struct ofono_sim *sim)
>   	call_state_watches(sim);
>   }
>   
> +static void impi_read_cb(int ok, int total_length, int record,
> +		const unsigned char *data,
> +		int record_length, void *userdata)
> +{
> +	struct ofono_sim *sim = userdata;
> +
> +	if (!ok) {
> +		DBG("error reading IMPI");
> +		return;
> +	}
> +
> +	if (data[0] != 0x80) {
> +		DBG("invalid TLV tag 0x%02x", data[0]);
> +		return;
> +	}
> +
> +	sim->ims_identity = g_strndup((const char *)data + 2, data[1]);
> +}
> +
>   static void discover_apps_cb(const struct ofono_error *error,
>   		const unsigned char *dataobj,
>   		int len, void *data)
> @@ -1490,6 +1515,12 @@ static void discover_apps_cb(const struct ofono_error *error,
>   			 * the FS structure so the ISIM EF's can be accessed.
>   			 */
>   			sim->simfs_isim = sim_fs_new(sim, sim->driver);
> +			sim->isim_context = ofono_sim_context_create_isim(
> +					sim);
> +			/* attempt to get the NAI from EFimpi */
> +			ofono_sim_read_bytes(sim->isim_context,
> +					SIM_ISIM_EFIMPI_FILEID, 0, 255, NULL,
> +					0, impi_read_cb, sim);
>   		}
>   
>   		iter = g_slist_next(iter);
> @@ -2558,6 +2589,14 @@ static void sim_free_main_state(struct ofono_sim *sim)
>   		sim->context = NULL;
>   	}
>   
> +	if (sim->isim_context) {
> +		ofono_sim_context_free(sim->isim_context);
> +		sim->isim_context = NULL;
> +	}
> +
> +	if (sim->ims_identity)
> +		g_free(sim->ims_identity);
> +
>   	if (sim->aid_sessions)
>   		g_slist_free_full(sim->aid_sessions, aid_session_free);
>   }
> @@ -3417,6 +3456,11 @@ void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
>   	}
>   }
>   
> +const char *__ofono_sim_get_ims_private_id(struct ofono_sim *sim)
> +{
> +	return sim->ims_identity;
> +}
> +
>   static void open_channel_cb(const struct ofono_error *error, int session_id,
>   		void *data);
>   
> 

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-06 22:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 17:49 [PATCH 1/5] simfs: read files from specific AID's James Prestwood
2017-11-06 17:49 ` [PATCH 2/5] sim: header definitions for ISIM context API James Prestwood
2017-11-06 17:49 ` [PATCH 3/5] sim: implement create ISIM context James Prestwood
2017-11-06 22:22   ` Denis Kenzior
2017-11-06 17:49 ` [PATCH 4/5] sim: added ImsPrivateIdentity to SimManager James Prestwood
2017-11-06 22:23   ` Denis Kenzior
2017-11-06 17:49 ` [PATCH 5/5] docs: ImsPrivateIdentity property documentation James Prestwood

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.