From ee02b14836d7e30b45ee6fd62da6a8135c94c9dd Mon Sep 17 00:00:00 2001 From: Andrzej Zaborowski Date: Thu, 17 Sep 2009 22:43:22 +0200 Subject: Do PIN authentication This adds checking whether PIN is required during SIM initialisation and delaying the sim ready notifications until after correct PIN is given. --- include/sim.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/sim.h') diff --git a/include/sim.h b/include/sim.h index 1da486c7..751ae101 100644 --- a/include/sim.h +++ b/include/sim.h @@ -64,6 +64,12 @@ typedef void (*ofono_sim_file_read_cb_t)(int ok, typedef void (*ofono_sim_file_write_cb_t)(int ok, void *userdata); +typedef void (*ofono_sim_passwd_cb_t)(const struct ofono_error *error, + int passwd_type, void *data); + +typedef void (*ofono_sim_lock_unlock_cb_t)(const struct ofono_error *error, + void *data); + struct ofono_sim_driver { const char *name; int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data); @@ -90,6 +96,19 @@ struct ofono_sim_driver { ofono_sim_write_cb_t cb, void *data); void (*read_imsi)(struct ofono_sim *sim, ofono_sim_imsi_cb_t cb, void *data); + void (*query_passwd_state)(struct ofono_sim *sim, + ofono_sim_passwd_cb_t cb, void *data); + void (*send_passwd)(struct ofono_sim *sim, const char *passwd, + ofono_sim_lock_unlock_cb_t cb, void *data); + void (*reset_passwd)(struct ofono_sim *sim, const char *puk, + const char *passwd, + ofono_sim_lock_unlock_cb_t cb, void *data); + void (*change_passwd)(struct ofono_sim *sim, int passwd_type, + const char *old, const char *new, + ofono_sim_lock_unlock_cb_t cb, void *data); + void (*lock)(struct ofono_sim *sim, int passwd_type, int enable, + const char *passwd, + ofono_sim_lock_unlock_cb_t cb, void *data); }; int ofono_sim_driver_register(const struct ofono_sim_driver *d); -- cgit v1.2.3