All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] sim: header definitions for AID session APIs
@ 2017-11-03 20:31 James Prestwood
  2017-11-03 20:31 ` [PATCH 2/3] sim: AID session management James Prestwood
  2017-11-03 20:31 ` [PATCH 3/3] atmodem: implement new driver APIs for AID sessions James Prestwood
  0 siblings, 2 replies; 3+ messages in thread
From: James Prestwood @ 2017-11-03 20:31 UTC (permalink / raw)
  To: ofono

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

ISIM and newer AID's require opening a logical channel to read
their EF's. This requires new driver API's to discover AID's,
open/close a channel, and reading the EF's from an opened channel.

This functionality was moved from the simauth module.
---
 include/sim.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
 src/ofono.h   |  2 ++
 2 files changed, 47 insertions(+)

diff --git a/include/sim.h b/include/sim.h
index 0c91ce2..e1130eb 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -30,6 +30,8 @@ extern "C" {
 
 struct ofono_sim;
 struct ofono_sim_context;
+struct ofono_sim_aid_session;
+enum sim_app_type;
 
 /* 51.011 Section 9.3 */
 enum ofono_sim_file_structure {
@@ -121,6 +123,18 @@ typedef void (*ofono_sim_lock_unlock_cb_t)(const struct ofono_error *error,
 typedef void (*ofono_query_facility_lock_cb_t)(const struct ofono_error *error,
 					ofono_bool_t status, void *data);
 
+typedef void (*ofono_sim_list_apps_cb_t)(const struct ofono_error *error,
+					const unsigned char *dataobj,
+					int len, void *data);
+typedef void (*ofono_sim_open_channel_cb_t)(const struct ofono_error *error,
+					int session_id, void *data);
+
+typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error,
+					void *data);
+
+typedef void (*ofono_sim_session_event_cb_t)(const struct ofono_error *error,
+		int session_id, void *data);
+
 struct ofono_sim_driver {
 	const char *name;
 	int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data);
@@ -173,6 +187,24 @@ struct ofono_sim_driver {
 	void (*query_facility_lock)(struct ofono_sim *sim,
 			enum ofono_sim_password_type lock,
 			ofono_query_facility_lock_cb_t cb, void *data);
+	void (*list_apps)(struct ofono_sim *sim,
+			ofono_sim_list_apps_cb_t cb, void *data);
+	void (*open_channel)(struct ofono_sim *sim, const unsigned char *aid,
+			ofono_sim_open_channel_cb_t cb, void *data);
+	void (*close_channel)(struct ofono_sim *sim, int session_id,
+			ofono_sim_close_channel_cb_t cb, void *data);
+	void (*session_read_binary)(struct ofono_sim *sim, int session,
+			int fileid, int start, int length,
+			const unsigned char *path, unsigned int path_len,
+			ofono_sim_read_cb_t cb, void *data);
+	void (*session_read_record)(struct ofono_sim *sim, int session_id,
+			int fileid, int record, int length,
+			const unsigned char *path, unsigned int path_len,
+			ofono_sim_read_cb_t cb, void *data);
+	void (*session_read_info)(struct ofono_sim *sim, int session_id,
+			int fileid, const unsigned char *path,
+			unsigned int path_len, ofono_sim_file_info_cb_t cb,
+			void *data);
 };
 
 int ofono_sim_driver_register(const struct ofono_sim_driver *d);
@@ -248,6 +280,19 @@ unsigned int ofono_sim_add_file_watch(struct ofono_sim_context *context,
 void ofono_sim_remove_file_watch(struct ofono_sim_context *context,
 					unsigned int id);
 
+unsigned int ofono_sim_add_session_watch(struct ofono_sim_aid_session *session,
+		ofono_sim_session_event_cb_t notify, void *data,
+		ofono_destroy_func destroy);
+
+void ofono_sim_remove_session_watch(struct ofono_sim_aid_session *session,
+		unsigned int id);
+
+struct ofono_sim_aid_session *ofono_sim_get_session_by_aid(
+		struct ofono_sim *sim, unsigned char *aid);
+
+struct ofono_sim_aid_session *ofono_sim_get_session_by_type(
+		struct ofono_sim *sim, enum sim_app_type type);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/ofono.h b/src/ofono.h
index bac4b48..96c4d91 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -389,6 +389,8 @@ void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
 
 void __ofono_sim_recheck_pin(struct ofono_sim *sim);
 
+GSList *__ofono_sim_get_aid_list(struct ofono_sim *sim);
+
 #include <ofono/stk.h>
 
 typedef void (*__ofono_sms_sim_download_cb_t)(ofono_bool_t ok,
-- 
2.7.4


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

end of thread, other threads:[~2017-11-03 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 20:31 [PATCH 1/3] sim: header definitions for AID session APIs James Prestwood
2017-11-03 20:31 ` [PATCH 2/3] sim: AID session management James Prestwood
2017-11-03 20:31 ` [PATCH 3/3] atmodem: implement new driver APIs for AID sessions 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.