mirror of git://git.sysmocom.de/ofono
simfs: Handle optional EF paths
This commit is contained in:
parent
b2a9b8abb6
commit
6eb9542907
12
src/simfs.c
12
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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue