From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 2/8] simfs: add logic to retrieve only only EF-info, but no EF-contents
Date: Thu, 14 Oct 2010 06:10:31 -0500 [thread overview]
Message-ID: <4CB6E527.90204@gmail.com> (raw)
In-Reply-To: <1286896694-3054-3-git-send-email-petteri.tikander@ixonos.com>
[-- Attachment #1: Type: text/plain, Size: 3781 bytes --]
Hi Petteri,
On 10/12/2010 10:18 AM, Petteri Tikander wrote:
> Handling of new parameter (file status) from the driver added.
> This commit doesn't store EF-info into cache yet.
> ---
> src/simfs.c | 27 +++++++++++++++++++++++----
> src/simfs.h | 1 +
> 2 files changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/src/simfs.c b/src/simfs.c
> index b5b12b4..24ce7ec 100644
> --- a/src/simfs.c
> +++ b/src/simfs.c
> @@ -58,6 +58,7 @@ struct sim_fs_op {
> int id;
> enum ofono_sim_file_structure structure;
> unsigned short offset;
> + gboolean info_only;
> int num_bytes;
> int length;
> int record_length;
> @@ -426,7 +427,9 @@ static gboolean sim_fs_op_read_record(gpointer user)
> static void sim_fs_op_info_cb(const struct ofono_error *error, int length,
> enum ofono_sim_file_structure structure,
> int record_length,
> - const unsigned char access[3], void *data)
> + const unsigned char access[3],
> + const unsigned char file_status,
> + void *data)
> {
> struct sim_fs *fs = data;
> struct sim_fs_op *op = g_queue_peek_head(fs->op_q);
> @@ -438,6 +441,7 @@ static void sim_fs_op_info_cb(const struct ofono_error *error, int length,
> unsigned char fileinfo[SIM_CACHE_HEADER_SIZE];
> gboolean cache;
> char *path;
> + ofono_sim_file_read_cb_t cb = op->cb;
>
> if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> sim_fs_op_error(fs);
> @@ -473,11 +477,24 @@ static void sim_fs_op_info_cb(const struct ofono_error *error, int length,
>
> op->record_length = length;
> op->current = op->offset / 256;
> - fs->op_source = g_idle_add(sim_fs_op_read_block, fs);
> + if (!op->info_only)
> + fs->op_source = g_idle_add(sim_fs_op_read_block, fs);
Please watch out for coding style violations. There should be an empty
line before the if statement.
> } else {
> op->record_length = record_length;
> op->current = 1;
> - fs->op_source = g_idle_add(sim_fs_op_read_record, fs);
> + if (!op->info_only)
> + fs->op_source = g_idle_add(sim_fs_op_read_record, fs);
Same comment as above
> + }
> +
> + if (op->info_only) {
> + /*
> + * It's info-only request. So there is no need to request
> + * actual contents of the EF-files. Just return the EF-info.
> + */
> + cb(1, op->length, op->current,
> + &file_status, op->record_length, op->userdata);
> +
> + sim_fs_end_current(fs);
> }
>
> if (imsi == NULL || cache == FALSE)
> @@ -522,7 +539,7 @@ static gboolean sim_fs_op_check_cached(struct sim_fs *fs)
> enum ofono_sim_file_structure structure;
> int record_length;
>
> - if (!imsi)
> + if (!imsi || !op->info_only)
> return FALSE;
>
> path = g_strdup_printf(SIM_CACHE_PATH, imsi, phase, op->id);
> @@ -635,6 +652,7 @@ static gboolean sim_fs_op_next(gpointer user_data)
>
> int sim_fs_read(struct sim_fs *fs, int id,
> enum ofono_sim_file_structure expected_type,
> + gboolean info_only,
> unsigned short offset, unsigned short num_bytes,
> ofono_sim_file_read_cb_t cb, void *data)
> {
> @@ -661,6 +679,7 @@ int sim_fs_read(struct sim_fs *fs, int id,
> op->is_read = TRUE;
> op->offset = offset;
> op->num_bytes = num_bytes;
> + op->info_only = info_only;
>
> g_queue_push_tail(fs->op_q, op);
>
> diff --git a/src/simfs.h b/src/simfs.h
> index 6d5dded..284d15b 100644
> --- a/src/simfs.h
> +++ b/src/simfs.h
> @@ -26,6 +26,7 @@ struct sim_fs *sim_fs_new(struct ofono_sim *sim,
>
> int sim_fs_read(struct sim_fs *fs, int id,
> enum ofono_sim_file_structure expected_type,
> + gboolean info_only,
> unsigned short offset, unsigned short num_bytes,
> ofono_sim_file_read_cb_t cb, void *data);
>
Regards,
-Denis
next prev parent reply other threads:[~2010-10-14 11:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 15:18 Handling of Fixed Dialing v3 Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 1/8] sim: add function to read general info from SIM EF-file Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 2/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 3/8] simutil: response-handler returns now also file-status Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 6/8] simutil: add ID of EFadn Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 8/8] doc: update sim-api Petteri Tikander
2010-10-14 5:56 ` Marcel Holtmann
2010-10-14 11:22 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Denis Kenzior
2010-10-14 11:24 ` Denis Kenzior
2010-10-14 10:43 ` [RFC PATCH 6/8] simutil: add ID of EFadn Denis Kenzior
2010-10-14 10:58 ` [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file Denis Kenzior
2010-10-14 10:57 ` [RFC PATCH 4/8] atmodem: " Denis Kenzior
2010-10-14 16:54 ` Petteri Tikander
2010-10-14 11:03 ` Denis Kenzior
2010-10-14 10:41 ` [RFC PATCH 3/8] simutil: response-handler returns now also file-status Denis Kenzior
2010-10-14 16:12 ` Petteri Tikander
2010-10-14 11:10 ` Denis Kenzior [this message]
2010-10-14 11:07 ` [RFC PATCH 1/8] sim: add function to read general info from SIM EF-file Denis Kenzior
2010-10-14 15:14 ` Petteri Tikander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CB6E527.90204@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.