* Handling of Fixed Dialing v4
@ 2010-10-14 21:02 Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Petteri Tikander
0 siblings, 1 reply; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 614 bytes --]
The goal of these patches is to check, if Fixed Dialing is enabled in SIM-card.
Because also invalidation/rehabilitation status of ADN has to be checked,
functionality is added for retrieving file-status of EF-files.
So general information of EF-files is returned (containing now also file status)
without starting the actual EF-content retrieving.
The FDN-enable status is checked. If FDN is enabled, SIM-initialisation routine is
interrupted (modem is left in PRE-SIM state), and FD-enabled property is signalled
over D-BUS.
oFono still trusts to EFphase value when selecting SIM/USIM access.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents
2010-10-14 21:02 Handling of Fixed Dialing v4 Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Petteri Tikander
2010-10-15 12:19 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Denis Kenzior
0 siblings, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3399 bytes --]
Handling of new parameter (file status) from the driver added.
This commit doesn't store EF-info into cache yet.
---
src/simfs.c | 29 +++++++++++++++++++++++++----
src/simfs.h | 1 +
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/simfs.c b/src/simfs.c
index fd768ef..ea09536 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -61,6 +61,7 @@ struct sim_fs_op {
unsigned char *buffer;
enum ofono_sim_file_structure structure;
unsigned short offset;
+ gboolean info_only;
int num_bytes;
int length;
int record_length;
@@ -433,7 +434,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);
@@ -445,6 +448,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);
@@ -480,11 +484,26 @@ 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);
} 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);
+ }
+
+ 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)
@@ -529,7 +548,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);
@@ -642,6 +661,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)
{
@@ -668,6 +688,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 c0b4c51..40f00d4 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);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 2/8] simutil: response-handler returns now also file-status
2010-10-14 21:02 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 3/8] sim: add new parameter to file-info utility Petteri Tikander
2010-10-15 12:20 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Denis Kenzior
2010-10-15 12:19 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Denis Kenzior
1 sibling, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]
---
src/simutil.c | 5 ++++-
src/simutil.h | 10 +++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/simutil.c b/src/simutil.c
index ed0970c..0474d2a 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -1406,7 +1406,8 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len,
gboolean sim_parse_2g_get_response(const unsigned char *response, int len,
int *file_len, int *record_len,
- int *structure, unsigned char *access)
+ int *structure, unsigned char *access,
+ unsigned char *file_status)
{
if (len < 14 || response[6] != 0x04)
return FALSE;
@@ -1421,6 +1422,8 @@ gboolean sim_parse_2g_get_response(const unsigned char *response, int len,
access[1] = response[9];
access[2] = response[10];
+ *file_status = response[11];
+
if (response[13] == 0x01 || response[13] == 0x03)
*record_len = response[14];
else
diff --git a/src/simutil.h b/src/simutil.h
index 69ef528..dc4ff57 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -58,6 +58,13 @@ enum sim_file_access {
SIM_FILE_ACCESS_NEVER = 15,
};
+/* 51.011 Section 9.3 */
+enum sim_file_status {
+ SIM_FILE_STATUS_INVALID = 0x00,
+ SIM_FILE_STATUS_VALID = 0x01,
+ SIM_FILE_STATUS_RW_WHEN_INVALID = 0x04,
+};
+
/* 131.102 Section 4.2.8 */
enum sim_ust_service {
SIM_UST_SERVICE_LOCAL_PHONE_BOOK = 0,
@@ -426,7 +433,8 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len,
gboolean sim_parse_2g_get_response(const unsigned char *response, int len,
int *file_len, int *record_len,
- int *structure, unsigned char *access);
+ int *structure, unsigned char *access,
+ unsigned char *file_status);
gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
enum sim_ust_service index);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 3/8] sim: add new parameter to file-info utility
2010-10-14 21:02 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Petteri Tikander
@ 2010-10-14 21:02 ` 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:21 ` [RFC PATCH 3/8] sim: add new parameter to file-info utility Denis Kenzior
2010-10-15 12:20 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Denis Kenzior
1 sibling, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 550 bytes --]
---
include/sim.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/sim.h b/include/sim.h
index 42b19bd..7860e24 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);
typedef void (*ofono_sim_read_cb_t)(const struct ofono_error *error,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file
2010-10-14 21:02 ` [RFC PATCH 3/8] sim: add new parameter to file-info utility Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
2010-10-15 12:26 ` [RFC PATCH 4/8] atmodem: " Denis Kenzior
2010-10-15 12:21 ` [RFC PATCH 3/8] sim: add new parameter to file-info utility Denis Kenzior
1 sibling, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2320 bytes --]
---
drivers/atmodem/sim.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index d0a7148..90d87bc 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -64,11 +64,12 @@ 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, 0, cbd->data);
return;
}
@@ -88,27 +89,31 @@ 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, 0, 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_VALID;
+ }
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, 0, cbd->data);
}
static void at_sim_read_info(struct ofono_sim *sim, int fileid,
@@ -123,7 +128,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, 1, data);
return;
}
}
@@ -142,7 +147,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, 0, data);
}
static void at_crsm_read_cb(gboolean ok, GAtResult *result,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file
2010-10-14 21:02 ` [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Petteri Tikander
2010-10-15 12:27 ` [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file Denis Kenzior
2010-10-15 12:26 ` [RFC PATCH 4/8] atmodem: " Denis Kenzior
1 sibling, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]
---
drivers/isimodem/sim.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/isimodem/sim.c b/drivers/isimodem/sim.c
index 44e539a..d978c85 100644
--- a/drivers/isimodem/sim.c
+++ b/drivers/isimodem/sim.c
@@ -54,6 +54,7 @@ struct file_info {
int structure;
int record_length;
unsigned char access[3];
+ unsigned char file_status;
};
/* Returns file info */
@@ -66,7 +67,7 @@ static gboolean fake_file_info(gpointer user)
DBG("Returning static file_info for %04x", fi->fileid);
CALLBACK_WITH_SUCCESS(cb,
fi->length, fi->structure, fi->record_length,
- fi->access, cbd->data);
+ fi->access, fi->file_status, cbd->data);
g_free(cbd);
return FALSE;
}
@@ -76,8 +77,8 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
{
int i;
static struct file_info const info[] = {
- { SIM_EFSPN_FILEID, 17, 0, 0, { 0x0f, 0xff, 0xff } },
- { SIM_EF_ICCID_FILEID, 10, 0, 0, { 0x0f, 0xff, 0xff } },
+ { SIM_EFSPN_FILEID, 17, 0, 0, { 0x0f, 0xff, 0xff }, 1 },
+ { SIM_EF_ICCID_FILEID, 10, 0, 0, { 0x0f, 0xff, 0xff }, 1 },
};
int N = sizeof(info) / sizeof(info[0]);
struct isi_cb_data *cbd;
@@ -91,7 +92,7 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
}
DBG("Not implemented (fileid = %04x)", fileid);
- CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, 0, data);
}
static gboolean spn_resp_cb(GIsiClient *client,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file
2010-10-14 21:02 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Petteri Tikander
2010-10-15 12:32 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Denis Kenzior
2010-10-15 12:27 ` [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file Denis Kenzior
1 sibling, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]
Not actual EF-contents returned, but file length, record length, file status etc.
---
include/sim.h | 10 ++++++++++
src/sim.c | 21 +++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/include/sim.h b/include/sim.h
index 7860e24..8dd6131 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -207,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 ab38e4f..d189350 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1710,7 +1710,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,
@@ -1720,7 +1720,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);
}
int ofono_sim_write(struct ofono_sim *sim, int id,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card
2010-10-14 21:02 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 8/8] doc: update sim-api Petteri Tikander
2010-10-15 12:33 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Denis Kenzior
2010-10-15 12:32 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Denis Kenzior
1 sibling, 2 replies; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3787 bytes --]
If SIM-card is inserted, status is checked from EFsst
(is FDN activated) and EFadn (is ADN invalidated).
If USIM-card is inserted, status is checked from EFest
(is FDN activated).
If FD is enabled, halt SIM initialization procedure.
New property (FixedDialing) is added. If FD is enabled,
this has been signalled via DBUS.
---
src/sim.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/src/sim.c b/src/sim.c
index d189350..45ab320 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -72,6 +72,7 @@ struct ofono_sim {
unsigned char efest_length;
unsigned char *efsst;
unsigned char efsst_length;
+ gboolean fixed_dialing;
char *imsi;
@@ -310,6 +311,9 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
ofono_dbus_dict_append(&dict, "SubscriberIdentity",
DBUS_TYPE_STRING, &sim->imsi);
+ ofono_dbus_dict_append(&dict, "FixedDialing", DBUS_TYPE_BOOLEAN,
+ &sim->fixed_dialing);
+
if (sim->mnc_length) {
char mcc[OFONO_MAX_MCC_LENGTH + 1];
char mnc[OFONO_MAX_MNC_LENGTH + 1];
@@ -1241,6 +1245,33 @@ static void sim_retrieve_imsi(struct ofono_sim *sim)
sim->driver->read_imsi(sim, sim_imsi_cb, sim);
}
+static void sim_info_read_cb(int ok, int length, int record,
+ const unsigned char *file_status,
+ int record_length, void *userdata)
+{
+ struct ofono_sim *sim = userdata;
+
+ if (!ok)
+ goto out;
+
+ if (*file_status != SIM_FILE_STATUS_VALID) {
+ DBusConnection *conn = ofono_dbus_get_connection();
+ const char *path = __ofono_atom_get_path(sim->atom);
+
+ sim->fixed_dialing = TRUE;
+
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_SIM_MANAGER_INTERFACE,
+ "FixedDialing",
+ DBUS_TYPE_BOOLEAN,
+ &sim->fixed_dialing);
+ return;
+ }
+
+out:
+ sim_retrieve_imsi(sim);
+}
+
static void sim_efsst_read_cb(int ok, int length, int record,
const unsigned char *data,
int record_length, void *userdata)
@@ -1258,6 +1289,21 @@ static void sim_efsst_read_cb(int ok, int length, int record,
sim->efsst = g_memdup(data, length);
sim->efsst_length = length;
+ /*
+ * Check if Fixed Dialing is enabled in the SIM-card
+ * (TS 11.11/TS 51.011, Section 11.5.1: FDN capability request).
+ * If FDN is activated and ADN is invalidated,
+ * don't continue initialization routine.
+ */
+ if (sim_sst_is_active(sim->efsst, sim->efsst_length,
+ SIM_SST_SERVICE_FDN)) {
+
+ ofono_sim_read_info(sim, SIM_EFADN_FILEID,
+ OFONO_SIM_FILE_STRUCTURE_FIXED,
+ sim_info_read_cb, sim);
+ return;
+ }
+
out:
sim_retrieve_imsi(sim);
}
@@ -1279,6 +1325,26 @@ static void sim_efest_read_cb(int ok, int length, int record,
sim->efest = g_memdup(data, length);
sim->efest_length = length;
+ /*
+ * Check if Fixed Dialing is enabled in the USIM-card
+ * (TS 31.102, Section 5.3.2: FDN capability request).
+ * If FDN is activated, don't continue initialization routine.
+ */
+ if (sim_est_is_active(sim->efest, sim->efest_length,
+ SIM_EST_SERVICE_FDN)) {
+ DBusConnection *conn = ofono_dbus_get_connection();
+ const char *path = __ofono_atom_get_path(sim->atom);
+
+ sim->fixed_dialing = TRUE;
+
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_SIM_MANAGER_INTERFACE,
+ "FixedDialing",
+ DBUS_TYPE_BOOLEAN,
+ &sim->fixed_dialing);
+ return;
+ }
+
out:
sim_retrieve_imsi(sim);
}
@@ -1865,6 +1931,8 @@ static void sim_free_state(struct ofono_sim *sim)
g_free(sim->iidf_image);
sim->iidf_image = NULL;
+
+ sim->fixed_dialing = FALSE;
}
void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 8/8] doc: update sim-api
2010-10-14 21:02 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Petteri Tikander
@ 2010-10-14 21:02 ` Petteri Tikander
2010-10-15 12:28 ` Denis Kenzior
2010-10-15 12:33 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Denis Kenzior
1 sibling, 1 reply; 19+ messages in thread
From: Petteri Tikander @ 2010-10-14 21:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
Fixed Dialing is not supported. New property added
to indicate FD-enable status in the SIM-card.
---
doc/sim-api.txt | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/doc/sim-api.txt b/doc/sim-api.txt
index 237e296..adf7c38 100644
--- a/doc/sim-api.txt
+++ b/doc/sim-api.txt
@@ -131,3 +131,13 @@ Properties boolean Present [readonly]
Contains the Intergrated Circuit Card Identifer (ICCID)
which is read directly from the SIM.
+
+ boolean FixedDialing [readonly]
+
+ True if a Fixed Dialing is enabled in SIM card.
+
+ Fixed Dialing is not supported, so status of FD is
+ checked during initialization after receiving PIN-code
+ (if PIN is required). If FD is enabled, initialization
+ procedure is halt. Then only emergency calls are
+ allowed.
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card
2010-10-14 21:02 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 8/8] doc: update sim-api Petteri Tikander
@ 2010-10-15 12:33 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:33 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 721 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> If SIM-card is inserted, status is checked from EFsst
> (is FDN activated) and EFadn (is ADN invalidated).
> If USIM-card is inserted, status is checked from EFest
> (is FDN activated).
>
> If FD is enabled, halt SIM initialization procedure.
> New property (FixedDialing) is added. If FD is enabled,
> this has been signalled via DBUS.
> ---
> src/sim.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 68 insertions(+), 0 deletions(-)
>
Can you update this patch to use the sim_fs_read_info API? Otherwise it
looks good. Have you tested this with real modems / sim cards?
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file
2010-10-14 21:02 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Petteri Tikander
@ 2010-10-15 12:32 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:32 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> Not actual EF-contents returned, but file length, record length, file status etc.
> ---
> include/sim.h | 10 ++++++++++
> src/sim.c | 21 +++++++++++++++++++--
> 2 files changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/include/sim.h b/include/sim.h
> index 7860e24..8dd6131 100644
> --- a/include/sim.h
> +++ b/include/sim.h
> @@ -207,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);
> +
This function is only needed by the sim atom, so I personally would
prefer to keep this API out from include/sim.h. Let us just introduce
sim_fs_read_info() instead. I also want a dedicated callback typedef
for this, e.g.:
typedef void (*sim_fs_read_info_cb_t)(int ok, unsigned char file_status,
int total_length,
int record_length,
void *userdata);
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file
2010-10-14 21:02 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Petteri Tikander
@ 2010-10-15 12:27 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:27 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> ---
> drivers/isimodem/sim.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
Patch has been applied. Thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file
2010-10-14 21:02 ` [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
@ 2010-10-15 12:26 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:26 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 266 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> ---
> drivers/atmodem/sim.c | 21 +++++++++++++--------
> 1 files changed, 13 insertions(+), 8 deletions(-)
>
Patch has been applied and refactored slightly afterwards.
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 3/8] sim: add new parameter to file-info utility
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:21 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:21 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 206 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> ---
> include/sim.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 2/8] simutil: response-handler returns now also file-status
2010-10-14 21:02 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 3/8] sim: add new parameter to file-info utility Petteri Tikander
@ 2010-10-15 12:20 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:20 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> ---
> src/simutil.c | 5 ++++-
> src/simutil.h | 10 +++++++++-
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
>
> +/* 51.011 Section 9.3 */
> +enum sim_file_status {
> + SIM_FILE_STATUS_INVALID = 0x00,
This enum value was not being used and I removed it afterwards.
> + SIM_FILE_STATUS_VALID = 0x01,
> + SIM_FILE_STATUS_RW_WHEN_INVALID = 0x04,
> +};
> +
Otherwise, patch looked good and has been applied.
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents
2010-10-14 21:02 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Petteri Tikander
@ 2010-10-15 12:19 ` Denis Kenzior
1 sibling, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-15 12:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
Hi Petteri,
On 10/14/2010 04:02 PM, Petteri Tikander wrote:
> Handling of new parameter (file status) from the driver added.
> This commit doesn't store EF-info into cache yet.
Please keep your commit header to less than 50 characters.
> + 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);
> +
So I honestly don't like us using the ofono_sim_file_read_cb_t for the
callback in the info only case. Can we invent a new callback type
specifically for this case?
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file
@ 2010-10-12 15:18 Petteri Tikander
2010-10-12 15:18 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
0 siblings, 1 reply; 19+ messages in thread
From: Petteri Tikander @ 2010-10-12 15:18 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]
---
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);
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;
+ }
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,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file
2010-10-12 15:18 [RFC PATCH 4/8] atmodem: returns file-status of SIM EF-file Petteri Tikander
@ 2010-10-12 15:18 ` Petteri Tikander
2010-10-14 10:58 ` Denis Kenzior
0 siblings, 1 reply; 19+ messages in thread
From: Petteri Tikander @ 2010-10-12 15:18 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]
---
drivers/isimodem/sim.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/isimodem/sim.c b/drivers/isimodem/sim.c
index e2ea275..bd7e9d6 100644
--- a/drivers/isimodem/sim.c
+++ b/drivers/isimodem/sim.c
@@ -54,6 +54,7 @@ struct file_info {
int structure;
int record_length;
unsigned char access[3];
+ unsigned char file_status;
};
/* Returns file info */
@@ -66,7 +67,7 @@ static gboolean fake_file_info(gpointer user)
DBG("Returning static file_info for %04x", fi->fileid);
CALLBACK_WITH_SUCCESS(cb,
fi->length, fi->structure, fi->record_length,
- fi->access, cbd->data);
+ fi->access, fi->file_status, cbd->data);
g_free(cbd);
return FALSE;
}
@@ -76,8 +77,10 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
{
int i;
static struct file_info const info[] = {
- { SIM_EFSPN_FILEID, 17, 0, 0, { 0x0f, 0xff, 0xff } },
- { SIM_EF_ICCID_FILEID, 10, 0, 0, { 0x0f, 0xff, 0xff } },
+ { SIM_EFSPN_FILEID, 17, 0, 0, { 0x0f, 0xff, 0xff },
+ SIM_FILE_STATUS_NOT_INVALID },
+ { SIM_EF_ICCID_FILEID, 10, 0, 0, { 0x0f, 0xff, 0xff },
+ SIM_FILE_STATUS_NOT_INVALID },
};
int N = sizeof(info) / sizeof(info[0]);
struct isi_cb_data *cbd;
@@ -91,7 +94,8 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
}
DBG("Not implemented (fileid = %04x)", fileid);
- CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL,
+ SIM_FILE_STATUS_NOT_AVAILABLE, data);
}
static gboolean spn_resp_cb(GIsiClient *client,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file
2010-10-12 15:18 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
@ 2010-10-14 10:58 ` Denis Kenzior
0 siblings, 0 replies; 19+ messages in thread
From: Denis Kenzior @ 2010-10-14 10:58 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
Hi Petteri,
On 10/12/2010 10:18 AM, Petteri Tikander wrote:
> ---
> drivers/isimodem/sim.c | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/isimodem/sim.c b/drivers/isimodem/sim.c
> index e2ea275..bd7e9d6 100644
> --- a/drivers/isimodem/sim.c
> +++ b/drivers/isimodem/sim.c
> @@ -54,6 +54,7 @@ struct file_info {
> int structure;
> int record_length;
> unsigned char access[3];
> + unsigned char file_status;
> };
>
> /* Returns file info */
> @@ -66,7 +67,7 @@ static gboolean fake_file_info(gpointer user)
> DBG("Returning static file_info for %04x", fi->fileid);
> CALLBACK_WITH_SUCCESS(cb,
> fi->length, fi->structure, fi->record_length,
> - fi->access, cbd->data);
> + fi->access, fi->file_status, cbd->data);
> g_free(cbd);
> return FALSE;
> }
> @@ -76,8 +77,10 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
> {
> int i;
> static struct file_info const info[] = {
> - { SIM_EFSPN_FILEID, 17, 0, 0, { 0x0f, 0xff, 0xff } },
> - { SIM_EF_ICCID_FILEID, 10, 0, 0, { 0x0f, 0xff, 0xff } },
> + { SIM_EFSPN_FILEID, 17, 0, 0, { 0x0f, 0xff, 0xff },
> + SIM_FILE_STATUS_NOT_INVALID },
> + { SIM_EF_ICCID_FILEID, 10, 0, 0, { 0x0f, 0xff, 0xff },
> + SIM_FILE_STATUS_NOT_INVALID },
Using 0 instead of SIM_FILE_STATUS_NOT_INVALID seems better.
> };
> int N = sizeof(info) / sizeof(info[0]);
> struct isi_cb_data *cbd;
> @@ -91,7 +94,8 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
> }
>
> DBG("Not implemented (fileid = %04x)", fileid);
> - CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL, data);
> + CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL,
> + SIM_FILE_STATUS_NOT_AVAILABLE, data);
> }
>
> static gboolean spn_resp_cb(GIsiClient *client,
Regards,
-Denis
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2010-10-15 12:33 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14 21:02 Handling of Fixed Dialing v4 Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Petteri Tikander
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-14 21:02 ` [RFC PATCH 5/8] isimodem: " Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Petteri Tikander
2010-10-14 21:02 ` [RFC PATCH 8/8] doc: update sim-api Petteri Tikander
2010-10-15 12:28 ` Denis Kenzior
2010-10-15 12:33 ` [RFC PATCH 7/8] sim: check if Fixed Dialing is enabled in the SIM-card Denis Kenzior
2010-10-15 12:32 ` [RFC PATCH 6/8] sim: add function for reading only general info from SIM-EF file Denis Kenzior
2010-10-15 12:27 ` [RFC PATCH 5/8] isimodem: returns file-status of SIM EF-file Denis Kenzior
2010-10-15 12:26 ` [RFC PATCH 4/8] atmodem: " Denis Kenzior
2010-10-15 12:21 ` [RFC PATCH 3/8] sim: add new parameter to file-info utility Denis Kenzior
2010-10-15 12:20 ` [RFC PATCH 2/8] simutil: response-handler returns now also file-status Denis Kenzior
2010-10-15 12:19 ` [RFC PATCH 1/8] simfs: add logic to retrieve only only EF-info, but no EF-contents Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
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-14 10:58 ` Denis Kenzior
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.