From: Petteri Tikander <petteri.tikander@ixonos.com>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 1/8] sim: add function to read general info from SIM EF-file
Date: Thu, 14 Oct 2010 18:14:05 +0300 [thread overview]
Message-ID: <201010141814.05131.petteri.tikander@ixonos.com> (raw)
In-Reply-To: <4CB6E460.5040104@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4061 bytes --]
Hi Denis,
and thanks for comments
> > ---
> > include/sim.h | 11 +++++++++++
> > src/sim.c | 30 ++++++++++++++++++++++++++++--
> > 2 files changed, 39 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/sim.h b/include/sim.h
> > index 42b19bd..8dd6131 100644
> > --- a/include/sim.h
> > +++ b/include/sim.h
> > @@ -82,6 +82,7 @@ typedef void (*ofono_sim_file_info_cb_t)(const struct
> > ofono_error *error, enum ofono_sim_file_structure structure,
> > int recordlength,
> > const unsigned char access[3],
> > + unsigned char file_status,
> > void *data);
>
> I suggest breaking this out into a separate patch and shuffling patch 4
> and path 5 to follow after this patch. This patch should also come
> before the changes to ofono_sim_read_info.
>
OK.
I'll send in the next order (naturally updated versions according to the
comments):
2/8,
3/8,
1/8 (header-change only),
4/8,
5/8,
(6/8 applied),
1/8 (source code change: ofono_sim_read_info, no call-back handling),
7/8,
8/8
> > typedef void (*ofono_sim_read_cb_t)(const struct ofono_error *error,
> > @@ -206,6 +207,16 @@ int ofono_sim_write(struct ofono_sim *sim, int id,
> > int ofono_sim_read_bytes(struct ofono_sim *sim, int id,
> > unsigned short offset, unsigned short num_bytes,
> > ofono_sim_file_read_cb_t cb, void *data);
> > +
> > +/*
> > + * This function reads only general info from SIM-file with
> > + * requested id (file length, record length, file status etc),
> > + * not any records.
> > + */
> > +int ofono_sim_read_info(struct ofono_sim *sim, int id,
> > + enum ofono_sim_file_structure expected,
> > + ofono_sim_file_read_cb_t cb, void *data);
> > +
> > #ifdef __cplusplus
> > }
> > #endif
> > diff --git a/src/sim.c b/src/sim.c
> > index 6f10d4c..f0633bb 100644
> > --- a/src/sim.c
> > +++ b/src/sim.c
> > @@ -1183,6 +1183,15 @@ static void sim_efphase_read_cb(int ok, int
> > length, int record, sim->phase = data[0];
> > }
> >
> > +static void sim_info_read_cb(int ok, int length, int record,
> > + const unsigned char *file_status,
> > + int record_length, void *userdata)
> > +{
> > + DBG("OK: %d, length: %d, record: %d, \
> > + file_status: %x, record_length: %d",
> > + ok, length, record, file_status[0], record_length);
> > +}
> > +
>
> Is this function actually used?
Yes, but not with that debug-content. I'll separate this patch into two
patches (header/source), and send source-patch in logical order (where
ofono_sim_read/ofono_sim_read_cb are really used without just debugging).
>
> > static void sim_initialize_after_pin(struct ofono_sim *sim)
> > {
> > ofono_sim_read(sim, SIM_EFPHASE_FILEID,
> > @@ -1530,7 +1539,7 @@ int ofono_sim_read_bytes(struct ofono_sim *sim, int
> > id, return -1;
> >
> > return sim_fs_read(sim->simfs, id,
> > OFONO_SIM_FILE_STRUCTURE_TRANSPARENT, - offset, num_bytes, cb, data);
> > + FALSE, offset, num_bytes, cb, data);
> > }
> >
> > int ofono_sim_read(struct ofono_sim *sim, int id,
> > @@ -1540,7 +1549,24 @@ int ofono_sim_read(struct ofono_sim *sim, int id,
> > if (sim == NULL)
> > return -1;
> >
> > - return sim_fs_read(sim->simfs, id, expected_type, 0, 0, cb, data);
> > + return sim_fs_read(sim->simfs, id, expected_type, FALSE,
> > + 0, 0, cb, data);
> > +}
> > +
> > +int ofono_sim_read_info(struct ofono_sim *sim, int id,
> > + enum ofono_sim_file_structure expected_type,
> > + ofono_sim_file_read_cb_t cb, void *data)
> > +{
> > + /*
> > + * Retrieve EF-info only (file length, record length, file status etc).
> > + * So this function doesn't retrieve actual EF-contents.
> > + */
> > +
> > + if (sim == NULL)
> > + return -1;
> > +
> > + return sim_fs_read(sim->simfs, id, expected_type, TRUE,
> > + 0, 0, cb, data);
>
> This sim fs changes should precede this patch.
>
OK.
> > }
> >
> > int ofono_sim_write(struct ofono_sim *sim, int id,
>
> Regards,
> -Denis
>
prev parent reply other threads:[~2010-10-14 15:14 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 ` [RFC PATCH 2/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Denis Kenzior
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 [this message]
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=201010141814.05131.petteri.tikander@ixonos.com \
--to=petteri.tikander@ixonos.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox