summaryrefslogtreecommitdiffstats
path: root/src/simfs.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-11-23 06:40:55 -0600
committerDenis Kenzior <denkenz@gmail.com>2012-11-23 07:22:25 -0600
commit6eb95429073d52a05ba8d14c7459b1096b4e8e30 (patch)
tree71ad67dd4ea5a6fd14f329f3091273b7d344065f /src/simfs.c
parentb2a9b8abb6b949410a611e67facee0895c25f6f4 (diff)
downloadofono-6eb95429073d52a05ba8d14c7459b1096b4e8e30.tar.bz2
simfs: Handle optional EF paths
Diffstat (limited to 'src/simfs.c')
-rw-r--r--src/simfs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/simfs.c b/src/simfs.c
index 6b54f43d..03c8c9ef 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -66,6 +66,8 @@ struct sim_fs_op {
int length;
int record_length;
int current;
+ unsigned char path[6];
+ unsigned char path_len;
gconstpointer cb;
gboolean is_read;
void *userdata;
@@ -472,7 +474,8 @@ static gboolean sim_fs_op_read_block(gpointer user_data)
fs->driver->read_file_transparent(fs->sim, op->id,
op->current * 256,
read_bytes,
- NULL, 0,
+ op->path_len ? op->path : NULL,
+ op->path_len,
sim_fs_op_read_block_cb, fs);
return FALSE;
@@ -821,7 +824,9 @@ 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, NULL, 0,
+ driver->read_file_info(fs->sim, op->id,
+ op->path_len ? op->path : NULL,
+ op->path_len,
sim_fs_op_info_cb, fs);
} else {
switch (op->structure) {
@@ -894,6 +899,7 @@ int sim_fs_read_info(struct ofono_sim_context *context, int id,
int sim_fs_read(struct ofono_sim_context *context, int id,
enum ofono_sim_file_structure expected_type,
unsigned short offset, unsigned short num_bytes,
+ const unsigned char *path, unsigned int path_len,
ofono_sim_file_read_cb_t cb, void *data)
{
struct sim_fs *fs = context->fs;
@@ -926,6 +932,8 @@ int sim_fs_read(struct ofono_sim_context *context, int id,
op->num_bytes = num_bytes;
op->info_only = FALSE;
op->context = context;
+ memcpy(op->path, path, path_len);
+ op->path_len = path_len;
g_queue_push_tail(fs->op_q, op);