From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file
Date: Thu, 14 Oct 2010 05:57:21 -0500 [thread overview]
Message-ID: <4CB6E211.3040500@gmail.com> (raw)
In-Reply-To: <1286896694-3054-5-git-send-email-petteri.tikander@ixonos.com>
[-- Attachment #1: Type: text/plain, Size: 2965 bytes --]
Hi Petteri,
On 10/12/2010 10:18 AM, Petteri Tikander wrote:
> ---
> drivers/atmodem/sim.c | 24 ++++++++++++++++--------
> 1 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
> index d0a7148..d44b7d2 100644
> --- a/drivers/atmodem/sim.c
> +++ b/drivers/atmodem/sim.c
> @@ -64,11 +64,13 @@ static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data)
> int flen, rlen;
> int str;
> unsigned char access[3];
> + unsigned char file_status;
>
> decode_at_error(&error, g_at_result_final_response(result));
>
> if (!ok) {
> - cb(&error, -1, -1, -1, NULL, cbd->data);
> + cb(&error, -1, -1, -1, NULL,
> + SIM_FILE_STATUS_NOT_AVAILABLE, cbd->data);
In the cases where an error occurs, I suggest passing in -1 for the
file_status.
> return;
> }
>
> @@ -88,27 +90,33 @@ static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data)
> error.type = OFONO_ERROR_TYPE_SIM;
> error.error = (sw1 << 8) | sw2;
>
> - cb(&error, -1, -1, -1, NULL, cbd->data);
> + cb(&error, -1, -1, -1, NULL,
> + SIM_FILE_STATUS_NOT_AVAILABLE, cbd->data);
> return;
> }
>
> DBG("crsm_info_cb: %02x, %02x, %i", sw1, sw2, len);
>
> - if (response[0] == 0x62)
> + if (response[0] == 0x62) {
> ok = sim_parse_3g_get_response(response, len, &flen, &rlen,
> &str, access, NULL);
> +
> + file_status = SIM_FILE_STATUS_NOT_AVAILABLE;
For this case, file_status should be 0. From what I remember of ETSI
102.221 3G sims do not return response data for invalidated files. But
please double check this, or perhaps someone on the list knows.
> + }
> else
> ok = sim_parse_2g_get_response(response, len, &flen, &rlen,
> - &str, access);
> + &str, access, &file_status);
>
> if (!ok)
> goto error;
>
> - cb(&error, flen, str, rlen, access, cbd->data);
> + cb(&error, flen, str, rlen, access, file_status, cbd->data);
> +
> return;
>
> error:
> - CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, cbd->data);
> + CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL,
> + SIM_FILE_STATUS_NOT_AVAILABLE, cbd->data);
> }
>
> static void at_sim_read_info(struct ofono_sim *sim, int fileid,
> @@ -123,7 +131,7 @@ static void at_sim_read_info(struct ofono_sim *sim, int fileid,
> unsigned char access[3] = { 0x00, 0x00, 0x00 };
>
> if (fileid == SIM_EFAD_FILEID) {
> - CALLBACK_WITH_SUCCESS(cb, 4, 0, 0, access, data);
> + CALLBACK_WITH_SUCCESS(cb, 4, 0, 0, access, 0x01, data);
> return;
> }
> }
> @@ -142,7 +150,7 @@ static void at_sim_read_info(struct ofono_sim *sim, int fileid,
> return;
>
> error:
> - CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, data);
> + CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, 0xFF, data);
> }
>
> static void at_crsm_read_cb(gboolean ok, GAtResult *result,
Regards,
-Denis
next prev parent reply other threads:[~2010-10-14 10:57 UTC|newest]
Thread overview: 24+ 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 ` Denis Kenzior [this message]
2010-10-14 16:54 ` [RFC PATCH 4/8] atmodem: " 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
-- strict thread matches above, loose matches on Subject: below --
2010-10-14 21:02 [RFC PATCH 3/8] sim: add new parameter to file-info utility Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file Petteri Tikander
2010-10-15 12:26 ` Denis Kenzior
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=4CB6E211.3040500@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox