summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/simfs.c12
-rw-r--r--src/simfs.h1
2 files changed, 11 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);
diff --git a/src/simfs.h b/src/simfs.h
index 92e8fdb9..bb3ab0fd 100644
--- a/src/simfs.h
+++ b/src/simfs.h
@@ -42,6 +42,7 @@ void sim_fs_notify_file_watches(struct sim_fs *fs, 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 len,
ofono_sim_file_read_cb_t cb, void *data);
int sim_fs_read_info(struct ofono_sim_context *context, int id,